LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Monitoring 0s and 1s in Linux with Nagios (https://www.linuxquestions.org/questions/linux-newbie-8/monitoring-0s-and-1s-in-linux-with-nagios-4175444485/)

Koloz 01-07-2013 06:45 AM

Monitoring 0s and 1s in Linux with Nagios
 
Hello All,

Please I'm quite new to Linux and I need help on how to monitor a process with Nagios.

I currently use Nagios Core 3.2.3 to monitor a couple of Linux servers. My question is can Nagios be used to monitor 0s and 1s? This is because I have a service that runs when there is 1 in its file while it stops running when this file returns a zero. I would like Nagios to send a critical alert message when this file returns a zero and OK when the file returns 1 as its content. Is this possible? If yes, which plugin can do this?

Thank you for your quick response.

acid_kewpie 01-07-2013 07:00 AM

I think all monitoring really is is zeros and ones!

nagios itself can't do this, as nagios can't do anything basically. What you would do is write your own plugin script. this script can do whatever you want, but just needs to return the status codes for Nagios. Just look at any other check script and you'll get the idea, it's pretty easy.

Koloz 01-07-2013 07:45 AM

Thank you Chris for your quick response. Any sample specifically I can have a look at or read? Can you please point me to a link or so?

Thanks again,
Koloz

Habitual 01-07-2013 09:58 AM

http://debianclusters.org/index.php/..._Configuration
http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf

acid_kewpie 01-07-2013 10:25 AM

well presumably all the NRPE side of things is already working. In terms of the script itself, there is plenty of chat online, e.g. http://debianclusters.org/index.php/..._Nagios_Plugin.

BTW NRPE is AWFUL, i'd VERY strongly urge you to ditch it in favour of check_by_ssh to prevent having another network service open to the network, one that is very insecure and unencrypted. i'd also urge you to ditch Nagios completely, but that's another matter altogether!

Habitual 01-07-2013 12:25 PM

Quote:

Originally Posted by acid_kewpie (Post 4864705)
...
BTW NRPE is AWFUL, i'd VERY strongly urge you to ditch it in favour of check_by_ssh...

Chris: If that is directed at me, I hear you (but I don't use Nagios for anything at cirrhus9.com)

I only posted what I know worked for me when we did use it, to encourage the OP to dig a little deeper into the known documentation.

Peace Out!:twocents:


All times are GMT -5. The time now is 11:20 PM.