The M(nagios) module has two basic functions: scheduling downtime and toggling alerts for services or hosts. ,All actions require the I(host) parameter to be given explicitly. In playbooks you can use the C() variable to refer to the host the playbook is currently running on. ,You can specify multiple services at once by separating them with commas, .e.g., C(services=httpd,nfs,puppet). ,When specifying what service to handle there is a special service value, I(host), which will handle alerts/downtime for the I(host itself), e.g., C(service=host). This keyword may not be given with other services at the same time. I(Setting alerts/downtime for a host does not affect alerts/downtime for any of the services running on it.) To schedule downtime for all services on particular host use keyword "all", e.g., C(service=all). ,When using the M(nagios) module you will need to specify your Nagios server using the C(delegate_to) parameter.


  • Action to take.
  • servicegroup options were added in 2.0.
  • downtime
  • enable_alertsdisable_alertssilenceunsilencesilence_nagiosunsilence_nagioscommandservicegroup_service_downtimeservicegroup_host_downtime
host Host to operate on in Nagios.
cmdfile Path to the nagios I(command file) (FIFO pipe). Only required if auto-detection fails.
author Author to leave downtime comments as. Only usable with the C(downtime) action.
comment Comment for C(downtime) action.
  • Minutes to schedule downtime for.
  • Only usable with the C(downtime) action.
services What to manage downtime/alerts for. Separate multiple services with commas. C(service) is an alias for C(services). B(Required) option when using the C(downtime), C(enable_alerts), and C(disable_alerts) actions. true
servicegroup The Servicegroup we want to set downtimes/alerts for. B(Required) option when using the C(servicegroup_service_downtime) amd C(servicegroup_host_downtime).
command The raw command to send to nagios, which should not include the submitted time header or the line-feed B(Required) option when using the C(command) action. true


Tim Bielawa (@tbielawa)