check_mrtgtraf returns STATE_UNKNOWN

Israel Brewster israel at frontierflying.com
Fri Jan 26 17:54:06 CET 2007


I'm pretty sure this is a bug. I ran into the same thing, but was  
able to fix it easily enough in the source code. Looking at the  
original code for this plugin, you can find the section where it sets  
the output state, something like:

if (incoming_rate > incoming_critical_threshold
                         || outgoing_rate >  
outgoing_critical_threshold) {
                 result = STATE_CRITICAL;
         }
         else if (incoming_rate > incoming_warning_threshold
                                          || outgoing_rate >  
outgoing_warning_threshold) {
                 result = STATE_WARNING;
         }

This may not be exact, as I have modified the code somewhat, but I  
think it is pretty close, if not. At any rate, what you'll notice is  
that while the result is set to STATE_CRITICAL or STATE_WARNING,  
depending on the circumstances, it is never set to STATE_OK (as you  
mentioned in your original message), which means that it remains in  
its STATE_UNKNOWN default state if the traffic is OK, to fix it, all  
you need to do is add the two lines:

         else
         result = STATE_OK;

Immediately following the closing bracket on the code block above,  
and recompile. At least, that fixed it for me. I have plugins version  
1.4.3, I don't know if this issue has been fixed in a newer version  
of the plugins or not (current is 1.4.5)

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------


On Jan 26, 2007, at 1:38 AM, Espen Tagestad wrote:

> Hi,
>
> My check_mrtgtraf returns STATE_UNKOWN, it should really be STATE_OK.
> Why?
>
> My check-command is like this:
>
> /usr/local/libexec/nagios/check_mrtgtraf -F /usr/local/www/data/ 
> mrtg_switch/gatekeeper.log -a MAX -w 375000,375000 -c 500000,500000  
> -e 10
>
> Output is this:
>
> Traffic UNKNOWN - Max. In = 39.6 KB/s, Max. Out = 192.0 KB/s| 
> in=39.619141KB/s;375000.000000;500000.000000;0.000000  
> in=192.045898KB/s;375000.000000;500000.000000;0.000000
>
>
> Lowering warning and critical options triggers STATE_WARNING and
> STATE_CRITICAL. Is this a bug? I can't see anything in  
> check_mrtgtraf.c
> setting STATE_OK other than when plugin is execute with a -V or -h
> option.
>
> regards,
>
> Espen
>
> ---------------------------------------------------------------------- 
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to  
> share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php? 
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when  
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list