okfn/cachet-uptime-robot

Name: cachet-uptime-robot

Owner: Open Knowledge International

Description: Get data from UptimeRobot and send it to Cachet

Forked from: Axiacore/cachet-uptime-robot

Created: 2017-08-29 16:45:15.0

Updated: 2018-02-23 18:59:10.0

Pushed: 2017-09-05 14:36:08.0

Homepage:

Size: 34

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Cachet Uptime Robot

Cachet is an open source status page system, this repository is a Python script that does two things, first, it reads the status of a page in UptimeRobot and updates a cachet component based on that status and second, it updates a metric with the historic uptime ratio from Uptime Robot.

Component status: Uptime Robot (left), Cachet (right)

Getting started

To get started, you have to specify your Cachet and UptimeRobot settings and in config.ini.

imeRobot]
meRobotMainApiKey = your-api-key

ps://url.in.uptime.robot.com]
etApiKey = cachet-api-key
etUrl = https://status.mycompany.com
icId = 1
onentId = 1
Usage

Register a cron that runs update_status.py every 5 minutes.

en cron file to edit.
tab -e

Edit the crontab file and add this line:

* * * * python3 ~/path/update_status.py ~/path/config.ini

Note that the path of the update_status.py & config.ini files may vary depending on the location you cloned the repository

Running manually

You can also update your Cachet data manually by running this:

on3 update_status.py config.ini

Updating monitor MySite. URL: http://mysite.co. ID: 12345678
Metric created: {'data': {'calculated_value': 99.99, 'counter': 1, 'metric_id': 4, 'value': 99.99, 'created_at': '2016-08-12 08:23:10', 'updated_at': '2016-08-12 08:23:10', 'id': 99}}

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.