Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm spending a lot of time manually reporting basic Linux system stats that I get from either Cacti monitoring tool and/or Top and ps command. I'm essentially writing a report in following format:

Host: <name value>

CPU Util: <value> (if Idle % is 100 - 60% print "Good" ; if Idle % is 60 - 30% print "Fair"; if Idle % is 30 - 0% print "Bad")

Memory Util: <value> (if Free Mem % is 100 - 60% print "Good" ; if Free Mem % is 60 - 30% print "Fair"; if Free Mem % is 30 - 0% print "Bad")

Up since: (check date PID was started;  calculate number of days/hours PID has been runninig; print value)

   Email Frequency: Select (every 60 mins | every 24 hours )
   Format HTML 
   Send email to recipients

I'm pretty sure this could be done in Shell scripting and Cron job, not sure if it would be easier as a Perl script. Either way I'm open to learning the most efficient and simplest solution for the above admin task.

share|improve this question
What's the purpose of the report that can't be achieved in Cacti? – Dan Carley Jul 1 '09 at 20:06

You could use atsar to get periodic statistics about the utilization of CPUs, disks and disk partitions, memory and swap, tty's, TCP/IP (v4/v6), NFS, and FTP/HTTP traffic are gathered.

This is a Linux version of the 'sar' command found in Solaris and other Unices.

share|improve this answer

Install and configure "sysstat"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.