Hello:
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
#adduser solarw
#passwd 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 ]
then
echo "Message: Cluster state HACMP OK $state"
echo "Statistic: 1"
else
echo "Message: Servicio de Cluster con problemas - Revisar servicios HACMP $state"
echo "Statistic: 0"
fi
then the monitor work without problems:

The command monitoring cluster HACMP service state. reference link:
https://www.ibm.com/support/knowledgecenter/SSPHQG_7.1.0/com.ibm.powerha.admngd/clmgr_cmd.htm
http://www-03.ibm.com/systems/resources/systems_power_software_availability_clmgr_tech_guide.pdf
Next step is implement more component for monitoring nodes and resources of cluster.
Enjoy!
Pedro González Santibañez.