Coder Social home page Coder Social logo

edaubert / uptimerobot-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uptimerobot/uptimerobot-cli

0.0 2.0 0.0 65 KB

(unofficial) linux command line interface for www.uptimerobot.com

License: GNU General Public License v3.0

Python 100.00%

uptimerobot-cli's Introduction

UptimeRobot client

A module (with command line application) to access uptimetobot.com API.

Author: Bil Bas ([email protected])

License: GPLv3

Tested on Python 2.7 and 3.3.

Installation

$ pip install uptimerobot

Usage

The command line application

The CLI application will take default values from ./.uptimerobot.yml and/or ~/.uptimerobot.yml (at the least, the api_key needs to be defined in one of these):

$ uptimerobot -h

usage: uptimerobot [-h] SUBCOMMAND [OPTION, ...]

Manage monitors and alert contacts at UptimeRobot.com

If files exist, application will take defaults from:
    ./.uptimerobot.yml
    ~/.uptimerobot.yml

optional arguments:
  -h, --help            show this help message and exit

Subcommands:
    get-monitors        Get information about some or all monitors
    new-monitor         Create a new monitor
    edit-monitor        Edit an existing monitor
    delete-monitor      Delete a monitor
    get-alerts          Get information about some or all alert contacts
    new-alert           Create a new alert contact
    delete-alert        Delete an alert contact

The Python module

Users can use the API directly, via the uptimerobot Client class:

from uptimerobot import Client

client = Client("my_api_key")

monitors = client.get_monitors(ids=[123123, 775643],
                               show_logs=True,
                               show_alert_contacts=True)

for monitor in monitors:
    print(monitor.name)
    print(monitor.status_str)

    for alert_contact in monitor.alert_contacts:
        print(alert_contact.type_str)
        print(alert_contact.value)

    for log in monitor.logs:
        print(log.datetime)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.