Results 1 to 2 of 2
Hi,
Here is a simple shell script to check total CPU and Memory consumption by Linux Servers.
#!/bin/bash
echo "`date +"%D %T"` `ps aux | awk '{sum +=$3}; END {print ...
- 07-11-2011 #1Just Joined!
- Join Date
- Jul 2011
- Posts
- 0
Shell script to check total CPU and Memory consumption
Hi,
Here is a simple shell script to check total CPU and Memory consumption by Linux Servers.
#!/bin/bash
echo "`date +"%D %T"` `ps aux | awk '{sum +=$3}; END {print sum}'`" >> /tmp/cpu_`date +"%I%d%Y"`
echo "`date +"%D %T"` `ps aux | awk '{sum1 +=$4}; END {print sum1}'`" >> /tmp/mem_`date +"%I%d%Y"`
Script proves very handy when we need to check the CPU or Memory peak values. Just run it in cron for 1 min interval and you will start getting the values in text files from where you can figure out the peak values at a given point of time.
Thanks,
Team nixSupport
- 07-11-2011 #2
No offence, but why not go for a more complete monitoring solution like xymon, nagios, etc?
You must always face the curtain with a bow.


Reply With Quote
