Ansible Playbook Remove Check

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
xxandyxx
Posts: 2
Joined: Sat Oct 17, 2020 7:53 am

Ansible Playbook Remove Check

Post 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
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Ansible Playbook Remove Check

Post 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?
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

Re: Ansible Playbook Remove Check

Post 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
Locked