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 - ...
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 ...
Monitoring File count in a Folder using Script Monitor ( Linux and Solaris)
OpManager supports different scripts (Powershell , Shell,Perl & VBScript) for adding custom script monitors. Here is a sample shell script for monitoring number of files on a Linux and Solaris servers. For Linux server : Script Body: #!/bin/bash ...
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 ...
Installing OpManager agent on devices using Startup script
Windows GPO can be used to install the OpManager agent in multiple devices, even when other methods of installation fail. Various reasons behind agent installation failure are as follows: Access denied Network path not found Unknown username or ...