[Xymon] ext script does not show up at webpage

Steff Watkins s.watkins at nhm.ac.uk
Wed May 14 13:19:39 CEST 2014


> Message: 1
> Date: Tue, 13 May 2014 13:25:53 +0200
> From: Simon H?jberg Jespersen <Simon.Jespersen at stab.rm.dk>
> Subject: [Xymon] ext script does not show up at webpage

> I have a script placed at
> /home/bb/client/ext/monitorfs_xymon.sh on the client
> 
> It is doing some disk check and end up with this command $xymon $XYMSRV "status $MACHINE.$COLUMN $COLOR `date` ${MSG}"

 > /home/bb/bin/xymon "10.83.82.9 status aarapp144.available storage green Tuesday, 13 May 2014 13:10:20 CEST Looking good"

Hello Simon,

 If you look at the line you are expecting to get from the script and the line you are actually getting from the script you will see that they are different in format. The line you have given as output from the script includes the $XYMSRV within the double-quoted content section that is meant to be passed on the the xymon binary rather than passed as the first, separate option stating the recipient host.

As such, the xymon binary is being called and given its first parameter as a complex string containing pjrases such as 'status' and 'thursday', rather than being given the IP details of the system that it is meant to be forwarding the message onto. This shows up in the output you get on commandline (as follows):

> When I try to run it from commandline the output is
> 
> Xymon version 4.3.17
> Usage: /home/bb/bin/xymon [--debug] [--merge] [--
> proxy=http://ip.of.the.proxy:port/] RECIPIENT DATA
>   RECIPIENT: IP-address, hostname or URL
>   DATA: Message to send, or "-" to read from stdin

The xymon binary is running and then saying "I don't know what it is you have just sent to me but it isn't a host's IP details!"

Looking at the script you supplied I can see the following line:
 
 echo "$XYMON $XYMSRV status $MACHINE.$COLUMN $COLOR `date` ${MSG}" >> /tmp/du_i_run.log $XYMON $XYMSRV "status $MACHINE.$COLUMN $COLOR `date` ${MSG}"
 
 Is it meant to be a run-on line like this with the call to $XYMON after the /tmp/du_i_run.log? If so I doubt that the script would get beyond the echo call to du_i_run.log . The rest of the line would not be interpreted as a command/action but as spare operands on the line. So, you would need to actually split that line into two lines, between du_i_run.log and $XYMON, to make that one line back into two separate lines.

The echo command will still run but now you will have an executable commandline, starting $XYMON, would would successfully forward your output to $XYMSRV.

Give those a try.

Regards,
Steff Watkins
-----
Steff Watkins                           Natural History Museum, Cromwell Road, London,SW75BD 
Systems programmer                      Email: s.watkins at nhm.ac.uk 
Systems Team                            Phone: +44 (0)20 7942 6000 opt 2
========
"Many were increasingly of the opinion that they'd all made a big mistake in coming down from the trees in the first place. And some said that even the trees had been a bad move, and that no one should ever have left the oceans." - HHGTTG





More information about the Xymon mailing list