Server monitor#
import Yasb
Whether your servers and websites answer, how fast, and how long their certificates last, with Windows
notifications when they go offline. Checked every interval seconds set with configure(). All ServerChecks
objects with the same settings share one check.
ServerChecks#
Nothing is checked until configure() is called with at least one server.
Properties#
results : list read-only#
The servers after the last check, in the order given. Each is an object:
name: string, the server's name, or its URL when it has none.url: string, the URL checked, withhttps://orhttp://added when it had no scheme.status: string,Onlinewhen the server answered with a code below 500, otherwiseOffline.response_time: int, milliseconds until it answered.nullwhen it didn't.response_code: int, the HTTP status code.nullwhen it didn't answer.ssl: int, days until its certificate expires.nullwhen not checked.
loading : bool read-only#
true while the servers are checked.
configured : bool read-only#
true when configure() was given at least one server.
error : string read-only#
"Could not check servers." when the last check failed, otherwise "".
updated : date read-only#
When the last check ended. Invalid before the first.
Functions#
configure(servers: list, sslVerify: bool, sslCheck: bool, timeout: int, interval: int, sslWarning: int, notifyOffline: bool, notifySsl: bool)#
Sets what to check. If no other ServerChecks uses these settings, they're checked immediately.
servers: each a URL, or an object withurland an optionalname. Empty URLs are skipped.sslVerify:truechecks each server's certificate and host name,falseaccepts any certificate.-
sslCheck:trueaddshttps://to a server without a scheme, and reads how long the certificate of each online HTTPS server lasts.falseaddshttp://. -
timeout: seconds each server has to answer, from 1 to 30. interval: seconds from the end of one check to the next, from 10 to 36000.sslWarning: days, from 1 to 365. SeenotifySsl.-
notifyOffline:trueshows a Windows notification after a check that finds servers offline. Not while the PC has no network. -
notifySsl:trueshows a Windows notification after a check that finds a certificate expiring in fewer thansslWarningdays.
refresh()#
Checks now. Ignored while a check is in progress.
ServerChecks has no signals.
Used by#
YASB's own Server monitor widget, listed in Widgets.