#!/bin/sh # # queue: Sun Enterprise Server check - BB external script test # # version 1.0 # version 1.1 - properly uses $CAT instead of cat # version 1.2 - properly uses $MACHINE instead of `uname -n` in bb-hosts check # version 1.3 - properly uses $THIS_HOST instead of $MACHINE due to fqdn using comma in name - thanks Craig Cook # version 1.4 - switched from "lpstat -p" to "lpstat -v" for speed and Sun prob # # BIG BROTHER / XXXXXXXXXXXXXXXX status # # Written by Paul A. Luzzi # on March 22, 2000 # ######################################## # NOTE # This has been tested with BB 1.2b, 1.4h2, 1.5, 1.5a # # Tested on : # Sun Ultra 60, E220R/420R, E250/450, E3000/3500, E4500 # HP-UX 10.20 and 11.0 # # Could not make my table code appear as # nice as I normally do with all the # indents, because the spaces were taking # up very precious data area I needed. ######################################## ######################################## # INSTALLATION # step 1 - update the EXT section of the runbb.sh script to include this # ... ######################################## ################################## # CONFIGURE IT HERE ################################## LPSTAT=/usr/bin/lpstat export LPSTAT ################################## # Start of script ################################## if test ! "$BBHOME" then echo "template: BBHOME is not set" exit 1 fi if test ! -d "$BBHOME" then echo "template: BBHOME is invalid" exit 1 fi if test ! "$BBTMP" # GET DEFINITIONS IF NEEDED then echo "template: The BB environment is not set" exit 1 fi ##### ##### Start of custom section added by Paul A. Luzzi ##### ##### ##### Get Status proc - used to get all responses ##### get_status() { ##### ##### Setup any and all variables before beginning. ##### ##### ##### Section written on 03-22-2000 by Paul A. Luzzi ##### for use with Big Brother ##### ##### Purpose is to report back to a central server, all "standard" ##### detailed information about network, disk, volume, cpu, memory ##### which is not reported thru regular "easy" checks. ##### ##### Any problem areas should be highlighted in : ##### bold, italics, and red font. ##### ##### ##### Setup some variables for use later ##### COLOR="green" echo "0" > /tmp/$THIS_HOST.queue.color ##### ##### Printer Information ##### echo "
| Printer Name | " echo "Queued Jobs | " echo "
| "$2" | " } else if ( $1 == "Queued Jobs " ) { if ( $2 >= 5 ) { if ( $2 >= 10 ) { print ""$2" | " print ""$2" | " print "" system( "echo 1 >> /tmp/$THIS_HOST.queue.color" ) } } else { print ""$2" | " print "" } } else if ( $1 == "Long Wait " ) { system( "echo 2 >> /tmp/$THIS_HOST.queue.color" ) } } } ' fi done ##### ##### Close up the table, and the font tags - we're done. ##### echo "