Le 27/04/2010 15:27, Israel Garcia a écrit :
could you share the script with us?
You can put whatever you want in the script. I am monitoring different
parts of the servers.
Extract:
# Identify the server by the last digit of his IP
ip3d=`/sbin/ifconfig| grep Bcast|grep 10.0.0|cut -d":" -f2 | cut -d" "
-f1|cut -d"." -f4`
# Get queue stats from qmail
qmailctl stat|grep queue:|awk -vip=$ip3d '{print "qmail a" ip,$NF}' >
/tmp/qstat$ip3d
# Get active queue stats from postfix
find /var/spool/postfix/active -type f|wc -l|awk -vip=$ip3d '{print
"postfix a" ip,$NF}' >> /tmp/qstat$ip3d
##### Add here whatever number you want to send to the server : cpu,
memory, disk space, ....
# Send the file to the central. You can use shared disk. Some of my
servers are remote, so I use scp.
scp /tmp/qstat$ip3d 10.0.0.252:/tmp/muninqstat
Munin has also very powerful specific scripts, but on large architecture
it creates a huge amount of traffic and load both on nodes and server to
update the database. This way, I also use munin, but I split better the
load and I minimize connexions.
On the server side, with grep and awk extract from all qstatXXX files
the data you want to show for each graph, you can generate with whatever
tool. There I do it with a munin script, it's simple.
Patrick