monitors:ccl

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


monitors:ccl [2009/11/23 05:40] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Clearcase License client module for Xymon Monitor ======
 +
 +^ Author | [[ michael.nemeth@lmco.com| Michael Nemeth ]] |
 +^ Compatibility | Xymon 4.2 |
 +^ Requirements | clearcase |
 +^ Download | None |
 +^ Last Update | 2008-06-22 |
 +
 +
 +===== Description =====
 +Monitor and graphs clearcase licenses.
 +
 +Will turn red or yellow base on percent used set the below in the script. 
 +
 +  CCred=95
 +  CCyellow=90
 +
 +
 +===== Installation =====
 +I run this on the server side to a pseudo host \\
 +0.0.0.0 licenses #
 +
 +=== Client side ===
 +But if you chose to do client side. \\
 +Not tested: \\
 +Put the script ~hobbit/client/ext/ccl.sh
 +
 + In the file: \\
 + ~hobbit/client/etc/clientlaunch.cfg \\
 +Added
 +<code>
 + [ccl]
 +  ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg
 +  CMD $HOBBITCLIENTHOME/ext/ccl.sh
 +  INTERVAL 5m   
 +</code>
 +
 +Also the pseudo host MAY work on the client side but Ive not tested. \\
 +You may want to do the following:(was working ok on server side)  \\
 +change varible references of licenses to ${MACHINE} \\
 +That is:  OUTFILE1="$BBTMP/ccl.licenses" to  OUTFILE1="$BBTMP/ccl.${MACHINE}" \\
 +if you do not want to use a psuedo host (0.0.0.0 licenses)
 +
 +=== Server side ===
 +~hobbit/server/etc/hobbitlaunch.cfg
 +
 +Add
 +<code>
 + [ccl]                                                   
 +  ENVFILE PATHTO/etc/hobbitlaunch.cfg                
 +  CMD $BBHOME/ext/ccl.sh                              
 +  INTERVAL 5m
 +</code>
 +
 +where PATHTO is replaced with something like /home/nemeth/hobbit/server.
 +
 +Two lines are changed in the configuration file hobbitserver.cfg:
 +<code>
 +TEST2RRD="cpu=la,disk, ... ,lines,ccl=ncv"
 +GRAPHS="la,disk, ... ,lines,ccl"
 +</code>
 +and ADD:
 +<code>
 +NCV_ccl="*:GAUGE"
 +</code>
 +
 +You may want to create a a psuedo host 0.0.0.0 licenses # in the bb-hosts file or
 +change varible references of licenses to ${MACHINE}
 +
 +That is:  OUTFILE1="$BBTMP/ccl.licenses" to  OUTFILE1="$BBTMP/ccl.${MACHINE}"
 +
 +Add into the configuration file hobbitgraph.cfg. This should preferably be inserted at the end.
 +
 +<code>
 +[ccl]
 +        TITLE  clearcase licenses
 +        YAXIS #
 +        DEF:CA=ccl.rrd:Currentactiveusers:AVERAGE
 +        LINE2:CA#FF0000:Current activeusers
 +        COMMENT:\n
 +        GPRINT:CA:LAST: \: %5.1lf (cur)
 +        GPRINT:CA:MAX: \: %5.1lf (max)
 +        GPRINT:CA:MIN: \: %5.1lf (min)
 +        GPRINT:CA:AVERAGE: \: %5.1lf (avg)\n
 +        DEF:MA=ccl.rrd:Maximumactiveusersa:AVERAGE
 +        LINE2:MA#CC3333:Maximum Active Users
 +        COMMENT:\n
 +        GPRINT:MA:LAST: \: %5.1lf (cur)
 +        GPRINT:MA:MAX: \: %5.1lf (max)
 +        GPRINT:MA:MIN: \: %5.1lf (min)
 +        GPRINT:MA:AVERAGE: \: %5.1lf (avg)\n
 +        DEF:AA=ccl.rrd:Availablelicenses:AVERAGE
 +        LINE2:AA#00CCCC:Available licenses
 +        COMMENT:\n
 +        GPRINT:AA:LAST: \: %5.1lf (cur)
 +        GPRINT:AA:MAX: \: %5.1lf (max)
 +        GPRINT:AA:MIN: \: %5.1lf (min)
 +        GPRINT:AA:AVERAGE: \: %5.1lf (avg)\n
 +</code>
 +
 +You may want to drop either the Currentactiveusers or Availablelicenses section,
 +but I like having the Maximumactiveusersa as a "ceiling line" 
 +
 +===== Source =====
 +==== ccl.sh ====
 +<hidden onHidden="Show Code ⇲" onVisible="Hide Code ⇱">
 +<code bash>
 +#!/bin/ksh -p
 +
 +COLUMN=ccl
 +
 +# COLOR defaults to green
 +COLOR=GREEN
 +
 +CCred=95
 +CCyellow=90
 +
 +# You may want to: change varible references of licenses to ${MACHINE}
 +#That is:  OUTFILE1="$BBTMP/ccl.licenses" to  OUTFILE1="$BBTMP/ccl.${MACHINE}"
 +# if you do not want to use a psuedo host (0.0.0.0 licenses)
 + OUTFILE1="$BBTMP/ccl2.licenses"
 + touch $OUTFILE1
 +
 +
 +cclfile="$BBTMP/ccl.licenses"
 +CClicense=/usr/atria/bin/clearlicense
 +
 +$CClicense  | sed  -n '/ClearCase/,/Available licenses/p'  > $cclfile
 +$CClicense  | sed  -n  '/License Usage Statistics/,/active users bumped by preferred user/p' | head  -4 >> $cclfile
 +
 +Max_User=`$CClicense  | sed -n '/Max-Users/{n;p;q;}'   | awk '{print $1}'  `
 +
 +Current_Users=`$CClicense  | sed -n '/Current active users:/{p;q;}'  | awk -F: '{print $2}'`
 +
 +PCusered=`expr $Current_Users \* 100 \/ $Max_User`
 +
 +
 +  if [ $PCusered -gt $CCyellow ]; then
 +   COLOR=yellow
 +   echo " Clearcase licensence exceed yellow limit of $CCyellow " >  $OUTFILE1
 +  else
 +      COLOR=green
 +fi
 +
 +  if [ $PCusered -gt $CCred ]; then
 +   COLOR=red
 +   echo " Clearcase licensence exceed red limit of $CCred " >  $OUTFILE1
 +  else
 +      COLOR=$COLOR
 +fi
 +
 +
 +# Tell Xymon about it
 +$BB $BBDISP "status licenses.ccl $COLOR `date`
 +`echo`
 +`echo "Clearcase\n"`
 +`echo "Max-User:\n"`
 +`echo ${Max_User}`
 +`echo "%Used:\n"`
 +`echo ${PCusered}`
 +`echo`
 +`cat ${OUTFILE1}`
 +`echo`
 +`cat ${cclfile}`
 + "
 +rm $cclfile
 +rm $OUTFILE1
 +
 +exit 0
 +
 +</code>
 +</hidden>
 +
 +===== Known  Bugs and Issues =====
 +I don't what happens if the clearlicense command cann't contact the license server.
 +===== To Do =====
 +Figure out what happens if the clearlicense command can't contact the license server
 +
 +Turn red if the license server down.
 +
 +Clean up the script. Found out I can get info on our two product separately (clearcase and multisite) this would make the parsing easier.
 +
 +===== Credits =====
 +  * Original recipe at: http://www.hswn.dk/hobbit/help/howtograph.html
 +  * The Xymon User mailing list. Particularly Anna Jonna Armannsdottir
 +  * And Henrik of course !!!!!!
 +
 +===== Changelog =====
 +
 +  * **2008-06-30**
 +    * Initial release
  
  • monitors/ccl.txt
  • Last modified: 2009/11/23 05:40
  • by 127.0.0.1