icinga¶
Icinga module.
-
class
spicerack.icinga.
Icinga
(icinga_host, *, config_file='/etc/icinga/icinga.cfg')[source]¶ Bases:
object
Class to interact with the Icinga server.
-
__init__
(icinga_host, *, config_file='/etc/icinga/icinga.cfg')[source]¶ Initialize the instance.
Parameters: icinga_host (spicerack.remote.RemoteHosts) -- the RemoteHosts instance for the Icinga server.
-
_get_command_string
(*args)[source]¶ Get the Icinga command to execute given the current arguments.
Parameters: *args -- positional arguments to use to compose the Icinga command string. Returns: the command line to execute on the Icinga host. Return type: str
-
command_file
¶ Getter for the command_file property.
Raises: spicerack.icinga.IcingaError
-- if unable to get the command file path.Returns: the path of the Icinga command file. Return type: str
-
downtime_hosts
(hosts, reason, *, duration=datetime.timedelta(0, 14400))[source]¶ Downtime hosts on the Icinga server for the given time with a message.
Parameters: - hosts (list, cumin.NodeSet) -- an iterable with the list of hostnames to downtime.
- reason (spicerack.administrative.Reason) -- the reason to set for the downtime on the Icinga server.
- duration (datetime.timedelta, optional) -- the length of the downtime period.
-
-
exception
spicerack.icinga.
IcingaError
[source]¶ Bases:
spicerack.exceptions.SpicerackError
Custom exception class for errors of this module.