[hobbit] bbtest-net.c
Henrik Stoerner
henrik at hswn.dk
Wed Nov 1 22:42:45 CET 2006
On Wed, Nov 01, 2006 at 03:03:25PM -0500, Bradley Wallace wrote:
> Hobbit Server - version 4.1.2p1
>
> When a server that's monitored by Hobbit does not respond to ping (it's
> down), Hobbit generates the following message:
>
> nro6000c:conn red [201160]
> red <!-- [flags:ordAstILe] --> Wed Nov 1 13:22:18 2006 conn NOT ok
> Service conn on nro6000c is not OK : Host does not respond to ping
> System unreachable for 1 poll periods (0 seconds)
> &red 10.102.0.197 is unreachable
> See http://Hobbit/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=nro6000c.conn
>
> The "!" in the second line of the message causes problems in Linux when
> handling the error message with ksh shell scripts.
No it doesnt. If you have problems, then you've forgotten to put your
environment variable references inside quotes in the shell script.
E.g. I saved your error message in the file "x", and then:
henrik at osiris:~$ ksh
$ MYMSG=`cat x`
$ echo $MYMSG
nro6000c:conn red [201160] red <!-- [flags:ordAstILe] --> Wed Nov 1
13:22:18 2006 conn NOT ok Service conn on nro6000c is not OK : Host does
not respond to ping System unreachable for 1 poll periods (0 seconds)
&red 10.102.0.197 is unreachable See
http://Hobbit/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=nro6000c.conn
$ if test $MYMSG = "bla"; then echo bla; fi
ksh: test: red: unknown operator
$ if test "$MYMSG" = "bla"; then echo bla; fi
Note how the error goes away once you put $MYMSG inside quotes.
Regards,
Henrik
More information about the Xymon
mailing list