[Nut-upsuser] Need the date included in nuts -wall msgs.

Gene Heskett gheskett at wdtv.com
Tue Aug 18 17:22:00 UTC 2015


On Tuesday 18 August 2015 09:50:32 Charles Lepple wrote:

> On Aug 18, 2015, at 3:27 AM, Gene Heskett <gheskett at wdtv.com> wrote:
> > Greetings all;
> >
> > Is it possible to set a logging option in one of the config files so
> > that when we have a 1 second power bump, the date is included, both
> > in the log, and in the -wall broadcast?
>
> Hey Gene,
>
> The syslog entry should have one-second resolution in the timestamps,
> and you could use the "EXEC" option in "NOTIFYFLAG" in upsmon.conf to
> call your own script on the ONBATT and ONLINE events (which would
> allow you to pass whatever message you want to "wall").

The syslog does not date that specific event:
==========================================
UPS myups at localhost on battery                                                 
                                                                               
Aug 12 22:56:10 coyote kernel: [432322.384570] usb 1-1.4.1: new high-speed USB device number 14 using ehci_hcd
Aug 12 22:56:10 coyote kernel: [432322.494061] usb 1-1.4.1: New USB device found, idVendor=04f9, idProduct=0053
Aug 12 22:56:10 coyote kernel: [432322.494065] usb 1-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 12 22:56:10 coyote kernel: [432322.494068] usb 1-1.4.1: Product: HL-3170CDW series
Aug 12 22:56:10 coyote kernel: [432322.494071] usb 1-1.4.1: Manufacturer: Brother
Aug 12 22:56:10 coyote kernel: [432322.494073] usb 1-1.4.1: SerialNumber: U63478A3J114945
Aug 12 22:56:10 coyote kernel: [432322.495101] usblp0: USB Bidirectional printer dev 14 if 0 alt 0 proto 2 vid 0x04F9 
pid 0x0053
Aug 12 22:56:10 coyote mtp-probe: checking bus 1, device 
14: "/sys/devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.4/1-1.4.1"
Aug 12 22:56:10 coyote mtp-probe: bus: 1, device: 14 was not an MTP device
                                                                               
Broadcast Message from nut at coyo                                                
        (somewhere) at 22:56 ...                                               
                                                                               
UPS myups at localhost on line power
===========================
But it bumps the printer just long enough to generate the above entries.
And that pops up a bogus advisory that it cannot find the drivers for
it.

I cannot put that printer on the 1500 WA UPS, as its drum heaters
kicking in at the start of a job or at power up, cause the UPS to do an
instant, protective shutdown.  But these bumps are so short the printer
does not forget its turned on, but does trigger a re-init cycle.
>
> However, for a one-second glitch, many of the NUT drivers might miss
> that in their polling cycle. (This usually isn't a problem, since an
> UPS with a good battery should be able power the load for much longer
> than one poll interval.)
>
> This is one of the few cases where a "dumb" contact-closure UPS and a
> dedicated serial port monitor program might be a better fit. Which
> driver(s) are you using?

Its a Belkin, ups.conf:driver=usbhid-ups.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>



More information about the Nut-upsuser mailing list