Problem with external commands and custom variables

Stefan Strandberg stefan+nagiosusers at cae.wisc.edu
Wed Oct 8 18:29:58 CEST 2008


Hi,

I'm attempting to implement some custom variables for hosts.  Supposedly
the external command to change the custom variable for a host is
CHANGE_CUSTOM_HOST_VAR with a certain syntax.  Unfortunately for me, it
doesn't seem to be working.

Nagios receives the command and logs it, but doesn't seem to actually
process it.

The command given is:

-- start script --

#!/bin/sh

now=`date +%s`
commandfile='/var/lib/nagios3/rw/nagios.cmd'

/usr/bin/printf "[%lu]
CHANGE_CUSTOM_HOST_VAR;dent;_REPAIRSTATUS;repair\n" $now > $commandfile

-- end script --

and nagios logs it with
[1223412361] EXTERNAL COMMAND:
CHANGE_CUSTOM_HOST_VAR;dent;_REPAIRSTATUS;repair

in nagios.log, so I think it should be working.  However, the variable
never changes in the status.dat file.

Am I missing a step or doing something wrong?  The documentation doesn't
have any other examples, and nothing turns up on google.

Thanks,

-stefan

-- 
Stefan Strandberg
UNIX group
Computer Aided Engineering - UW Madison
stefan at cae.wisc.edu



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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