[Xymon] Solaris prtdiag

Vernon Everett everett.vernon at gmail.com
Tue Oct 11 14:09:33 CEST 2011


Hi Roland

This is what I am using. I made a mistake though, I did not write it. I must
have got confused with another script I wrote. (I confuse easily)
Credit where due though, and credit goes to Wim Olivier (See comments)
It also looks like it does pretty much the same as Gautier's script.

Only issue you may have, there is a bug in the picl daemon, and it sometime
crashes. (Recent patching may have fixed this)
When that happens, all bets are off, and results could vary.
Restarting picl service normally fixes everything.
Might want to add /system/picl to the list of monitored services.
There are two good SMF monitoring scripts on the Xymonton page.
http://www.xymonton.org/monitors:smf.sh
and
http://www.xymonton.org/monitors:smf2.ksh
I prefer the 2nd one,  obviously :-) but the first one is simpler to
configure.
The choice is yours.

Regards
     Vernon

#!/usr/bin/ksh

#
# PURPOSE
# This is an very simple script/test, but extremely useful.
# It detects ANY hardware failure in Sun SPARC systems by using the standard
'prtdiag' command.  Prtdiag exits with a value of
# '1' if there is an hardware error, otherwise with an exit code of '0'.
# This way, no model/platform specific (i.e. V240/V890/15K, etc.)
customizations are required, as the output of 'prtdiag'
# differs on most systems. It works fine on Fujitsu-Siemens systems too.
#
# Provided by: Wim Olivier, Senior Solaris/VERITAS Engineer, AL Indigo,
Johannesburg, South Africa
# sunhw

# INSTALLATION
# 1.    Copy the script to $BBHOME/ext/sunhw.sh
# 2.    Add it to the $BBHOME/etc/bb-bbexttab file
# 3.    Restart the BB client
#

BBPROG=sunhw; export BBPROG
TEMPFILE=/$BBTMP/sunwh.OUTPUT.$$
TEST="sunhw"
COLOR="green"

if [ "$BBHOME" = "" ]
then
        echo "BBHOME is not set... exiting"
        exit 1
fi

if [ ! "$BBTMP" ]                     # GET DEFINITIONS IF NEEDED
then
         # echo "*** LOADING BBDEF ***"
        . $BBHOME/etc/bbdef.sh          # INCLUDE STANDARD DEFINITIONS
fi
PANIC="1"       # GO RED AND PAGE AT THIS LEVEL

PLATFORM=`uname -i`
/usr/platform/$PLATFORM/sbin/prtdiag -v > $TEMPFILE
RESULT=$?
#echo $RESULT
        #
        # DETERMINE RED/YELLOW/GREEN
        #
if [ "$RESULT" -ne 0 ]
then
    COLOR="red"
fi

#
# AT THIS POINT WE HAVE OUR RESULTS.  NOW WE HAVE TO SEND IT TO
# THE BBDISPLAY TO BE DISPLAYED...
#

MACHINE=`uname -n`

#
# THE FIRST LINE IS STATUS INFORMATION... STRUCTURE IMPORANT!
# THE REST IS FREE-FORM - WHATEVER YOU'D LIKE TO SEND...
#
LINE="status $MACHINE.$TEST $COLOR `date`
`cat $TEMPFILE`"

$RM -f $TEMPFILE

# NOW USE THE BB COMMAND TO SEND THE DATA ACROSS
$BB $BBDISP "$LINE"                     # SEND IT TO BBDISPLAY


On 11 October 2011 10:12, Roland Soderstrom <rolands at logicaltech.com.au>wrote:

> Hi,
>
> I have used old good bb-prtdiag for many years.
> It works fairly well for a lot of old Sun machines but lack the new ones.
> The script is pretty nasty in nested loops and too many if's.
> It is not easy to update it to accommodate new machines.
>
> Is there anyone out there that has a new version of it?
> Can't find any on xymonton.
> Or do you monitor SUN hw in another way than prtdiag -> xymonserver?
>
> Otherwise I will rewrite it to support our new hw.
>
> - Roland
> ______________________________**_________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/**mailman/listinfo/xymon<http://lists.xymon.com/mailman/listinfo/xymon>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20111011/0fbec6ba/attachment.html>


More information about the Xymon mailing list