Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
monitors:msgs [2014/01/26 22:20] – [tasks.d/xymon-fs-test.cfg] shadymint | monitors:msgs [2014/08/29 14:43] (current) – shadymint | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
^ Author | [[ hastymind@googlemail.com | Andy Smith ]] | | ^ Author | [[ hastymind@googlemail.com | Andy Smith ]] | | ||
Line 5: | Line 5: | ||
^ Requirements | unix | | ^ Requirements | unix | | ||
^ Download | None | | ^ Download | None | | ||
- | ^ Last Update | 2014-01-26 | | + | ^ Last Update | 2014-08-29 | |
===== Description ===== | ===== Description ===== | ||
Line 30: | Line 30: | ||
#!/bin/sh | #!/bin/sh | ||
- | # | + | # |
# | # | ||
- | # $Id: msgs.sh | + | # $Id: msgs.sh |
- | # $Revision: | + | # $Revision: |
# $Author: asmith69 $ | # $Author: asmith69 $ | ||
- | # $Date: 2014-01-26 22:12:21 +0000 (Sun, 26 Jan 2014) $ | + | # $Date: 2014-08-29 15:28:47 +0100 (Fri, 29 Aug 2014) $ |
# $HeadURL: svn:// | # $HeadURL: svn:// | ||
# | # | ||
Line 45: | Line 45: | ||
# | # | ||
# | # | ||
+ | # | ||
+ | # length issues. | ||
+ | # add a blank line between all paragraphs to ensure | ||
+ | # only the correct parts of the original page are | ||
+ | # presented, also, discard the full log and cater | ||
+ | # for any markup conflicts. | ||
############################################################################### | ############################################################################### | ||
# embedded debug command .... | # embedded debug command .... | ||
Line 50: | Line 56: | ||
# | # | ||
Command=`basename $0` | Command=`basename $0` | ||
- | Version=`sed '/ | + | Version=`sed '/ |
whichunix(){ | whichunix(){ | ||
Line 158: | Line 164: | ||
# Send text status to xymon for display on the page, set the | # Send text status to xymon for display on the page, set the | ||
# colour as appropriate. | # colour as appropriate. | ||
- | $XYMON $XYMSRV | + | echo " |
$MSG | $MSG | ||
- | ${MyBadge} $COLUMN tested in $Duration Seconds" | + | ${MyBadge} $COLUMN tested in $Duration Seconds" | $XYMON $XYMSRV "@" |
} | } | ||
############################################################################### | ############################################################################### | ||
Line 182: | Line 188: | ||
# Send text status to xymon for display on the page, set the | # Send text status to xymon for display on the page, set the | ||
# colour as appropriate. | # colour as appropriate. | ||
- | $XYMON $XYMSRV | + | |
+ | echo " | ||
${TheError} | ${TheError} | ||
- | ${ThePage} | + | ${ThePage}" | $XYMON $XYMSRV "@" |
- | " | + | |
} | } | ||
############################################################################### | ############################################################################### | ||
Line 191: | Line 197: | ||
# grab the full message log that Xymon already analysed | # grab the full message log that Xymon already analysed | ||
# for all the defined msgs tests | # for all the defined msgs tests | ||
+ | # make sure there is a blank line between all paragraphs | ||
MSGLOG=`$XYMONCOMMS $XYMSRV \ | MSGLOG=`$XYMONCOMMS $XYMSRV \ | ||
" | " | ||
| sed -n ' | | sed -n ' | ||
+ | | sed '/Full log\|\(Critical entries\|Warnings\|No entries\) in/ | ||
` | ` | ||
Line 210: | Line 218: | ||
$Comment Status=$Status | $Comment Status=$Status | ||
- | # cut out the paragraphs in the full message log that refer to this | + | # cut out the paragraphs in the full message log that refer to the |
- | # logfile only | + | # analysis of this logfile only |
PLogPath=`$ECHO " | PLogPath=`$ECHO " | ||
$Comment PLogPath=$PLogPath | $Comment PLogPath=$PLogPath | ||
+ | # the first sed will leave a leading blank line which needs to be trimmed | ||
+ | # using the second sed. Also, the warning case in analysis will insert | ||
+ | # gratuitous <pre> and </ | ||
Loglines=`$ECHO " | Loglines=`$ECHO " | ||
-e '/ | -e '/ | ||
- | -e ' | + | -e 'x;/\(Critical entries\|Warnings\|No entries\) in .*' |
- | #-e 'x;/' | + | | sed \ |
+ | -e '/^$/d' \ | ||
+ | -e '/< | ||
+ | -e '/< | ||
+ | | sed \ | ||
+ | -e '/ | ||
+ | -e ' | ||
+ | -e '2,$s/>/ | ||
+ | -e ' | ||
+ | -e ' | ||
+ | ` | ||
+ | # in the last sed, add a blank line after the heading anchor | ||
+ | # and replace potential markup conflicts | ||
MSG=" | MSG=" | ||
Line 402: | Line 426: | ||
CMD $XYMONHOME/ | CMD $XYMONHOME/ | ||
LOGFILE $XYMONSERVERLOGS/ | LOGFILE $XYMONSERVERLOGS/ | ||
- | INTERVAL | + | INTERVAL |
</ | </ | ||
Line 417: | Line 441: | ||
* **2014-01-26** | * **2014-01-26** | ||
* Initial release | * Initial release | ||
+ | * **2014-08-29** | ||
+ | * send message via stdin to avoid command line length issues. | ||
+ | * add a blank line between all paragraphs to ensure only the correct parts of the original page are presented. | ||
+ | * discard the full log and cater for any markup conflicts. | ||