Page 1 of 1

Ansible Playbook Remove Check

Posted: Sat Oct 17, 2020 7:57 am
by xxandyxx
Hello to All,

does anyone nows a Ansible Playbook to remove a Check (Service) from a Nagios (Thruk) Portal.

Thanks for your Help

Re: Ansible Playbook Remove Check

Posted: Tue Oct 20, 2020 3:46 pm
by gormank
I'm probably missing something here but checks typically exist on the Nagios host in a file, which is pretty easy to remove. Then the nagios service would need a restart. Maybe you have checks defined in monitored hosts that send status info to the nagios host?

Re: Ansible Playbook Remove Check

Posted: Thu Oct 22, 2020 2:16 pm
by snapier3
Consider using the NagiosExternalCommands and this will get you close.
https://assets.nagios.com/downloads/nag ... mands.html
https://assets.nagios.com/downloads/nag ... ernalcmds/

Write your playbook to use the external commands as the primary actor or create a POST request that can be handled via NRDP
DISABLE_HOST_SVC_CHECKS(STOPS THEM ALL)
https://assets.nagios.com/downloads/nag ... mand_id=34

DISABLE_SVC_CHECK(SINGLE)
https://assets.nagios.com/downloads/nag ... mmand_id=6

You can also utilize the Deadpool functions within XI to handle the toil of host/service removal.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

--SN