Nagios script to check Nagios

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.
Post Reply
Posts: 4
Joined: Tue Jul 26, 2022 3:25 am

Nagios script to check Nagios

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

Re: Nagios script to check Nagios

Post 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.
Posts: 8
Joined: Tue Mar 22, 2022 5:50 am

Re: Nagios script to check Nagios

Post 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, it is also omegle voojio shagle published on Nagios Exchange in API section.

Is this something you are looking for?
Posts: 3
Joined: Wed Sep 21, 2022 7:38 am

Re: Nagios script to check Nagios

Post 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: ... 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: ... nmp_icinga
Posts: 1
Joined: Wed Apr 19, 2023 10:52 pm

Re: Nagios script to check Nagios

Post 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.
Last edited by spinabove on Wed Apr 19, 2023 10:55 pm, edited 1 time in total.
Post Reply