0

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.

2 Answers2

2

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.

chmeee
  • 7,370
  • 3
  • 30
  • 43
1

Install and configure "sysstat"

Natmaka
  • 65
  • 5