I use the NUT RPM package for CentOS 6.7, which is version 2.6.5-2.

I am testing implementation of NUT features with APC and Tripp-Lite USB UPS 
interfaces.  Things are going reasonably well.  However, I'm seeing many more 
messages than I would like in /var/log/messages when I boot the system without 
the UPS connected (testing a failure scenario).  I have configured 
NOCOMMWARNTIME 3600, which takes care to only broadcast to logged in terminals 
and send me emails once an hour.  However, /var/log/messages is being filled 
with "upsmon[2391]: Poll UPS [tripplite@localhost] failed - Driver not 
connected" messages every five seconds.  I cannot seem to find a way to reduce 
that chatter.

I found the "Driver not connected" condition can refer to either the TCP 
connection down between the client and the server (fd < 0), or between the 
server and the device driver or the device driver and the UPS (commstate <> 1). 
 The attached patch to pullups() in clients/upsmon.c suppresses the messages 
sent to /var/log/messages every five seconds when commstate <> 1, since 
DRVNOTCONN is actually expected in that case.

There is another place in try_connect() in clients/upsmon.c that causes 
messages to be written to /var/log/message every five seconds when a TCP 
connection cannot be made from the client to the server.  (I test this failure 
scenario by killing the server upsd.)  I changed that to a debugging message 
(matching the debugging message earlier in try_connect() logging the attempt), 
since the normal message stream and email notifications will still occur.

The chatter from upsmon writing to /var/log/messages every five seconds 
clutters the system log file so much it is hard to deal with.  Especially, as 
in our case, remotely over very slow Internet connections.  With these two 
changes, /var/log/messages contains a message, and an email is sent, when the 
error condition first occurs and thereafter every NOCOMMWARNTIME seconds.  This 
is as I expect, and desire.

Please consider these changes.

Larry Baker
US Geological Survey
650-329-5608
[email protected]


Attachment: nut-2.6.5-upsmon.patch
Description: Binary data

_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev

Reply via email to