Archived community.zenoss.org | full text search
Skip navigation
1151 Views 1 Reply Latest reply: Sep 27, 2011 5:15 AM by froztbyte RSS
messias6468 Newbie 1 posts since
Jun 9, 2011
Currently Being Moderated

Sep 27, 2011 4:29 AM

Monitoring APC UPS & size of Mailqueue

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!!

  • froztbyte Newbie 3 posts since
    Feb 23, 2010
    Currently Being Moderated
    1. Sep 27, 2011 5:15 AM (in response to messias6468)
    Re: Monitoring APC UPS & size of Mailqueue

    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

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points