Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
End.

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
add comment

2 Answers

Install and configure "sysstat"

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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