up-timer

0.3.1 • Public • Published

A JavaScript library for managing monitors via the Uptime Robot API. Written with Node.js version 8 for the current Uptime Robot APIv2.

Features

Current features include creating, retrieving, pausing, resuming, deleting and scheduling monitors.

Installation

npm install up-timer

Alternatively, you can clone or fork repo, npm install dependencies and npm test to run tests. An optional development server with cron capabilities can be run via npm start.

Example usage

Get an API key from Uptime Robot and either pass it to your instantiation function or store it as an environment variable named UPTIMER.

const Uptimer = require('up-timer');
const client = new Uptimer('myAPIkey'); // if UPTIMER env var exists, this function can be called without arguments

client.getMonitors(); // Get all your Uptime Robot monitors. 
client.listMonitors(); // Get all monitors and list by ID, name and status.
client.pauseAll(); // Pause monitors.
client.resumeAll(); // Resume monitors.
client.create('name', 'url', 'method'); // Create a monitor. Name is up to you. Url must be a valid url. Method can be 'http', 'https', 'keyword', 'ping' or 'port'.
client.pause('monitorId') // Pause a single monitor.
client.resume('monitorId') // Resume a single monitor.
client.delete('monitorId') // Delete a single monitor.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.11latest

Version History

VersionDownloads (Last 7 Days)Published
0.3.11
0.3.00
0.2.10
0.2.00
0.1.10
0.1.00

Package Sidebar

Install

npm i up-timer

Weekly Downloads

1

Version

0.3.1

License

ISC

Last publish

Collaborators

  • niilo