[Nut-upsuser] Loosing comms with UPS

Alain Williams addw at phcomp.co.uk
Wed Jul 18 22:05:25 UTC 2007


On Wed, Jul 18, 2007 at 06:09:09PM +0200, FORMER 03 | Baltasar Cevc wrote:
> Hi Alain,
> 
> >In my system log file I get messages like:
> >
> >	Jul 18 13:05:12 mint upsd[4025]: Host 192.168.145.12 disconnected  
> >(read failure)
> >	Jul 18 13:10:12 mint last message repeated 5 times
> >	Jul 18 13:10:12 mint last message repeated 4 times
> >
> >
> >and broadcast messages like:
> >	Communications with UPS mintups at mint.phcomp.co.uk lost
> >30 seconds later:
> >	Communications with UPS mintups at mint.phcomp.co.uk established
> 
> 
> 
> Probably you UPS is answering too slowly; try increasing the timeouts.
> See http://opensource.mgeups.com/ups.htm for details - it's a  
> different supplier, but I assume it should be the same procedure. The  
> lines you're interested in are at the bottom of the page.
> 
> Hope that helps,
> Baltasar

No it didn't - but thanks.

I ran strace on the upsd process and what I get is below.
It appears that upsd gets a connection (from somewhere), reads a GET VAR,
writes a VAR reply, read EOF - and so generate the 'read failure'.
There is a whole bunch of these, but before and after there are
similar GET VAR reads, VAR writes on file descriptor 6 that behave
normally - ie the select() just sits there until another GET VAR message
comes in.

This is the only UPS, there is only one MONITOR line in upsmon.conf.
I am running nut-2.3.0-r1014.

The only UPS programs running are:

	[root at mint share]# ps -ef |grep ups
	ups      15577     1  0 20:39 ?        00:00:00 //bin/usbhid-ups -a mintups
	ups      15581     1  0 20:39 ?        00:00:00 upsd -u ups
	root     15777     1  0 20:45 ?        00:00:00 upsmon -u ups
	ups      15778 15777  0 20:45 ?        00:00:00 upsmon -u ups


select(7, [4 5 6], NULL, NULL, {2, 0})  = 1 (in [4], left {1, 999000})
accept(4, {sa_family=AF_INET, sin_port=htons(36199), sin_addr=inet_addr("192.168.145.12")}, [16]) = 7
time(NULL)                              = 1184794804
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
send(3, "<31>Jul 18 22:40:04 upsd[15581]: Connection from 192.168.145.12", 63, MSG_NOSIGNAL) = 63
time(NULL)                              = 1184794804
select(8, [4 5 6 7], NULL, NULL, {2, 0}) = 1 (in [7], left {2, 0})
read(7, "GET VAR mintups ups.load\n", 512) = 25
write(7, "VAR mintups ups.load \"25\"\n", 26) = 26
time(NULL)                              = 1184794804
select(8, [4 5 6 7], NULL, NULL, {2, 0}) = 1 (in [7], left {2, 0})
read(7, "", 512)                        = 0
time(NULL)                              = 1184794804
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
send(3, "<30>Jul 18 22:40:04 upsd[15581]: Host 192.168.145.12 disconnected (read failure)", 80, MSG_NOSIGNAL) = 80
shutdown(7, 2 /* send and receive */)   = 0
close(7)                                = 0
time(NULL)                              = 1184794804
select(7, [4 5 6], NULL, NULL, {2, 0})  = 1 (in [4], left {1, 999000})
accept(4, {sa_family=AF_INET, sin_port=htons(36200), sin_addr=inet_addr("192.168.145.12")}, [16]) = 7
time(NULL)                              = 1184794804
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
send(3, "<31>Jul 18 22:40:04 upsd[15581]: Connection from 192.168.145.12", 63, MSG_NOSIGNAL) = 63
time(NULL)                              = 1184794804
select(8, [4 5 6 7], NULL, NULL, {2, 0}) = 1 (in [7], left {2, 0})
read(7, "GET VAR mintups ups.temperature\n", 512) = 32
write(7, "ERR VAR-NOT-SUPPORTED\n", 22) = 22
time(NULL)                              = 1184794804
select(8, [4 5 6 7], NULL, NULL, {2, 0}) = 1 (in [7], left {2, 0})
read(7, "", 512)                        = 0
time(NULL)                              = 1184794804
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
send(3, "<30>Jul 18 22:40:04 upsd[15581]: Host 192.168.145.12 disconnected (read failure)", 80, MSG_NOSIGNAL) = 80
shutdown(7, 2 /* send and receive */)   = 0
close(7)                                = 0
time(NULL)                              = 1184794804


-- 
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>



More information about the Nut-upsuser mailing list