[Xymon] Serial alarm feeds

KING, KEVIN KK1051 at att.com
Thu Aug 29 02:24:34 CEST 2013


Ok made some progress today. I am getting a formatted client message, just not getting it to post.  It may have something to do with it being local. Anyway I do not have anything showing  up in ghost clients and have not found anything in any logs barking about this.  But this is looking very promising. I am sure tomorrow will bring more advances. Your perspective has been very helpful Jeremy.

Here is the script I cobbled together from xymonclient.sh


Bash-3.2 $ cat xymonclient-special.sh
#!/bin/sh
# attempt to use log fetch to collect from log files
# on main xymon and report dots to correct line.
# -kking 8/28/2013
# Must make sure the commands return standard (english) texts.
LANG=C
LC_ALL=C
LC_MESSAGES=C
export LANG LC_ALL LC_MESSAGES
MACHINEDOTS="lkmrflmf00w"
MSGFILE="$XYMONTMP/msg.$MACHINEDOTS.txt"
MSGTMPFILE="$MSGFILE.$$"
LOGFETCHCFG=$XYMONTMP/logfetch.$MACHINEDOTS.cfg
LOGFETCHSTATUS=$XYMONTMP/logfetch.$MACHINEDOTS.status
export LOGFETCHCFG LOGFETCHSTATUS

rm -f $MSGTMPFILE
touch $MSGTMPFILE


echo "client $MACHINEDOTS.eagle eagle"  >>  $MSGTMPFILE
$XYMONHOME/bin/xymonclient-eagle.sh >> $MSGTMPFILE
# logfiles
if test -f $LOGFETCHCFG
then
    $XYMONHOME/bin/logfetch $LOGFETCHCFG $LOGFETCHSTATUS >>$MSGTMPFILE
fi

# System clock
#echo "[clock]"          >> $MSGTMPFILE
#$XYMONHOME/bin/logfetch --clock >> $MSGTMPFILE

        $XYMON $XYMSRV "@" < $MSGTMPFILE >$LOGFETCHCFG.tmp
        if test -f $LOGFETCHCFG.tmp
        then
                if test -s $LOGFETCHCFG.tmp
                then
                        mv $LOGFETCHCFG.tmp $LOGFETCHCFG
                else
                        rm -f $LOGFETCHCFG.tmp
                fi
        fi


# Save the latest file for debugging.
rm -f $MSGFILE
mv $MSGTMPFILE $MSGFILE

exit 0

and this is the file it creates:

client lkmrflmf00w.eagle eagle
[date]
Wed Aug 28 19:16:46 CDT 2013
[uname]
EAGLE 44.0.4-64.34.24
[uptime]
[who]
[msgs:/usr/local/xymon/server/www/html/lkmrflmf00w/lkmrflmf00w]
<...SKIPPED...>
15:55
;

    lkmrflmf00w 13-08-28 18:16:02 CST  EAGLE 44.0.4-64.34.24
    9261.1056    CARD 2203     INFO    SCCP rcvd inv SCMG - bad subsystem
                 SIO=a3   OPC=   209-049-005    DPC=   001-151-001
                 SCMG:    MSG TYPE=003       MSG LEN=006
                          AFTPC=   001-151-001    AFTSS=146   MULT=000
                 LSN=m209049005
                 Report Date:13-08-28  Time:18:16:02
;

    lkmrflmf00w 13-08-28 18:16:05 CST  EAGLE 44.0.4-64.34.24
    9262.1056    CARD 5107     INFO    SCCP rcvd inv SCMG - bad subsystem
                 SIO=a3   OPC=   209-250-002    DPC=   001-151-001
                 SCMG:    MSG TYPE=003       MSG LEN=006
                          AFTPC=   001-151-001    AFTSS=008   MULT=000
                 LSN=m209250002
                 Report Date:13-08-28  Time:18:16:05

                            <SNIP>


[logfile:/usr/local/xymon/server/www/html/lkmrflmf00w/lkmrflmf00w]
type:100000 (file)
mode:640 (-rw-r-----)
linkcount:1
owner:100 (xymon)
group:100 (bbgroup)
size:17902673
clock:1377735406 (2013/08/28-19:16:46)
atime:1377735406 (2013/08/28-19:16:46)
ctime:1377735403 (2013/08/28-19:16:43)
mtime:1377735403 (2013/08/28-19:16:43)


From: Kevin King [mailto:kc6ovd at gmail.com]
Sent: Tuesday, August 27, 2013 5:07 PM
To: 'Jeremy Laidman'
Cc: KING, KEVIN; xymon at xymon.com
Subject: RE: [Xymon] Serial alarm feeds

The link hack did not work. If it would then I would expect to see the msg.host.txt in the tmp directory. I am thinking we might need more in the client message.

Still trying.

-Kevin

From: Jeremy Laidman [mailto:jlaidman at rebel-it.com.au]
Sent: Tuesday, August 27, 2013 4:54 PM
To: Kevin King
Cc: KING, KEVIN; xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Serial alarm feeds

On 28 August 2013 06:20, Kevin King <kc6ovd at gmail.com<mailto:kc6ovd at gmail.com>> wrote:
I have this running. I am getting the logfetch-special.status  it is tracking the lines it has processed.

Great.

  I am not getting a msg file or a column and nothing in xymonclientl-speacial.log.

*sad face*

Check your ghost report.  Also see if you can view a client data page for the device.  Do this by viewing the conn page for another device, click on the link for "client data" for that device, and then change the device name in the URL to eagle.example.com<http://eagle.example.com> (or whatever).  You should get a client message page.

If there's no client data page, then the xymond_client handler is rejecting the message for some reason.  Have a look at the output for xymond_client and see if it's complaining about something.  I wonder if there's a critical section from the client message that's critical.  For example, maybe xymond_client rejects the client data message if it has no [date] and/or [uname] sections.

By the way, as you're going to implement this as a separate script, you might consider capturing the output from the command that sends the client message, and that can be used for your logfetch-special.cfg file.  The "client" protocol not only accepts the client data but it gives back the section from client-local.cfg that matches the hostname in the client message header.  But I'd add this bit later.

J

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20130829/c54cd2fb/attachment.html>


More information about the Xymon mailing list