Xymon Mailing List Archive search

Perl client without xymon client. (OPEN)

list Ralph Mitchell
Fri, 10 Aug 2012 08:24:59 -0400
Message-Id: <user-b1ef6227ea50@xymon.invalid>

On Fri, Aug 10, 2012 at 2:47 AM, Henrik Størner <user-ce4a2c883f75@xymon.invalid> wrote:
On 10-08-2012 03:55, Jeremy Laidman wrote:
#!/bin/bash
exec 3<>/dev/tcp/$1/1984 || exit 1
echo "status `uname -n`.testing green `date` $2" >&3
Well, whaddayano - one learns something new every day!

This was too good to just leave in the mailinglist archive, so I collected
the Perl, Bash- and Korn-shell suggestions into the Xymon "Tips & Tricks"
document. See http://www.xymon.com/xymon/**help/xymon-tips.html#noinstall<http://www.xymon.com/xymon/help/xymon-tips.html#noinstall>;

Another one for the list.  This works well enough to be a drop-in
replacement for the xymon binary on some AIX systems here.  it gets you
(optional) encrypted delivery.

     #!/bin/sh

     # Shell script replacement for the xymon binary

     export XYMONURL="https://server.domain.com/xymon-cgi/xymoncgimsg.cgi";

     # the curl option "--capath" designates a directory with CA
certificates
     # to validate secure server connections.  If your xymon server doesn't
     # use https, that line can be removed.

     if [ "$2" = "@" ]; then
        # read message from stdin
        $XYMONHOME/bin/curl -s -S -L -m 30 \
           --capath /etc/pki/tls/certs \
           -H "Content-Type: application/octet-stream" \
           -H "MIME-version: 1.0" \
           --data-binary "@-" \
           $XYMONURL
     else
        # arg 2 *is* the message
        $XYMONHOME/bin/curl -s -S -L -m 30 \
           --capath /etc/pki/tls/certs \
           -H "Content-Type: application/octet-stream" \
           -H "MIME-version: 1.0" \
           --data-binary "$2" \
           $XYMONURL
     fi

     exit 0


Ralph Mitchell