Xymon Mailing List Archive search

RHEL EXT Script Help

3 messages in this thread

list Foster Patch · Thu, 28 Jul 2016 19:05:22 +0000 ·
Hello, I have quite a bit of experience how xymon works in Windows, and recently was given assignments to do some monitoring in Linux. (RHEL 6) Below is my script. It runs with no errors, but my Hobbit page is never propagated with the new monitor. I have also gone to /etc/clientlaunch.cfg and put in the necessary lines to run this script. I am at a loss as to what is wrong, and why it will not propagate. Any help? (XYMSRV has an actual IP Address in it)

#!/bin/sh

. /etc/default/xymon-client

export XYMSRV="xxx.xx.xxx.xx"
export BBHOME="/usr/lib/xymon/client"
export OUTSIDENAME="$CLIENTHOSTNAME"
export BB="${BBHOME}/bin/xymon"
export BBDISP=$XYMSRV
export REALMACHINE="`echo $OUTSIDENAME | sed 's/\./,/g'`"
export TARGETMACHINE="${REALMACHINE}"

export TEST="CFENGINE"

if [ ! "$TEST" ]; then
        exit
fi

if [ "${TARGETMACHINE}" == "${REALMACHINE}" ]; then
LINE="status $REALMACHINE.$TEST green `date`<BR>
<CENTER><I><FONT SIZE=+2>
This machine is not actively running this service in the cluster.
</FONT></I>
</CENTER>
";
                # NOW USE THE BB COMMAND TO SEND THE DATA ACROSS
                #$BB $BBDISP "$LINE"                    # SEND IT TO BBDISPLAY
                $BB $BBDISP "$LINE"                     # SEND IT TO BBDISPLAY

        fi


Thanks,

Foster Patch
Server Technician
AccuWeather
XXX Science Park Road, State College, PA XXXXX
P: XXX.XXX.XXXX
E: user-830dc635f051@xymon.invalid<mailto:user-830dc635f051@xymon.invalid>
E: user-d05d8627427f@xymon.invalid<mailto:user-d05d8627427f@xymon.invalid>
http://www.AccuWeather.com<http://www.accuweather.com/>;
list Paul Root · Thu, 28 Jul 2016 19:39:00 +0000 ·
So a couple things,
                If you run it from within ~xymon/client/bin/xymoncmd you wouldn't need to set  all those environment variables. Actually, having it run from clientlaunch.cfg would do the same.

                You don't say what version of Xymon you are using. Is it the Teribithia package?  Is that how things are setup in there? I built my own, and I put the xymon-client variables file in /etc/sysconfig which is the standard for RedHat, as opposed to /etc/default which is a debianism.

                Where do you get the CLIENTHOSTNAME variable?   Setting this to `hostname`  got it to work for me from inside xymoncmd.
                /usr/lib/xymon/client or /usr/lib64/xymon/client?

Paul.
quoted from Foster Patch

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Foster Patch
Sent: Thursday, July 28, 2016 2:05 PM
To: xymon at xymon.com
Subject: [Xymon] RHEL EXT Script Help

Hello, I have quite a bit of experience how xymon works in Windows, and recently was given assignments to do some monitoring in Linux. (RHEL 6) Below is my script. It runs with no errors, but my Hobbit page is never propagated with the new monitor. I have also gone to /etc/clientlaunch.cfg and put in the necessary lines to run this script. I am at a loss as to what is wrong, and why it will not propagate. Any help? (XYMSRV has an actual IP Address in it)

#!/bin/sh

. /etc/default/xymon-client

export XYMSRV="xxx.xx.xxx.xx"
export BBHOME="/usr/lib/xymon/client"
export OUTSIDENAME="$CLIENTHOSTNAME"
export BB="${BBHOME}/bin/xymon"
export BBDISP=$XYMSRV
export REALMACHINE="`echo $OUTSIDENAME | sed 's/\./,/g'`"
export TARGETMACHINE="${REALMACHINE}"

export TEST="CFENGINE"

if [ ! "$TEST" ]; then
        exit
fi

if [ "${TARGETMACHINE}" == "${REALMACHINE}" ]; then
LINE="status $REALMACHINE.$TEST green `date`<BR>
<CENTER><I><FONT SIZE=+2>
This machine is not actively running this service in the cluster.
</FONT></I>
</CENTER>
";
                # NOW USE THE BB COMMAND TO SEND THE DATA ACROSS
                #$BB $BBDISP "$LINE"                    # SEND IT TO BBDISPLAY
                $BB $BBDISP "$LINE"                     # SEND IT TO BBDISPLAY

        fi


Thanks,

Foster Patch
Server Technician
AccuWeather
XXX Science Park Road, State College, PA XXXXX
P: XXX.XXX.XXXX
E: user-830dc635f051@xymon.invalid<mailto:user-830dc635f051@xymon.invalid>
E: user-d05d8627427f@xymon.invalid<mailto:user-d05d8627427f@xymon.invalid>
http://www.AccuWeather.com<http://www.accuweather.com/>;

This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
list Jeremy Laidman · Sun, 31 Jul 2016 01:12:47 +0000 ·
On Fri, 29 Jul 2016, 05:05 Foster Patch <user-830dc635f051@xymon.invalid>
quoted from Paul Root
wrote:
Hello, I have quite a bit of experience how xymon works in Windows, and
recently was given assignments to do some monitoring in Linux. (RHEL 6)
Below is my script. It runs with no errors, but my Hobbit page is never
propagated with the new monitor. I have also gone to /etc/clientlaunch.cfg
and put in the necessary lines to run this script. I am at a loss as to
what is wrong, and why it will not propagate. Any help? (XYMSRV has an
actual IP Address in it)


#!/bin/sh


. /etc/default/xymon-client


export XYMSRV="xxx.xx.xxx.xx"

export BBHOME="/usr/lib/xymon/client"

export OUTSIDENAME="$CLIENTHOSTNAME"

export BB="${BBHOME}/bin/xymon"

export BBDISP=$XYMSRV

export REALMACHINE="`echo $OUTSIDENAME | sed 's/\./,/g'`"

export TARGETMACHINE="${REALMACHINE}"


export TEST="CFENGINE"


if [ ! "$TEST" ]; then

        exit

fi


if [ "${TARGETMACHINE}" == "${REALMACHINE}" ]; then

LINE="status $REALMACHINE.$TEST green `date`<BR>

<CENTER><I><FONT SIZE=+2>

This machine is not actively running this service in the cluster.

</FONT></I>

</CENTER>

";

                # NOW USE THE BB COMMAND TO SEND THE DATA ACROSS

                #$BB $BBDISP "$LINE"                    # SEND IT TO
BBDISPLAY

                $BB $BBDISP "$LINE"                     # SEND IT TO
BBDISPLAY


        fi


Thanks
Foster

Check your xymon server ghost report.

Run the script like so:

~xymon/client/bin/xymoncmd sh -x scriptname

Cheers
Jeremy