LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2013, 06:45 AM   #1
Koloz
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Rep: Reputation: Disabled
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.
 
Old 01-07-2013, 07:00 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 01-07-2013, 07:45 AM   #3
Koloz
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-07-2013, 09:58 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://debianclusters.org/index.php/..._Configuration
http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
 
Old 01-07-2013, 10:25 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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!
 
Old 01-07-2013, 12:25 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
...
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios stopped monitoring 5 VM Linux servers joed@ucsf.edu Linux - Newbie 8 09-28-2012 02:19 PM
LXer: Monitoring OSX and Linux with Nagios and SNMP LXer Syndicated Linux News 0 04-23-2012 05:10 AM
Monitoring oracle database on windows using Nagios(Linux) indrajit.jadhav Linux - General 3 10-31-2011 05:25 AM
LXer: Monitoring with Nagios: New Online Training from the Linux Magazine Academy LXer Syndicated Linux News 0 11-10-2010 04:10 PM
NagiOS Remote Linux monitoring problem jaychoksi2003 General 3 09-03-2009 03:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration