swh.icinga_plugins.save_code_now module#

class swh.icinga_plugins.save_code_now.SaveCodeNowCheck(obj: Dict, origin: str | List[str], visit_type: str)[source]#

Bases: BaseCheck

TYPE = 'SAVECODENOW'#
DEFAULT_WARNING_THRESHOLD = 60#
DEFAULT_CRITICAL_THRESHOLD = 120#
static api_url_scn(root_api_url: str, origin: str, visit_type: str) str[source]#

Compute the save code now api url for a given origin

main() int[source]#

Scenario description:

1. Requests a save code now request via the api for the given origin (or an origin picked at random in the list) with type self.visit_type.

  1. Polling regularly at self.poll_interval seconds the completion status.

3. When either succeeded, failed or threshold exceeded, report approximate time of completion. This will warn if thresholds are exceeded.