Sep 27, 2011 4:29 AM
Monitoring APC UPS & size of Mailqueue
-
Like (0)
Good morning,
I just switched from GFI to Zenoss monitoring.
But now I've realized that I have two parameters that I can not depict in Zenoss, or perhaps I didn't found it yet.
Perhaps somebody can tell me on how to realize it
For our APC UPS I have the following settings in the GFI monitor:
When connected perform the following query: OID: .1.3.6.1.4.1.318.1.1.1.4.1.1.0
OID Data must be: NOT EQUAL TO 3
If this value is true than run a java script.
----------------------------------------------------------------------------
The second problem is that I need to check the size of the Mailqueue. Therefor I a have this script:
my_qdir=`/usr/sbin/postconf -h queue_directory`
my_active=`find $my_qdir/incoming $my_qdir/active $my_qdir/maildrop -type f -print | wc -l | awk '{print $1}'`
my_deferred=`find $my_qdir/deferred -type f -print | wc -l | awk '{print $1}'`
my_bounced=`find $my_qdir/bounce -type f -print | wc -l | awk '{print $1}'`
my_error="0"
if [[ $my_active -gt 100 ]];
then
echo "FALSE:"
echo "Mailqueue active mails > 100 !!"
echo ACTIVE MSG COUNT: $my_active
my_error="1"
fi
if [[ $my_deferred -gt 100 ]];
then
echo "FALSE:"
echo "Mailqueue deferred mails > 100 !!"
echo ACTIVE MSG COUNT: $my_deferred
my_error="1"
fi
if [[ $my_bounced -gt 100 ]];
then
echo "FALSE:"
echo "Mailqueue bounced mails > 100 !!"
echo ACTIVE MSG COUNT: $my_bounced
my_error="1"
fi
if [[ $my_error -eq 0 ]]; then
echo "TRUE:"
echo ACTIVE MSG COUNT: $my_active
echo DEFERRED MSG COUNT: $my_deferred
echo BOUNCED MSG COUNT: $my_bounced
fi
echo "!!SCRIPT_FINISHED!!"
Can I implement these two checks?
Thanks a lot!!
Hi
For the APC stuff, I would recommend looking at the APC zenpack, since it can save you a lot of time and has a lot of built-in features. You can also add specific extra requirements into the APC performance template and define an event condition for things like on-battery detection (in my configuration I've got the UPS sending me traps for this).
Regarding your postfix/mailqueue stuff, you would want to modify your script slightly so that it outputs in a format which zencommand can read, and then you would want to refer to the zenoss documentation on how to configure a zencommand to run on a remote host. I see there have been some requests for a postfix zenpack before, but a cursory search didn't reveal one constructed yet.
As far as running a command on certain event conditions, you can check the zenoss documentation for "Event Commands".
-J
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||