Control Package

Control Package

The Control module includes classes to control the Nagios service and the Command submodule wraps Nagios commands.

class pynag.Control.daemon(nagios_bin='/usr/bin/nagios', nagios_cfg='/etc/nagios/nagios.cfg', nagios_init='/etc/init.d/nagios', sudo=False, shell=True)

Control the nagios daemon through python

reload()

Reloads Nagios via it’s init script.

restart()

Restarts Nagios via it’s init script.

status()

Returns the status of the Nagios service.

verify_config()

Run nagios -v config_file to verify that the conf is working