Here is what I get running the command line from the 3.2 server:
bash-3.2# ./check_cluster -s -l "DNS Cluster" -w 3 -c 3 -d $SERVICESTATEID:nsal1.dc:DNS$,$SERVICESTATEID:nsal2.dc:DNS$,$SERVICESTATEID:nsal1.wc:DNS$,$SERVICESTATEID:nsal2.wc:DNS$
CLUSTER OK: DNS Cluster: 4 ok, 0 warning, 0 unknown, 0 critical
Service check results different in GUI vs. from command line
-
rickwilson7425
- Posts: 125
- Joined: Tue Mar 18, 2014 3:20 pm
Re: Service check results different in GUI vs. from command
I don't think the check is "working" from the command line, I think it is just "running and not erroring out". The command line has no knowledge of what a Nagios macro is - those only come into play when the nagios binary itself runs the check. Observe what happens when I echo your -d parameter:
See how it gets condensed down? That is essentially what your plugin ends up running when you run it from the CLI:
This condensing is an attempt by bash to resolve environment variables. If it is empty, then the $WHATEVER will be empty:
I think @Box293 has it right - your parameters are not what you think they are, hence the difference between GUI and CLI testing.
Code: Select all
echo "$SERVICESTATEID:nsal1.dc:DNS$,$SERVICESTATEID:nsal2.dc:DNS$,$SERVICESTATEID:nsal1.wc:DNS$,$SERVICESTATEID:nsal2.wc:DNS$"
:nsal1.dc:DNS$,:nsal2.dc:DNS$,:nsal1.wc:DNS$,:nsal2.wc:DNS$
Code: Select all
./check_cluster -s -l "DNS Cluster" -w 3 -c 3 -d :nsal1.dc:DNS$,:nsal2.dc:DNS$,:nsal1.wc:DNS$,:nsal2.wc:DNS$
Code: Select all
echo $HOME
/root
echo $HOSTNAME
localhost
echo $USER
root
echo $IDONTEXIST
echo $SERVICESTATEID:nsal1.dc:DNS$
:nsal1.dc:DNS$
Former Nagios employee
-
rickwilson7425
- Posts: 125
- Joined: Tue Mar 18, 2014 3:20 pm
Re: Service check results different in GUI vs. from command
ok, I see what you mean.
Nevertheless, I was working on it some more last night and copied over the config files again. Somehow that got the check running ok on the new server - go figure....
Please close this ticket out.
Thanks for your help
Rick
Nevertheless, I was working on it some more last night and copied over the config files again. Somehow that got the check running ok on the new server - go figure....
Please close this ticket out.
Thanks for your help
Rick
Re: Service check results different in GUI vs. from command
Thank you for the reply.rickwilson7425 wrote:ok, I see what you mean.
Nevertheless, I was working on it some more last night and copied over the config files again. Somehow that got the check running ok on the new server - go figure....
Please close this ticket out.
Thanks for your help
Rick
I'm glad to hear you got it working.
Former Nagios Employee.
me.
me.