Page 1 of 1

Nagios script to check Nagios

Posted: Thu Nov 10, 2022 3:45 am
by LansoirThemos
I am currently running multiple (6) Nagios instances across multiple projects. My concept is to run one Nagios instance per project, each responsible for the machines below them and with project specific tasks.

Yes, I could roll all of these into one Nagios instance but this is not the question.

I have checked Google and Nagios Exchange looking for a plugin and if there is nothing out there I will build one myself. I want to know if anyone has any experience with this.

Question: Is there a Nagios plugin which will check the overall status of another remote Nagios instance, either through NRPE and a local script, or over authenticated HTTP(s) to the cgi-bin, simply reporting on how many are OK / Warning / Critical / Unknown, etc in each checked instance. HTTP(s) would be preferred.

If not, can someone point me in the direction of how to query and understand the responses of a single Nagios instance. If there is not any existing plugins I will start looking at Nagstamon for guidance on how to achieve this.

Re: Nagios script to check Nagios

Posted: Thu Nov 10, 2022 1:42 pm
by gormank
Checking nagios is much like checking anything else. You can use check_init_service to verify the nagios, httpd, mariadb, xinetd/nrpe/ncpa services are running. Nagios XI has wizards to check a remote nagios is running that can be made generic once created.
You can also check if the ports 443 and 5666 (nrpe) are open or whatever port ncpa uses if you're running that.

Re: Nagios script to check Nagios

Posted: Tue Nov 22, 2022 11:44 pm
by CarolBrusteredman
I am in the process of developing web services RESTful API for Nagios.

If is still work in progress, but current version (0.2) can retrieve all hosts status, and all service status over HTTP, and additionally configuration of objects.

It is also possible to submit passive check results for hosts and service status.

Please check http://dmytro.github.com/nagira, it is also omegle voojio shagle published on Nagios Exchange in API section.

Is this something you are looking for?

Re: Nagios script to check Nagios

Posted: Fri Nov 25, 2022 12:00 am
by CokraMehinka
You could use the mentioned check_nagios invoked via nrpe/check_by_ssh/snmp but you also should make sure that the host itsself is being monitored - e.g. filesystems, load, etc.

You might have a look at the Icinga Wiki, where I'm keeping such a list on what to monitor on a monitoring host: https://wiki.icinga.org/display/howtos/ ... cinga+Host

A slightly different approach will be parsing the status.dat manually fetching last_check. An example (also usable for Nagios, not only Icinga) targetting snmp can be found here: https://wiki.icinga.org/display/howtos/ ... nmp_icinga

Re: Nagios script to check Nagios

Posted: Wed Apr 19, 2023 10:55 pm
by spinabove
Monitoring Nagios is similar to monitoring any other service. check_init_service can be used to confirm that the nagios, httpd, mariadb, xinetd/nrpe, and ncpa services are operating. Once constructed, Nagios XI's wizards for determining whether a remote instance of Nagios is operating can be made generic
Additionally, you can check if ports 443 and 5666 (nrpe) are open, as well as whatever port ncpa uses if you're running it.