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/ | ||
+ | |||
+ | In the file: \\ | ||
+ | | ||
+ | Added | ||
+ | < | ||
+ | [ccl] | ||
+ | ENVFILE $HOBBITCLIENTHOME/ | ||
+ | CMD $HOBBITCLIENTHOME/ | ||
+ | INTERVAL 5m | ||
+ | </ | ||
+ | |||
+ | Also the pseudo host MAY work on the client side but Ive not tested. \\ | ||
+ | You may want to do the following: | ||
+ | change varible references of licenses to ${MACHINE} \\ | ||
+ | That is: OUTFILE1=" | ||
+ | if you do not want to use a psuedo host (0.0.0.0 licenses) | ||
+ | |||
+ | === Server side === | ||
+ | ~hobbit/ | ||
+ | |||
+ | Add | ||
+ | < | ||
+ | | ||
+ | ENVFILE PATHTO/ | ||
+ | CMD $BBHOME/ | ||
+ | INTERVAL 5m | ||
+ | </ | ||
+ | |||
+ | where PATHTO is replaced with something like / | ||
+ | |||
+ | Two lines are changed in the configuration file hobbitserver.cfg: | ||
+ | < | ||
+ | TEST2RRD=" | ||
+ | GRAPHS=" | ||
+ | </ | ||
+ | and ADD: | ||
+ | < | ||
+ | NCV_ccl=" | ||
+ | </ | ||
+ | |||
+ | 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=" | ||
+ | |||
+ | Add into the configuration file hobbitgraph.cfg. This should preferably be inserted at the end. | ||
+ | |||
+ | < | ||
+ | [ccl] | ||
+ | TITLE clearcase licenses | ||
+ | YAXIS # | ||
+ | DEF: | ||
+ | LINE2: | ||
+ | COMMENT:\n | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | DEF: | ||
+ | LINE2: | ||
+ | COMMENT:\n | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | DEF: | ||
+ | LINE2: | ||
+ | COMMENT:\n | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | GPRINT: | ||
+ | </ | ||
+ | |||
+ | You may want to drop either the Currentactiveusers or Availablelicenses section, | ||
+ | but I like having the Maximumactiveusersa as a " | ||
+ | |||
+ | ===== Source ===== | ||
+ | ==== ccl.sh ==== | ||
+ | <hidden onHidden=" | ||
+ | <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=" | ||
+ | # if you do not want to use a psuedo host (0.0.0.0 licenses) | ||
+ | | ||
+ | touch $OUTFILE1 | ||
+ | |||
+ | |||
+ | cclfile=" | ||
+ | CClicense=/ | ||
+ | |||
+ | $CClicense | ||
+ | $CClicense | ||
+ | |||
+ | Max_User=`$CClicense | ||
+ | |||
+ | Current_Users=`$CClicense | ||
+ | |||
+ | PCusered=`expr $Current_Users \* 100 \/ $Max_User` | ||
+ | |||
+ | |||
+ | if [ $PCusered -gt $CCyellow ]; then | ||
+ | | ||
+ | echo " Clearcase licensence exceed yellow limit of $CCyellow " > $OUTFILE1 | ||
+ | else | ||
+ | COLOR=green | ||
+ | fi | ||
+ | |||
+ | if [ $PCusered -gt $CCred ]; then | ||
+ | | ||
+ | echo " Clearcase licensence exceed red limit of $CCred " > $OUTFILE1 | ||
+ | else | ||
+ | COLOR=$COLOR | ||
+ | fi | ||
+ | |||
+ | |||
+ | # Tell Xymon about it | ||
+ | $BB $BBDISP " | ||
+ | `echo` | ||
+ | `echo " | ||
+ | `echo " | ||
+ | `echo ${Max_User}` | ||
+ | `echo " | ||
+ | `echo ${PCusered}` | ||
+ | `echo` | ||
+ | `cat ${OUTFILE1}` | ||
+ | `echo` | ||
+ | `cat ${cclfile}` | ||
+ | " | ||
+ | rm $cclfile | ||
+ | rm $OUTFILE1 | ||
+ | |||
+ | exit 0 | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== 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:// | ||
+ | * The Xymon User mailing list. Particularly Anna Jonna Armannsdottir | ||
+ | * And Henrik of course !!!!!! | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
+ | * **2008-06-30** | ||
+ | * Initial release | ||