LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-05-2010, 01:45 PM   #1
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
Nagios plugin development question.


Hi,

How do nagios decide to turn certain input into red and decide they are critical?


Are they evaluated against -c and -w arguments? if so at what point.

We take custom out put for our applications, but where there is no output it just shows nothing.
Now we want it to go red and send alerts.

What I have tired is

1-send '-c' argument which I chose it to be 3.
2- on libexec side, I printed 4.

But all it does is print 4. That it.


So what I do to see if the things is on critical level and stuff.


Thanks
 
Old 02-05-2010, 01:55 PM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
Hello,

Nagios uses plugins for the host and service checks. They provide four different return values: O (OK), 1 (WARNING), 2 (CRITICAL), and 3 (UNKNOWN). That's how Nagios get's feedback from the plugins.

You can read some more about it here (old article but still valid info).
Nagios Basics
Quote:
Nagios determines the states of services and hosts from the return values of the plugin. The states for services are the same as the return values OK, WARNING, CRITICAL and UNKNOWN. For the hosts the picture is slightly different: the UP state describes a reachable host, DOWN means that the computer is down, and UNREACHABLE refers to the state of nonreachability, where Nagios cannot test whether the host is available or not, because a parent is down (see Section 4.1, page 72).

In addition to this, Nagios makes a distinction between two types of state: soft state and hard state. If a problem occurs for the first time (that is, if there was nothing wrong with the state of a service until now) then the program categorizes the new state initially as a soft state and repeats the test several times. It may be the case that the error state was just a one-off event that was eliminated a short while later. Only if the error continues to exist after multiple testing is it then categorized by Nagios as a hard state. Administrators are informed only of hard states, because messages involving short-term disruptions that disappear again immediately afterwards only add to an unnecessary flood of information.
and some more information on the sourceforge pages at http://nagios.sourceforge.net/docs/2_0/statetypes.html.

Kind regards,

Eric
 
Old 02-05-2010, 03:01 PM   #3
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Thanks Eric.

I found the solution.

What ever the return value plugin produce thats get evaluated.

What I did before was

Code:
#!/bin/bash

echo   CRITICAL -  

#echo  2   this or the the one above
That's how it actually need to be done.

Code:
#!/bin/bash

OK=2

echo   CRITICAL -  test

exit ${OK}   ##   <-------------  this value gets evaluated.

Bye.
 
Old 02-05-2010, 03:08 PM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
Hi,

That's great! If you consider this thread as solved you can mark it as such using the thread tools. Have fun with Linux!

Kind regards,

Eric
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to use Nagios plugin? dwarf007 Linux - Software 20 10-03-2011 07:11 AM
nagios plugin check_url_status vanderbult Linux - Software 2 05-14-2009 11:36 AM
Need Help with Development of Nagios Plugin monkinsane Linux - Newbie 10 04-23-2009 05:55 AM
Nagios Plugin fullgore *BSD 3 10-22-2008 09:52 AM
Nagios: Raid Plugin kegwell Linux - Software 2 05-01-2005 12:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:51 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration