Builtin Services used by Watchers ================================= Default service --------------- .. autoclass:: watchghost.services.Service Ping ---- Default configuration: .. code-block:: json { "repeat": 60, "timeout": 3, "ip_version": 4, } :timeout: time allowed before throwing a timeout :ip_version: version of the IP protocol (4 or 6) HTTP ---- Default configuration: .. code-block:: json { "repeat": 60, "timeout": 5, "url": "", "ip_version": 4, "status": {[ ("error", [{"code": i} for i in range(400, 432)]), ("warning", [{"code": i} for i in range(300, 308)]), ("info", [{"code": i} for i in range(200, 226)]), ("critical", [{}]), ]}, } :timeout: time allowed before throwing a timeout :url: the URL checked by the watcher :ip_version: version of the IP protocol (4 or 6) :status: define the error to repport based on the http status in response FTP --- .. code-block:: json { "repeat": 60, "timeout": 5, "ip_version": 4, "url": "", } :timeout: time allowed before throwing a timeout :url: the URL checked by the watcher :ip_version: version of the IP protocol (4 or 6) SecuredSocket ------------- Verify a certificate validity .. code-block:: json { "repeat": 60, "ip_version": 4, "hostname": "", "port": 443, "minimum_days_left": 30, "status": {[ ["error", [ {"hostname_verified": False}, {"in_period": False}, {"connected": False}, ]], ["warning", [{"enough_days_left": False}]], ["info", [{}]], ]}, } :ip_version: version of the IP protocol (4 or 6) :hostname: name of the host of the certificate :port: port emiting the the certificate :minimum_days_left: number of days of validity left in the certificate before an alert :status: error, warning or info can be throwed depending on different issues: :hostname_verified: `true` if the hostname is effectively verified by the certificate. :in_period: `true` the certificate is in the period of validity :connected: `true` the certificate can be reached :enough_days_left: `true` if there are more days of validity left than `minimum_days_left` SSH --- .. code-block:: json { "command": [], "status": {[ ("error", [{"exit_code": 2}]), ("warning", [{"exit_code": 1}]), ("info", [{"exit_code": 0}]), ]}, } :command: the command and the parameters to be executed on the remote server :exit_code: code returned by the command Shell ----- .. code-block:: json { "timeout": 10, "command": "", "status": {[ ("error", [{"return_code": 2}]), ("warning", [{"return_code": 1}]), ("info", [{"return_code": 0}]), ("critical", [{}]), ]}, } :timeout: time allowed before throwing a timeout :command: the command executed on the watchghost server :return_code: the code returned by the command