I have set up a couple of commands that are being executed in a Contact (one for Host, One for Service).
On one of my servers this works just fine, as expected. On another host which was "supposedly" set up identically, it will not pass the values of $HOSTNAME$, $HOSTNOTES$, $HOSTSTATE$, etc to these commands
Is there some sort of top secret toggle that needs to be flipped to allow the passing of these values within Nagios??
Here is my Command that I am trying to pass:
$USER1$/Send_Alert.pl -h $HOSTNAME$ -n $HOSTNOTES$ -s $HOSTSTATE$ -t $HOSTOUTPUT$
I dumped the hash and this is what I am getting:
First Test:
$VAR1 = 'n';
$VAR2 = '-s';
$VAR3 = 'h';
$VAR4 = 'apapmon16.wepex.net';
Second Test:
$VAR1 = 'n';
$VAR2 = '-s';
$VAR3 = 'h';
$VAR4 = 'apapmon16.wepex.net';
Third manual run of the command with supplied arguments (I did run this without the FQDN)
$VAR1 = 'n';
$VAR2 = 'NOTES';
$VAR3 = 'h';
$VAR4 = 'apapmon16';
$VAR5 = 's';
$VAR6 = 'CRITICAL';
$VAR7 = 't';
$VAR8 = 'Test';
Commnds not being passed System Macros values
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Commnds not being passed System Macros values
So am I seeing this correctly, $HOSTNAME$ is actually working?
Can you share Send_Alert.pl ? And is that the exact notification command line specified, with no quotes around and of the arguments ?djohansen wrote:$VAR4 = 'apapmon16.wepex.net';
Re: Commnds not being passed System Macros values
Yes, I guess the $HOSTNAME$ is working.. All the other ones aren't..
I had double quotes on the other system around the $HOSTOUPUT$, on the other system and I took them off here because I saw a reference to that in another post. Doesn't seem to make a difference. Fails for both..
Peculiar thing is that it works just fine on other host (both Linux 7.4, XI ver 5.4.7)
I have attached the Send_Alert.pl file. It is very specific to HPOM, but right now I have it just writing to a file and not executing.
I had double quotes on the other system around the $HOSTOUPUT$, on the other system and I took them off here because I saw a reference to that in another post. Doesn't seem to make a difference. Fails for both..
Peculiar thing is that it works just fine on other host (both Linux 7.4, XI ver 5.4.7)
I have attached the Send_Alert.pl file. It is very specific to HPOM, but right now I have it just writing to a file and not executing.
You do not have the required permissions to view the files attached to this post.
Re: Commnds not being passed System Macros values
Apparently violating the first rule of programming doesn't sit well with Nagios..
"If you are going to pass a variable (or macro), better make sure it has a value in it..."
Resolved.. (with embarassed look...
)
"If you are going to pass a variable (or macro), better make sure it has a value in it..."
Resolved.. (with embarassed look...
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Commnds not being passed System Macros values
Well, at least it is resolved!djohansen wrote:Apparently violating the first rule of programming doesn't sit well with Nagios..
"If you are going to pass a variable (or macro), better make sure it has a value in it..."
Resolved.. (with embarassed look...)