Operating System - HP-UX
1834780 Members
2521 Online
110070 Solutions
New Discussion

Re: script to monitor hard disk/cpu and memory

 
Zulfikri
Advisor

script to monitor hard disk/cpu and memory

Hi all,

Anyone has this script handy to monitor hd/cpu and memory. Need to monitor any increamnet on the partition.

Many thanks,

Zul
Beware GATE$ of HELL!!
5 REPLIES 5
Elmar P. Kolkman
Honored Contributor

Re: script to monitor hard disk/cpu and memory

Glance is a good way to monitor...
sar, vmstat and iostat are other ways of getting info like this.

Or do you need to monitor diskspaceusage? In that case you need to look at df/bdf output and compare it with the previous measurement.
Every problem has at least one solution. Only some solutions are harder to find.
Lorenzo Facello
Valued Contributor
T. M. Louah
Esteemed Contributor

Re: script to monitor hard disk/cpu and memory

Start here "tools for measuring system
and application performance" located at:
http://www.hp.com/products1/unix/java/infolibrary/tools/index.html
HPUX commands comes handy sometimes, if coupled with tools such as TUSC, LSOF (trace unix system calls from http://hpux.cs.utah.edu/) you can do some interesting investigative troubleshooting, here are some examples:
0- to detect any IO stacking on disk
#sar -d 5 100 (iteration every 5 seconds for 100 times)
1- to check if dynamic buffer caching is optimized (no waste) :
# sar -b 3 50
idealy you should see an average %wcacheof 95 or above, if it consistently less than 75% lower dbc_max_pct
2-For CPU usage & bottlenecks one can start looking at:
# sar -uM 2 50
3- to see how swap is used run:
# swapinfo -tma
check total PCT used
4- to verify filesystem usage run:
# bdf -i
5- dmesg
6- use Support tool manager comes with OnlineDiag:
# cstm -> ru -> logtools -> rs (run summary)look at IO errors, usually it shows alot of details about all devices seen by ur system.
7- check syslog.log, actually this should be Number 1, event.log & GSP logs if necessary.

With the above combined you can write customized scripts that grep for thresholds & sends emails alerts to the sysadmin .. but TEST TEST & TEST !

Good Luck
T+ pliz assign points<
Little learning is dangerous!
lawrenzo
Trusted Contributor

Re: script to monitor hard disk/cpu and memory

Hello,

I aquired the attached script from a user on the ITRC_forums.

It's quite good

hello
Laurent Menase
Honored Contributor

Re: script to monitor hard disk/cpu and memory

If you have glance, the best is glance -adviser option. you can make a description of all the parameters ( which may be displayd in glance) you want to display, and put them in a file.