Koozali.org: home of the SME Server

How to delay NUT email notifications

Offline bhamail

  • ***
  • 46
  • +0/-0
How to delay NUT email notifications
« on: July 20, 2007, 04:36:13 AM »
I'm running 7.1u3 and the NUT ups features are very nice.

One problem is I'm getting a ton of email pairs with:

UPS@localhost: ONBATT
UPS@localhost: ONLINE

in very short succession (seconds apart). I don't know if my ups is toast, or if it's just a really flaky power signal. In any case, I'd like to make NUT wait a few seconds before sending out these emails to see if the ONBATT state quickly turns back into ONLINE, and if it does, to just not send the emails.

I poked around in the NUT docs, but if someone has already done this sort of thing, could you share?

Has anyone else seen this behavior with APC usb UPS's? (It's an older model).

Thanks,
Dan

Offline rdtaylor

  • **
  • 26
  • +0/-0
How to delay NUT email notifications
« Reply #1 on: July 23, 2007, 11:16:16 PM »
I have the same issue with an APC SmartUPS SC420 via RS-232.

It happens about once per week. Hasn't really bothered me so far.

I assumed that it was a small brownout that only lasts long enough to trip the UPS into battery mode...

rscott

How to delay NUT email notifications
« Reply #2 on: July 24, 2007, 02:59:56 PM »
This might be the UPS carrying out a self test - some of our APC units do it as well.

Offline bhamail

  • ***
  • 46
  • +0/-0
How to delay NUT email notifications
« Reply #3 on: July 25, 2007, 04:16:00 AM »
In my case, often it happens a few time in a row:
onbatt
online
onbatt
online

I've been near the ups when some of these events occurred, and there was no outward sign of a real battery switch over (ie: no beeping and no change in indicator lights on the ups and no flickering of lights in the room).

I'm also seeing occasional communication problem warnings (combad), that also immediately clear up.

I saw some info about settings to configure delays, but now I can't find that info, nor do I know which part of NUT to configure (monitor, scheduler, etc).

Dan

Offline ldkeen

  • *
  • 405
  • +0/-0
How to delay NUT email notifications
« Reply #4 on: July 25, 2007, 11:24:06 PM »
Quote from: "bhamail"
I'd like to make NUT wait a few seconds before sending out these emails to see if the ONBATT state quickly turns back into ONLINE

You'd probably have to write your own code to have nut do this.
To disable email notifications for those events completely:
In the file /etc/ups/upsmon.conf change the following:
Code: [Select]
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC

to read
Code: [Select]
NOTIFYFLAG ONBATT   SYSLOG+WALL
NOTIFYFLAG ONLINE   SYSLOG+WALL


If you want the changes to stick you'll have to template it.

Regards, Lloyd