[Xymon] Perl client without xymon client. (OPEN)
Ralph Mitchell
ralphmitchell at gmail.com
Fri Aug 10 14:24:59 CEST 2012
On Fri, Aug 10, 2012 at 2:47 AM, Henrik Størner <henrik at hswn.dk> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120810/c6d09acb/attachment.html>
More information about the Xymon
mailing list