Yury V. Zaytsev
2009-Dec-28 12:54 UTC
[Nut-upsuser] Megatec driver floods logs #2 & mail notifications
Hi there! I'm a n00b NUT user trying to get it running on RHEL5 and actually do something useful for me. Few questions: 1) I want it to notify me by email on power loss and power back events. I can't find any sample scripts for this purpose... Where shall I look for them? 2) So far, I've backported the package from Fedora and got my Ablerex running (previously used with Upsilon / Megatec on a Windows server). The major problem so far is that it keeps flooding my logs just as someone reported last year: http://www.mail-archive.com/nut-upsuser at lists.alioth.debian.org/msg03762.html Is there a way to somehow mute these messages? upsc ablerex at localhost battery.charge: 95.0 battery.voltage: 13.50 battery.voltage.nominal: 12.0 driver.name: megatec driver.parameter.pollinterval: 2 driver.parameter.port: /dev/ttyS0 driver.version: 2.4.1 driver.version.internal: 1.6 input.frequency: 49.0 input.frequency.nominal: 50.0 input.voltage: 232.0 input.voltage.fault: 195.0 input.voltage.maximum: 233.0 input.voltage.minimum: 22.0 input.voltage.nominal: 230.0 output.voltage: 232.0 ups.beeper.status: disabled ups.delay.shutdown: 0 ups.delay.start: 2 ups.load: 17.0 ups.mfr: ------------- ups.model: ------ VS000361 ups.serial: unknown ups.status: OL ups.temperature: 30.0 ups.type: standby Dec 28 13:02:46 calculon megatec[17799]: Communications with UPS lost: No status from UPS. Dec 28 13:02:47 calculon megatec[17799]: Communications with UPS re-established Dec 28 13:05:09 calculon megatec[17799]: Communications with UPS lost: No status from UPS. Dec 28 13:05:09 calculon megatec[17799]: Communications with UPS re-established Thanks! -- Sincerely yours, Yury V. Zaytsev
Justin Piszcz
2009-Dec-28 13:26 UTC
[Nut-upsuser] Megatec driver floods logs #2 & mail notifications
Hi, For no. 1: 1. Edit upsmon.conf 2. Specify NOTIFYCMD: NOTIFYCMD /etc/nut/notify.sh 3. Make sure the script is executable & that it works prior to adding it here. 4. Then just make a simple script: #!/bin/bash DATE=$(/bin/date) HOST=$(/bin/hostname | cut -f1 -d'.') echo "$*" | mailx -s "ups@$HOST POWER ALERT on $DATE" user at addr.com For no. 2: I am not sure, the drivers that I have used do not have that problem with the UPS' in use. Justin. On Mon, 28 Dec 2009, Yury V. Zaytsev wrote:> Hi there! > > I'm a n00b NUT user trying to get it running on RHEL5 and actually do > something useful for me. Few questions: > > 1) I want it to notify me by email on power loss and power back events. > I can't find any sample scripts for this purpose... Where shall I look > for them? > > 2) So far, I've backported the package from Fedora and got my Ablerex > running (previously used with Upsilon / Megatec on a Windows server). > > The major problem so far is that it keeps flooding my logs just as > someone reported last year: > > http://www.mail-archive.com/nut-upsuser at lists.alioth.debian.org/msg03762.html > > Is there a way to somehow mute these messages? > > upsc ablerex at localhost > battery.charge: 95.0 > battery.voltage: 13.50 > battery.voltage.nominal: 12.0 > driver.name: megatec > driver.parameter.pollinterval: 2 > driver.parameter.port: /dev/ttyS0 > driver.version: 2.4.1 > driver.version.internal: 1.6 > input.frequency: 49.0 > input.frequency.nominal: 50.0 > input.voltage: 232.0 > input.voltage.fault: 195.0 > input.voltage.maximum: 233.0 > input.voltage.minimum: 22.0 > input.voltage.nominal: 230.0 > output.voltage: 232.0 > ups.beeper.status: disabled > ups.delay.shutdown: 0 > ups.delay.start: 2 > ups.load: 17.0 > ups.mfr: ------------- > ups.model: ------ VS000361 > ups.serial: unknown > ups.status: OL > ups.temperature: 30.0 > ups.type: standby > > Dec 28 13:02:46 calculon megatec[17799]: Communications with UPS lost: No status from UPS. > Dec 28 13:02:47 calculon megatec[17799]: Communications with UPS re-established > Dec 28 13:05:09 calculon megatec[17799]: Communications with UPS lost: No status from UPS. > Dec 28 13:05:09 calculon megatec[17799]: Communications with UPS re-established > > Thanks! > > -- > Sincerely yours, > Yury V. Zaytsev > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser >
Arjen de Korte
2009-Dec-28 13:29 UTC
[Nut-upsuser] Megatec driver floods logs #2 & mail notifications
Citeren "Yury V. Zaytsev" <yury op shurup.com>:> 1) I want it to notify me by email on power loss and power back events. > I can't find any sample scripts for this purpose... Where shall I look > for them?Use 'upssched' and configure it to send a message through 'mailx' or something like that after the power is lost and when it returns. There are some examples in the manual pages and documentation.> 2) So far, I've backported the package from Fedora and got my Ablerex > running (previously used with Upsilon / Megatec on a Windows server). > > The major problem so far is that it keeps flooding my logs just as > someone reported last year: > > http://www.mail-archive.com/nut-upsuser op lists.alioth.debian.org/msg03762.html > > Is there a way to somehow mute these messages?Try the 'blazer_usb' driver instead, although this might not (completely) solve this problem. It will give us at least far better debugging capabilities, to see where the problem originates. The root cause of this problem is that originally the hardware of your UPS was designed for a serial interface. The USB interface was added later on. This could have been done much better through a true USB to serial converter, but the manufacturer choose to use an awkward (cheap?) implementation that works by querying for input reports only. It will never be a reliable solution, since it lacks all methods of flow control. If the device also has a serial interface, you'll undoubtly get much better results to use an external USB to serial converter (that is supported by the kernel) and use the 'blazer_ser' or 'megatec' drivers instead. Best regards, Arjen -- Please keep list traffic on the list
Yury V. Zaytsev
2009-Dec-29 13:35 UTC
[Nut-upsuser] Megatec driver floods logs #2 & mail notifications
Hi! Please keep the list traffic on the list so that the others can benefit. 1) Be sure that an MTA is installed and working: mail -s "Test" you at mail.com <<EOF Test! EOF 2) Be sure that the script has correct permissions: chmod ugo+x /mnt/data/scripts/ups-notifier 3) Be sure that it actually works: /mnt/data/scripts/ups-notifier lineup /mnt/data/scripts/ups-notifier linedown /mnt/data/scripts/ups-notifier lineup You should get only 2 e-mails! 4) Be sure that your configuration is correct: upsmon.conf: # ZYV NOTIFYCMD /usr/sbin/upssched # ZYV NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC upssched.conf: CMDSCRIPT /mnt/data/scripts/ups-notifier # ZYV PIPEFN /var/run/nut/upssched.pipe LOCKFN /var/run/nut/upssched.lock # ZYV # The timers, here 3 min after the ONBATT (ups on battery) event AT ONBATT * START-TIMER linedown 180 # Cancel the countdown is power is back AT ONLINE * CANCEL-TIMER linedown AT ONLINE * EXECUTE lineup HTH, -- Sincerely yours, Yury V. Zaytsev On Tue, 2009-12-29 at 19:14 +0800, ?????? wrote:> ????! > ?????????? , ????? ????????? ????? ??????? ? upsmon.conf , ????? ??? ?????? ??????????? > ?????? ???? ? ???????- > > NOTIFYCMD /sw/sbin/notifyme > > ? ????? ?????? ? ???????: > ___ > > NOTIFYFLAG ONLINE SYSLOG > NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC > ______ > ? ????????? ?????? ??? ????, ?????? ????????. > > ???????? ??? - ?????????? ????? ( ??????? ups ?? ????) , ?????? ?????? ???????? ???????. ? ??????? ?????????? ????????? > ____ > Broadcast Message from _mdnsresponder at Mihails-Power-Mac-G4.local > (no tty) at 18:48 ULAT... > > UPS SU620INET at localhost:3493 on battery > > > Broadcast Message from _mdnsresponder at Mihails-Power-Mac-G4.local > (no tty) at 18:52 ULAT... > > UPS SU620INET at localhost:3493 on line power > _____ > ?? ?????? ?? ????????. > > ???????. > ?????? > pano.irk at gmail.com > > > > On 29 Dec 2009, at 05:38, Yury V. Zaytsev wrote: > > > On Mon, 2009-12-28 at 22:02 +0100, Arjen de Korte wrote: > > > >> This is trivial to script. Create an empty file somewhere your > >> CMDSCRIPT has write access to when the 'linedown' timer elapses (ie, > >> when you send the warning mail). In your 'lineup' event check for the > >> presence of this file. If it is there, you need to send a message that > >> the power is back and remove the file. You can improve this above, by > >> also checking the age of the file (to prevent triggering on stale > >> files that are accidentally left behind). > > > > Hi! > > > > Thanks for the ideas! Please find my implementation attached. Hopefully > > it will be of use to someone... at least now it's googleable :-) > > > > -- > > Sincerely yours, > > Yury V. Zaytsev > > <ups-notifier>_______________________________________________ > > Nut-upsuser mailing list > > Nut-upsuser at lists.alioth.debian.org > > http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
Arjen de Korte
2009-Dec-29 14:20 UTC
[Nut-upsuser] Megatec driver floods logs #2 & mail notifications
Citeren "Yury V. Zaytsev" <yury op shurup.com>:> Please keep the list traffic on the list so that the others can benefit.But please note that the messages are in English. If it is in Russian, feel free to take it off-list. Best regards, Arjen -- Please keep list traffic on the list