Operating System - HP-UX
1753588 Members
6566 Online
108796 Solutions
New Discussion юеВ

How to check CPU MEM usage

 
trisno_1
New Member

How to check CPU MEM usage

Dear master,

how to make script to check list cpu usage, memory usage, hard disk usage in all my hp server once in every day ? i can do by crontab , but how to make the script ?
thank you
bangun
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: How to check CPU MEM usage

How detailed do you want?
You could ask top(1) to send out one pass.
For memory (actually swap) usage, you could use "swapinfo -tam".
For disk usage you can use "bdf -l".
Is this detailed enough for you?
trisno_1
New Member

Re: How to check CPU MEM usage

hi denis,

tks you for your feedback, i know that command. But i want to put it all command in one script and the output in one file ?

tks

bangun
Dennis Handly
Acclaimed Contributor

Re: How to check CPU MEM usage

>But I want to put it all command in one script and the output in one file?

You can have each of these commands append their output to that one file.
> $OUTFILE
top -f $OUTFILE -n 50
swapinfo -tam >> $OUTFILE
bdf -l >> $OUTFILE
Emil Velez
Honored Contributor

Re: How to check CPU MEM usage

do a man sa1

in that man page it will give you sa1 commands you can put in a cron file to cause sar to collect data every hour on your system.