Process monitor script?
Hey guys.
My question is pretty simple. I've got a script here that will monitor hard drive usage. Once it gets to 90% i get a snmp alarm. My next project is to monitor CPU usage. With my hard drive script i use df -a to get my hard drive usage in a perl script. Is there any command that will output how much CPU usage is currently being used. Any help is greatly appreciated. Thanks. -Moa |
I guess i posted a little bit early. top -b -n 1 works to get output. Any suggestions how i add up the total in the CPU line ( in perl ).
Thanks again, Moa |
To make things a little bit more clear. This is my Script to send the trap after it checks the hda %. I imagine it only needs to be altered just a little bit to get this to work. I just need to add up the %CPU usage column then send if it's above a certain %....
Code:
#!/usr/bin/perl |
All times are GMT -5. The time now is 04:10 AM. |