How to debug plugin getting into UNKNOWN state

Markus Baertschi markus at markus.org
Tue Mar 9 15:35:56 CET 2004


Paul L. Allen wrote:

> As far as I know, you can't get more debugging info from Nagios.  All
> it can tell you is what the plugin reports.  You can, with some plugins,
> use -v to get more info from the plugin, but unless the extra info is
> all on one line (it almost never is) then you'll only see the first line
> logged.
>
>> The plugin works very well when used from the commandline (as nagios 
>> user).
>
>
> Yes, but you don't run it from the command line as often as Nagios
> runs it.  So if the problem only shows up intermittently, you may never
> see it from the command line.  I still believe that you need to show us
> your plugin if you want us to help you.  The problem could be DNS
> timeouts, or intermittent connectivity problems, or a bug in your code.
> We can't check if you get occasional DNS timeouts or intermittent
> connectivity problems but we can examine your code.


I found the problem by adding some debugging and logging code to
the plugin (writing to a separate file).
The main problem was that the running nagios and the user nagios
did not have the same environment (.profile is not executed when
starting nagios) and this fooled me.

Markus

-- 
  Markus Baertschi             Phone: ++41 (21) 807 1677
  Bas du Rossé 14b             Fax  : ++41 (21) 807 1678
  CH-1163, Etoy                Email: markus at markus.org
  Switzerland                  Homepage: www.markus.org



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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