[ check_snmp ] - trouble with --eregi

atherios atherios at free.fr
Mon Mar 29 11:20:10 CEST 2004


Hi,

I'm using check_snmp to compare date/time from snmp.
What I do is get 'host.hrSystem.hrSystemDate.0' from client and compare
to date/time from server using '--eregi'.
The command is defined like this :
define command {
        command_name            check_ntp
        command_line            $USER1$/check_snmp -H $HOSTADDRESS$ -o
		host.hrSystem.hrSystemDate.0 -C XXX
		--eregi="`/bin/date+%Y-%m-%d,%k:%M | /usr/bin/perl
		-p-e's/(-0)([0-9])/-$2/' | /usr/bin/tr-d ' '`"
}

Note: all is on one line in the real conf ;)

This command works OK on shell :
host:/usr/local/nagios/etc # ../libexec/check_snmp -H XXX.XXX.XXX.XXX -o
host.hrSystem.hrSystemDate.0 -C XXX --eregi="`/bin/date
+%Y-%m-%d,%k:%M | /usr/bin/perl -p -e 's/(-0)([0-9])/-$2/' | /usr/bin/tr
-d ' '`"
SNMP OK - 2004-3-29,11:17:40.0,+2:0

But in the log, it's marked as failed :(
Anyone knows why ?
Does the --eregi really execute the `command` in check mode ?

ThX for answers.


-------------------------------------------------------
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