EPN Newbie question

Tal Cohen nagios at cohen123.com
Thu Sep 6 16:29:20 CEST 2007


Just a clarification: When I entered the code in my original email, I just
typed it in rather than copy and paste.  Here is the actual code that is
running on the system.

 

use lib "/usr/local/nagios/libexec";

use utils qw(%ERRORS);

use strict;

use vars qw($counter);

$counter++;

print "The counter is ".$counter;

exit $ERRORS{'OK'};

 

Any help/insight is appreciated.

 

Tal

 

  _____  

From: nagios-devel-bounces at lists.sourceforge.net
[mailto:nagios-devel-bounces at lists.sourceforge.net] On Behalf Of Tal Cohen
Sent: Wednesday, September 05, 2007 9:56 AM
To: nagios-devel at lists.sourceforge.net
Subject: [Nagios-devel] EPN Newbie question

 

Hi Folks,

 

I am new to Nagios EPN development, so please be gentle - and let me know if
this is the right list to send these types of questions to.

 

I am trying to do something that I thought would be simple but is starting
to drive me crazy. 

I want to create a plug-in that will retain data in memory across multiple
executions. 

As an initial test, I created a counter plug-in:

 

                        #!/usr/bin/perl

                        use utils qw(%ERRORS);

                        use strict;

                        use vars qw($counter)

                        $counter++;

                        print "The counter is $counter";

                        exit $ERRORS{'OK'};

 

So far, so good. 

When I test this in mini_epn, it works as expected incrementing each time I
invoke it.

However, when I add this as a check into the Nagios configuration file and
launch Nagios, the value does not increment across multiple executions.

 

What am I missing?

 

Thanks,

Tal

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20070906/ab1b8b62/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list