[Xymon] ext script does not show up at webpage

Torsten Richter bb4 at richter-it.net
Tue May 13 14:53:59 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

it is not possible to have a column name that consists of more than 1 word.
I think if you change "available storage" to "available_storage" then
your test should appear.

HTH
Torsten

On 13.05.2014 13:25, Simon HĂžjberg Jespersen wrote:
> Hi xymon list
> This is my first post, and it is about a custom script on a sun solaris client.
> 
> I have a script placed at
> /home/bb/client/ext/monitorfs_xymon.sh on the client
> 
> 
> It is doing some disk check and end up with this command
> $xymon $XYMSRV "status $MACHINE.$COLUMN $COLOR `date` ${MSG}"
> 
> When I echo this command line to a file for debug
> The full commandline looks lige this
> 
> /home/bb/bin/xymon "10.83.82.9 status aarapp144.available storage green Tuesday, 13 May 2014 13:10:20 CEST Looking good"
> 
> When I try to run it from commandline the output is
> 
> Xymon version 4.3.17
> Usage: /home/bb/bin/xymon [--debug] [--merge] [--proxy=http://ip.of.the.proxy:port/] RECIPIENT DATA
>   RECIPIENT: IP-address, hostname or URL
>   DATA: Message to send, or "-" to read from stdin
> 
> Can anybody help me to figure what is wrong , I think i followed to description in tips & tricks.
> Another question, can I use the cfg script to source my own variable to use in scripts ?
> 
> Regards Simon
> PS..
> /* the whole script */
> 
> #!/usr/bin/bash
> FILESYSTEMS=/,/export,/local
> IFS=","
> MACHINE=`hostname`
> COLUMN="available storage"
> COLOR=green
> MSG="Looking good"
> TRESHOLDUSEDGB=50
> TRESHOLDMAXPROCENTUSED=100
> TRESHOLDAVAILGB=10
>         function teratogb {
>         tb=$1
>                 echo $((GB*1024))
> 
>         }
>         function kbtogb {
>                 kb=$1
>                 #echo $1
>                 echo $((kb/1024*1024))
>         }
> 
>         function measurement {
>                 in=$1
>                 len=${#in}
>                 tp=${in:len -1:1}
>                         if [ "$tp" == "K" ]
>                                 then
>                                         in=${in:0:len -1}
> 
>                                         kbtogb $in
>                         fi
>                         if [ "$tp" == "T" ]
>                                 then
>                                         echo "$1 :call teratogb with"
>                                         echo ${in:0:len -1}
> 
>                         fi
>                         if [ "$tp" == "G" ]  || [ "$tp" == "%" ]
>                                 then
>                                         value=${in:0:len -1}
>                                         x=0
>                                         returnvalue=""
>                                 while [ $x -lt $len  ]
>                                 do
>                                         ch=${value:$x:1}
>                                         if [ "$ch" == "." ]
>                                         then
>                                                 break
>                                         else
>                                                 returnvalue=$returnvalue$ch
>                                         fi
>                                         x=$((x + 1))
> 
>                                 done
>                                         echo $returnvalue
>                         fi
>         }
>         for i in ${FILESYSTEMS};do
>                 lfil=`df -h  $i | tail -1` >> /dev/null
> 
>                 usedgb=`echo $lfil | awk ' { print $3 } '` >> /dev/null
>                 usedgb=`measurement $usedgb` >> /dev/null
>                                         if [ $usedgb -ge  $TRESHOLDUSEDGB ]
>                                 then
>                                         COLOR="red"
>                                         MSG="Treshold used space  on $i exceeded the limit set on $TRESHOLDUSEDGB gb "
>                         fi
> 
>                 availgb=`echo $lfil | awk ' { print $4 } '` >> /dev/null
>                 availgb=`measurement $availgb`
>                        if [ $availgb -le $TRESHOLDAVAILGB ]
>                                 then
>                                         COLOR=red
>                                         MSG="Treshold available diskspace on $i exceeded the limit set on at least $TRESHOLDAVAILGB gb "
>                         fi
>                 procentused=`echo $lfil | awk ' { print $5 } '` >> /dev/null
>                 procent=`measurement $procentused` >> /dev/null
> 
>                         if [ $procent -ge $TRESHOLDMAXPROCENTUSED ]
>                                 then
>                                 COLOR=red
>                                        MSG="treSHOLD ON MAXIMUM USED DISKSPACE IN PROCENT ON $I EXCEEDED THE LIMIT SET TO $trESHOLDMAXPROCENTUSED"
> 
>                         fi
>         done
> 
> echo "$XYMON $XYMSRV status $MACHINE.$COLUMN $COLOR `date` ${MSG}" >> /tmp/du_i_run.log
> $XYMON $XYMSRV "status $MACHINE.$COLUMN $COLOR `date` ${MSG}"
> exit 0
> 
> 
> 
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
> 

- -- 
+---------------------------------------------------------+
| E-mail  : bb4 [at] richter-it.net			  |
|							  |
| Homepage: http://www.richter-it.net/			  |
+---------------------------------------------------------+
Download my public key from:
http://gpg-keyserver.de/pks/lookup?search=0x899093AC&op=get
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iEYEARECAAYFAlNyFecACgkQ7DlmxomQk6zXhQCfaIbeoBbklmiCw24zyExI/F98
UMAAmwZDaWNMDATLVwBSlaGgmWsXs7sA
=4vdP
-----END PGP SIGNATURE-----



More information about the Xymon mailing list