Monitors the CIMOM process using a shell script and generates an alert if the process appears to mis-function.
This Monitor monitors the health of CIMOM daemon.
Warning state for this monitor indicates that the CIMOM daemon version is too old and not supported
Error state for this monitor indicates that the CIMOM daemon does not respond
If in warning state, update CIMOM daemon to required version on the target server
If in error state, restart the failed CIMOM daemon on the target server
Target | Fujitsu.Servers.PRIMERGY.Linux.CimManagement | ||
Parent Monitor | System.Health.AvailabilityState | ||
Category | AvailabilityHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Fujitsu.Servers.PRIMERGY.Linux.ShellScript.LessThanThreshold.ThreeState.MonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Fujitsu.Servers.PRIMERGY.Linux.Cim.ShellScript.LessThan.ThreeState.Monitor" Accessibility="Public" Enabled="true" Target="Fujitsu.Servers.PRIMERGY.Linux.CimManagement" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Fujitsu.Servers.PRIMERGY.Linux.ShellScript.LessThanThreshold.ThreeState.MonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Fujitsu.Servers.PRIMERGY.Linux.Cim.ShellScript.LessThan.ThreeState.Monitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="Fujitsu.Servers.PRIMERGY.Linux.ManagementClientSoftware"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Data/Context///*[local-name()="StdOut"]$</AlertParameter2>
<AlertParameter3>$Data/Context///*[local-name()="StdErr"]$</AlertParameter3>
<AlertParameter4>$Data/Context///*[local-name()="ReturnCode"]$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="StatusOK" MonitorTypeStateID="StatusOK" HealthState="Success"/>
<OperationalState ID="StatusWarning" MonitorTypeStateID="StatusWarning" HealthState="Warning"/>
<OperationalState ID="StatusError" MonitorTypeStateID="StatusError" HealthState="Error"/>
</OperationalStates>
<Configuration>
<Interval>300</Interval>
<TargetSystem>$Target/Property[Type="Fujitsu.Servers.PRIMERGY.Linux.ManagementClientSoftware"]/NetworkName$</TargetSystem>
<ScriptName>CimomHealth.sh</ScriptName>
<ShellScript>#!/bin/sh
# Fujitsu
# Copyright 2014-2019 FUJITSU LIMITED
#
# CimomHealth.sh - checks sfcb/tog-pegasus daemon status
OK=0
WARN=1
ERR=2
RETVALUE=$OK # We assume all is well
SCRIPTLOG="/tmp/Fujitsu/$0.log"
SFCBMINVER="1.3.11-0.23.2"
PEGASUSMINVER="2.11.0"
# arguments check
LISTENPORT=`echo $1 | awk '{print tolower($0)}'`
DBG=`echo $2 | awk '{print tolower($0)}'`
[ "$DBG" = "dbg" ] && echo "Running $0 in debug mode"
# In DEBUG mode: generate some files under "/tmp" to see, the script is running
if [ "$DBG" = "dbg" ]
then
mkdir -p /tmp/Fujitsu/
tail $SCRIPTLOG 2>/dev/null > $SCRIPTLOG.bk
mv -f $SCRIPTLOG.bk $SCRIPTLOG
echo "$0 V__MP_VERSION__ last ran at `date`" >> $SCRIPTLOG
fi
EECD=`whereis eecd | awk 'NF>1{print $2}'`
if [ "$EECD" = "" ]
then
# either not a system from FUJITSU or no ServerView agents installed - do nothing!
[ "$DBG" = "dbg" ] && echo "Not a system from FUJITSU or ServerView Agents not installed."
exit $OK
fi
# test that SFCB is installed
SFCB=`whereis sfcbd | awk 'NF>1{print $2}'`
PEGASUS=""
if [ "$SFCB" = "" ]
then
# test that OpenPegasus is installed
PEGASUS=`whereis cimserver | awk 'NF>1{print $2}'`
if [ "$PEGASUS" = "" ]
then
echo "SFCB or OpenPegasus is required! Abort with Error."
exit $ERR
else
[ "$DBG" = "dbg" ] && echo "OpenPegasus is installed at: $PEGASUS"
fi
else
[ "$DBG" = "dbg" ] && echo "SFCB is installed at: $SFCB"
fi
if [ "$SFCB" != "" ]
then
# check SFCB version
SFCBVER=`rpm -qa | grep -i sfcb | sed 's/sblim-sfcb-//'`
if [ "$SFCBVER" \< "$SFCBMINVER" ]
then
echo "WARNING: SFCB version '$SFCBVER' is not supported! Use at least '$SFCBMINVER'!."
RETVALUE=$WARN
else
[ "$DBG" = "dbg" ] && echo "SFCB version is: $SFCBVER"
fi
# test that SFCB is running
SFCBRUNNING=`ps -A | grep -i '[s]fcb'`
if [ "$SFCBRUNNING" = "" ]
then
echo "SFCB is *NOT* running! Abort with Error."
exit $ERR
fi
[ "$DBG" = "dbg" ] && echo "SFCB is running"
# test that SFCB is listening
SFCBLISTEN=`netstat -nlx | grep -i sfcb`
if [ "$SFCBLISTEN" = "" ]
then
echo "SFCB is *NOT* listening! Abort with Error."
exit $ERR
fi
[ "$DBG" = "dbg" ] && echo "SFCB is listening"
fi
if [ "$PEGASUS" != "" ]
then
# check OpenPegasus version
PEGASUSVER=`rpm -qa | grep -v -i lib | grep -i tog-pegasus | sed 's/tog-pegasus-//'`
if [ "$PEGASUSVER" \< "$PEGASUSMINVER" ]
then
echo "WARNING: OpenPegasus version '$PEGASUSVER' is not supported! Use at least '$PEGASUSMINVER'!."
RETVALUE=$WARN
else
[ "$DBG" = "dbg" ] && echo "OpenPegasus version is: $PEGASUSVER"
fi
# test that OpenPegasus is running
PEGASUSRUNNING=`ps -A | grep -i '[c]imserver'`
if [ "$PEGASUSRUNNING" = "" ]
then
echo "OpenPegasus is *NOT* running! Abort with Error."
exit $ERR
fi
[ "$DBG" = "dbg" ] && echo "OpenPegasus is running"
# test that OpenPegasus is listening
PEGASUSLISTEN=`netstat -nlx | grep -i tog-pegasus`
if [ "$PEGASUSLISTEN" = "" ]
then
echo "OpenPegasus is *NOT* listening! Abort with Error."
exit $ERR
fi
[ "$DBG" = "dbg" ] && echo "OpenPegasus is listening"
fi
CIMOMLISTENP=`netstat -vltn | grep $LISTENPORT`
if [ "$CIMOMLISTENP" = "" ]
then
echo "Nothing is listening on port $LISTENPORT! Abort with Error."
exit $ERR
fi
[ "$DBG" = "dbg" ] && echo "Port $LISTENPORT is in LISTEN state"
exit $RETVALUE
</ShellScript>
<ScriptArguments>5989 second_arg_3_chars_DBG_for_DEBUG</ScriptArguments>
<Timeout>60</Timeout>
<UserName>$RunAs[Name="Unix!Microsoft.Unix.ActionAccount"]/UserName$</UserName>
<Password>$RunAs[Name="Unix!Microsoft.Unix.ActionAccount"]/Password$</Password>
<FilterExpression>
<RegExExpression>
<ValueExpression>
<XPathQuery>//*[local-name()="ReturnCode"]</XPathQuery>
</ValueExpression>
<Operator>MatchesRegularExpression</Operator>
<Pattern>^[0-2]$</Pattern>
</RegExExpression>
</FilterExpression>
<WarningThreshold>1</WarningThreshold>
<ErrorThreshold>2</ErrorThreshold>
</Configuration>
</UnitMonitor>