How can I monitor a Nagios Server from external server?

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
jobst
Posts: 16
Joined: Mon Jul 22, 2013 6:33 pm

How can I monitor a Nagios Server from external server?

Post by jobst »

Hi

My nagios server sits behind a firewall wall in a DMZ zone. If the server itself is down OR the nagios daemon has fallen over it will not be able to send messages to the admins and we wouldn't have a clue that something is wrong with any of the machines/services it monitors.

I already have some checks (e.g. ping) from one of my servers I have in a datacenter, this one will send us admins a SMS if the hosts it monitors are not happy.

How can I check a Nagios server itself that it is alive and well?
Is there any flag I can POST to "status.cgi" that will just return "I am OK!"?

Thanks
Jobst
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How can I monitor a Nagios Server from external server?

Post by mcapra »

jobst wrote: Is there any flag I can POST to "status.cgi" that will just return "I am OK!"?
check_http should work to check the front-end, but that won't tell you anything about whether or not the Nagios Core daemon is running. Like so:

Code: Select all

[root@capra_nag ~]# /usr/local/nagios/libexec/check_http -H localhost -u /nagios/cgi-bin/status.cgi -a nagiosadmin:hunter2 -e 200
HTTP OK: Status line output matched "200" - HTTP/1.1 200 OK - 50068 bytes in 0.026 second response time |time=0.025602s;;;0.000000 size=50068B;;;0
With that check, I'm making sure a status code of 200 is received when accessing status.cgi. The way many people monitor a Nagios Core instance is to have a 2nd Nagios Core instance. You could set up an agent on your master Nagios Core instance and have the secondary Nagios Core instance be responsible for checking in on it.
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How can I monitor a Nagios Server from external server?

Post by scottwilkerson »

Thanks @mcapra

I also will add that many people monitor their monitoring server from a second Nagios server.

I would suggest monitoring it just like you would any other critical server/service.

Install NRPE, on your monitoring server, monitor disk, load, memory and the nagios service at the very minimum.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jobst
Posts: 16
Joined: Mon Jul 22, 2013 6:33 pm

Re: How can I monitor a Nagios Server from external server?

Post by jobst »

scottwilkerson wrote:Thanks @mcapra
I also will add that many people monitor their monitoring server from a second Nagios server.
I would suggest monitoring it just like you would any other critical server/service.
Install NRPE, on your monitoring server, monitor disk, load, memory and the nagios service at the very minimum.
Isn't that a little overkill?
I think it would be a good idea if there is a script (as part of Nagios) running on an external server scheduled by crontab that sources a special cgi script raising an alarm via email/sms/XYZ when the Nagios server does not respond. This way you make sure, too, that the Internet connection that is utilised by the Nagios server is monitored.
That monitor could also be part of the set of machines the Nagios server monitors anyway.

No need to look after more daemons - I already have enough of them in my head.

Jobst
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How can I monitor a Nagios Server from external server?

Post by mcapra »

jobst wrote: I think it would be a good idea if there is a script (as part of Nagios) running on an external server scheduled by crontab that sources a special cgi script raising an alarm via email/sms/XYZ when the Nagios server does not respond.
You're more than welcome to submit a request on the GitHub. I know of at least one recent issue raised for similar functionality:
https://github.com/NagiosEnterprises/na ... issues/428

The script itself would be trivial; Whether or not it is implemented is more a general lifecycle/support discussion that would need to happen.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: How can I monitor a Nagios Server from external server?

Post by kyang »

Thanks @mcapra!
Locked