Question on Bash Shell Script for Load Performance Monitoring
From: aixenv (aixenv_at_yahoo.com)
Date: 10/24/04
- Next message: Chaz Kiser: "Lack of 'lsmod'"
- Previous message: Tommy Reynolds: "Re: Selling LinuxCBT Redhat edition training cource .It is 75 hours/375 Videos on 10Cds training solution for you."
- Next in thread: Chris: "Re: Question on Bash Shell Script for Load Performance Monitoring"
- Reply: Chris: "Re: Question on Bash Shell Script for Load Performance Monitoring"
- Reply: Paul Lutus: "Re: Question on Bash Shell Script for Load Performance Monitoring"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Oct 2004 07:47:39 -0700
I am writing a script to monitor a server which has halted at a
strange hour with no visible reason, I have reason to suspect it could
be a runaway qmail process or the system is just getting under heavy
load, or both.
SO I wrote the following script, it works, it just seems very
"sloppy", and I was just curious how else I could accomplish the same
goal.
Also i thought of emailing the output of /tmp/srvload.log to an email
address and thought it might be nice to sort newest entries in
/tmp/srvload.log to the beginning of the file versus appending them to
the end of the file. however i am unclear how to proceed and
accomplish this goal
any assistance would be appreciated, below is said script.
#!/bin/bash
while
true
do
echo "" >> /tmp/srvload.log
echo "#############################" >> /tmp/srvload.log
echo "" >> /tmp/srvload.log
echo "The current time is `date`" >> /tmp/srvload.log
echo "" >> /tmp/srvload.log
echo "- Current system load average" >> /tmp/srvload.log
uptime >> /tmp/srvload.log
echo "" >> /tmp/srvload.log
echo "- The number of current qmail processes" >> /tmp/srvload.log
ps aux|grep qmail|wc -l >> /tmp/srvload.log
echo "" >> /tmp/srvload.log
echo "- The current number of Messages in the queue">>
/tmp/srvload.log
qmail-qstat >> /tmp/srvload.log
echo "" >> /tmp/srvload.log
echo "#############################" >> /tmp/srvload.log
echo "" >> /tmp/srvload.log
sleep 300
done
The mail script would be like so, perhaps there is a way to combine
both of these into 1 script
#!/bin/bash
while
true
do
echo "`cat /tmp/srvload.log`" | mail -s "Sysload.sh output"
myemail@mydomain.com
sleep 1800
done
thank you
aix
- Next message: Chaz Kiser: "Lack of 'lsmod'"
- Previous message: Tommy Reynolds: "Re: Selling LinuxCBT Redhat edition training cource .It is 75 hours/375 Videos on 10Cds training solution for you."
- Next in thread: Chris: "Re: Question on Bash Shell Script for Load Performance Monitoring"
- Reply: Chris: "Re: Question on Bash Shell Script for Load Performance Monitoring"
- Reply: Paul Lutus: "Re: Question on Bash Shell Script for Load Performance Monitoring"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|