urconf package¶
Submodules¶
urconf.uptimerobot module¶
-
class
urconf.uptimerobot.UptimeRobot(*args, **kwargs)¶ Bases:
objectUptimeRobot is the main object used to sync configuration.
It keeps alert contacts and monitors defined by the user in self._contacts and self_monitors lists.
-
boxcar_contact(*args, **kwargs)¶ Defines a Boxcar contact.
Parameters: - name – (string) name used for this contact in the Uptime Robot web interface.
- key – (string) boxcar API key (defaults to name if not specified).
Returns: Contact object which can later be used in add_contacts method of a monitor.
-
email_contact(*args, **kwargs)¶ Defines an email contact.
Parameters: - name – (string) name used for this contact in the Uptime Robot web interface.
- email – (string) e-mail address (defaults to name if not specified)
Returns: Contact object which can later be used in add_contacts method of a monitor.
-
keyword_monitor(*args, **kwargs)¶ Defines a keyword monitor.
Parameters: - name – (string) name used for this monitor in the Uptime Robot web interface.
- url – (string) URL to check.
- keyword – (string) Keyword to check.
- should_exist – (string) Whether the keyword should exist or not (defaults to True).
- http_username – (string) Username to use for HTTP authentification.
- http_password – (string) Password to use for HTTP authentification.
- interval – (int) Monitoring interval in minutes.
Returns: Monitor object.
-
port_monitor(*args, **kwargs)¶ Defines a port monitor.
Parameters: - name – (string) name used for this monitor in the Uptime Robot web interface.
- hostname – (string) Host name to check.
- port – (int) TCP port.
- interval – (int) Monitoring interval in minutes.
Returns: Monitor object.
-
sync()¶ Synchronizes configuration with the Uptime Robot API.
This method should be called after all contacts and monitors have been defined and will sync defined configuration to the Uptime Robot.
-
-
exception
urconf.uptimerobot.UptimeRobotAPIError¶ Bases:
exceptions.ExceptionAn exception which is raised when Uptime Robot API returns an error.
urconf.uptimerobot_syncable module¶
-
class
urconf.uptimerobot_syncable.Contact(**kwargs)¶ Bases:
urconf.uptimerobot_syncable.Syncable-
TYPE_BOXCAR= 4¶
-
TYPE_EMAIL= 2¶
-
-
class
urconf.uptimerobot_syncable.Monitor(**kwargs)¶ Bases:
urconf.uptimerobot_syncable.Syncable-
TYPE_KEYWORD= 2¶
-
TYPE_PORT= 4¶
-
add_contacts(*args, **kwargs)¶ Defines contacts for a monitor.
Parameters: - args – one or more Contact objects (returned by functions like email_contact or boxcar_contact).
- threshold – alert threshold (the x value that is set to define “if down for x minutes, alert every y minutes).
- recurrence – alert recurrence (the y value that is set to define “if down for x minutes, alert every y minutes).
-