Declarative configuration library for Uptime Robot
Latest commit 2222272 Jan 23, 2016 @knyar Extract common contact creation logic into a separate function
Also, explain how to use that function directly to define contacts that
cannot be created using API.
Failed to load latest commit information.
docs Make `friendlyname` optional for contacts. Jan 17, 2016
urconf Extract common contact creation logic into a separate function Jan 23, 2016
README.rst Extract common contact creation logic into a separate function Jan 23, 2016
requirements.txt Add travis-ci integration Jan 17, 2016
tox.ini Initial commit Jan 17, 2016


Declarative configuration library for Uptime Robot

urconf is a Python library for Uptime Robot <> API. It expects definition of all your contacts and monitors, and then issues API calls required to configure your Uptime Robot accordingly.


Install urconf using pip: pip install urconf

Write your monitoring configuration as a Python script:

import logging
import urconf

# urconf logs all operations that change configuration at the INFO level.
# Use DEBUG to see API call contents.

config = urconf.UptimeRobot("api-key")  # dry_run=True enables dry mode

# Define contacts
email = config.email_contact("")
boxcar = config.boxcar_contact("boxcar-api-key", "my boxcar")

# Define monitors
ssh = config.port_monitor("ssh on server1", "", 22)
web = config.keyword_monitor(
    "my site", "", "welcome to!")
# More complex example with HTTP auth and non-standard monitoring interval
backend = config.keyword_monitor(
    "my backend", "", "Cannot connect to database",
    should_exist=False, http_username="admin", http_password="password",

# Associate contacts with monitors
for monitor in (ssh, web, backend):
    monitor.add_contacts(email, boxcar)

# Sync configuration to Uptime Robot

Run the script to sync configuration.


Currently implemented:

  • email and boxcar contacts;
  • keyword and port monitors.

Pull requests extending supported types of contacts or monitors are very welcome.

If you need to use contact types which are not supported by the newAlertContact method of Uptime Robot API (for example, HipChat or Slack), you can create the contact manually in the web UI, define it in your configuration file by calling the method directly and then use that contact in add_contacts normally:

config = urconf.UptimeRobot("api-key")
hipchat =, value="123", friendlyname="Hipchat")
config.port_monitor("ssh1", "", 22).add_contacts(hipchat)


Since uptimerobot API does not support modifying contacts, when contact modification is detected, urconf has to remove the old contact and re-add it. This means that e-mail contacts have to be re-verified manually again.

Development notes

  • refer to API documentation <> while implementing additional functionality;
  • run tox to run the tests in Python 2.7 and 3.4 environments;
  • run make html in docs/ to build documentation in HTML. It can be viewed in docs/_build/html/ afterwards.


urconf is licensed under the MIT license.