Adding Memory utilization script monitor for HP-UX devices

Adding Memory utilization script monitor for HP-UX devices

Question: CLI based memory utilization monitor shows wrong value in OpManager for HP-UX servers , how do I add custom script monitor as a work around?

Solution: You can add script monitor and associate to HP-UX devices , go to admin > Script Templates > New Template  , fill in monitor name , Description, Interval , Units under Monitor details.

command line  : sh ${FileName}.sh  

Script body 

T=`/usr/contrib/bin/machinfo |awk '/Memory/'|awk -v c=0 '{for (i=0;i<=NF;i++) if($i=="MB") c=i-1;}{print $c}'`;
F=`vmstat 1 3|awk -v c=0 '{for (i=0;i<=NF;i++) if ($i=="free") c=i;} {print $c}'|tail -1`;


echo Data:
echo Memory   `echo "scale=3; ((($T-($F*4/1024))/$T)*100)"|bc`


Execute From : Monitored Machine

Save the template , go to device snapshot page > Monitors >  Script Monitors > Click here to add Script Monitors> click add on the one you created .

                  New to ADSelfService Plus?

                    • Related Articles

                    • Wrong Memory usage stats using CLI monitor on Linux devices

                      Issue - The memory usage monitor worked fine all this while and suddenly there might be a surge in utilization which may often cross 100%-180% whereas the actual utilization is less. Reproduce the issue on the server using - /usr/bin/free -b Cause - ...
                    • Discovering IPMI devices in OpManager

                      From OpManager version 125344, users can discover and monitor their IPMI devices along with their associated interfaces in OpManager. Using IPMI, critical metrics of your servers can be monitored even if they were down, thereby helping you stay ...
                    • Script monitor for Mounted volumes - Windows

                      This script can be added as a script monitor and can be used to monitor the mounted volumes, this can display graphs as well - ####################################################################### Command line - cscript ${FileName}.vbs ...
                    • Adding devices using SSH Key based authentication in OpManager

                      A SSH key is an access credential used in SSH protocol. It provides the same functionality as the user name & password except that it is much more reliable and cant be easily cracked. OpManager supports SSH key based authentication. To use a SSH key, ...
                    • How to discover storage devices in OpManager

                      The topics covered under this section are: Prerequisites For Device Discovery Adding A Device Adding Device Details Prerequisites for Device discovery The list of storage devices that are monitored by OpManager and their respective supported models, ...