I made this template for monitoring my AIX boxes with HACMP cluster on my SAP systems.the template was tenting on AIX 7.1.
Objetive: Monitor state HACMP Cluster services on AIX.
Description: Template monitoring cluster state.
step to implement
Create at O.S level one user, may be: solarw
the user need to have permissions to execute this HACMP commands, configure this with sudo. Example sudo file:
User_Alias ADMIN = solarw
ADMIN ALL= NOPASSWD: ALL
note:this is a expample file, for more secure level implement with more restrictions (man sudo ).
At Solar wind create the template with bash script UNIX with this caracteristics:
in the body script implement this code:
#Monitorea estado del cluster HACMP
#Pedro Gonzalez Santibañez - 11/05/2016
clustat=`sudo /bin/su - root -c '/usr/es/sbin/cluster/utilities/clmgr -a state query cluster' > /tmp/cluster.log`
state=`sed -e 's/"//g' /tmp/cluster.log | sed -e 's/STATE=//g'`
if [ $state = STABLE ]
echo "Message: Cluster state HACMP OK $state"
echo "Statistic: 1"
echo "Message: Servicio de Cluster con problemas - Revisar servicios HACMP $state"
echo "Statistic: 0"
then the monitor work without problems:
The command monitoring cluster HACMP service state. reference link:
Next step is implement more component for monitoring nodes and resources of cluster.
Pedro González Santibañez.