Yevgeniy Kuksenko
2016-Sep-17 00:07 UTC
[Nut-upsuser] NUT unable to resolve host despite DNS working.
Hello all, I have been having a problem with upsmon on Fedora 24 on boot. NUT is configured as a netclient to a Raspbian NUT server. After boot up upsmon repeatedly says "connect failed: No such host". It is not able to connect at all until the service is bounced. This seems to indicate a name resolution problem but shouldn't this auto correct once name resolution is working properly regardless? upsmon on the Raspbian NUT server works fine and is attached to localhost:3493. I have tried tweaking the systemd file to require upsmon to come up after network-online.target. This doesn't help. After boot I am always able to resolve the name from the client correctly but upsmon continues to fail with no such host. If I use an ip instead of a DNS name this config works correctly on boot. *Detailed Info*: *Client OS*: Fedora 24 *Client NUT*: Network UPS Tools upsmon 2.7.4 *Install method*: OS package *Server OS: *Raspbian 8 *Server NUT*: Network UPS Tools upsd 2.7.2 *Install Method*: OS Package *Problem:* *# systemctl status nut-monitor.service* *----------------------------------------------* ? nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller Loaded: loaded (/usr/lib/systemd/system/nut-monitor.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2016-09-16 18:44:05 CDT; 7min ago Process: 822 ExecStartPre=/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf (code=exited, status=0/SUCCESS) Main PID: 831 (upsmon) Tasks: 2 (limit: 512) CGroup: /system.slice/nut-monitor.service ??831 /usr/sbin/upsmon -F -DD ??902 /usr/sbin/upsmon -F -DD Sep 16 18:51:35 client upsmon[831]: 450.063107 Trying to connect to UPS [ups01 at ups.server.lan:3493] Sep 16 18:51:35 client upsmon[831]: 450.063321 UPS [ups01 at ups.server.lan:3493]: connect failed: No such host Sep 16 18:51:40 client upsmon[831]: 455.063402 Trying to connect to UPS [ups01 at ups.server.lan:3493] Sep 16 18:51:40 client upsmon[831]: 455.063587 UPS [ups01 at ups.server.lan:3493]: connect failed: No such host Sep 16 18:51:45 client upsmon[831]: 460.063664 Trying to connect to UPS [ups01 at ups.server.lan:3493] Sep 16 18:51:45 client upsmon[831]: 460.063862 UPS [ups01 at ups.server.lan:3493]: connect failed: No such host Sep 16 18:51:50 client upsmon[831]: 465.063943 Trying to connect to UPS [ups01 at ups.server.lan:3493] Sep 16 18:51:50 client upsmon[831]: 465.064204 UPS [ups01 at ups.server.lan:3493]: connect failed: No such host Sep 16 18:51:55 client upsmon[831]: 470.064287 Trying to connect to UPS [ups01 at ups.server.lan:3493] Sep 16 18:51:55 client upsmon[831]: 470.064471 UPS [ups01 at ups.server.lan:3493]: connect failed: No such host *----------------------------------------------* *nut.conf:* *----------------------------------------------* UPSMON_OPTIONS="" MODE=netclient UPSD_OPTIONS="" *----------------------------------------------* *upsmon.conf* *----------------------------------------------* RBWARNTIME 43200 MONITOR ups01 at ups.server.lan:3493 1 monitor password slave POLLFREQALERT 5 POWERDOWNFLAG /etc/killpower POLLFREQ 5 DEADTIME 15 MINSUPPLIES 1 FINALDELAY 5 NOCOMMWARNTIME 300 HOSTSYNC 15 SHUTDOWNCMD "/sbin/shutdown -h +0" RUN_AS_USER nut *----------------------------------------------* After two days of searching I turn to this mailing list. Any suggestions would be appreciated. I wrote an ansible role to replicate this setup. It should be available on github shortly at https://github.com/ykuksenko/ansible.nut if that helps. Thank you, Yevgeniy. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20160917/3d48a845/attachment-0001.html>
Roger Price
2016-Sep-17 12:20 UTC
[Nut-upsuser] NUT unable to resolve host despite DNS working.
On Sat, 17 Sep 2016, Yevgeniy Kuksenko wrote:> Hello all, I have been having a problem with upsmon on Fedora 24 on boot. NUT is configured as a netclient to a Raspbian NUT server. After boot up upsmon > repeatedly says "connect failed: No such host". It is not able to connect at all until the service is bounced. This seems to indicate a name resolution > problem but shouldn't this auto correct once name resolution is working properly regardless? upsmon on the Raspbian NUT server works fine and is attached > to localhost:3493. > > If I use an ip instead of a DNS name this config works correctly on boot.Do commands on the client such as: echo "GET VAR ups01 battery.charge" | netcat ups.server.lan 3493 echo "GET VAR ups01 battery.charge" | netcat 11.22.33.44 3493 reproduce the problem? If so, the problem may be with the DNS rather than NUT. What does command dig ups.server.lan on the client report? Roger
Yevgeniy Kuksenko
2016-Sep-18 03:12 UTC
[Nut-upsuser] NUT unable to resolve host despite DNS working.
I don't have netcat available under that name. I do have nc however. Below is the output. I did some additional testing too. Fedora 23 works fine with the same config. There was talk about making some DNS changes to Fedora 24 but from what I could tell this has not been enabled at least for the server spins. The odd part is that DNS works fine after boot and NUT is the only service that seems to get stuck unable to resolve names. I also tried adding an entry to /etc/hosts after the system boots and NUT fails. The moment that is done NUT is able to resolve the name and connects correctly. I don't have to touch the nut-monitor service in any way for this. Any way here is the output: $ echo "GET VAR ups01 battery.charge" | nc ups.server.lan 3493 VAR ups01 battery.charge "100" $ echo "GET VAR ups01 battery.charge" | nc 11.22.33.44 3493 VAR ups01 battery.charge "100" $ upsc ups01.server.lan #brings complete UPS output. $ dig ups.server.lan ; <<>> DiG 9.10.4-P2-RedHat-9.10.4-1.P2.fc24 <<>> ups.server.lan ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 395 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;ups.server.lan. IN A ;; ANSWER SECTION: ups.server.lan. 3600 IN A 11.22.33.44 ;; Query time: 0 msec ;; SERVER: 11.22.33.45#53(11.22.33.45) ;; WHEN: Sat Sep 17 15:19:32 CDT 2016 ;; MSG SIZE rcvd: 60 I will do some more digging in Fedora 24 to see if I can find anything. I am not completely sure if this is a NUT issue at this point but I don't understand why it can't resolve names after DNS becomes properly available. Any additional suggestions are welcome. Thank you again. On Sat, Sep 17, 2016 at 7:20 AM Roger Price <roger at rogerprice.org> wrote:> On Sat, 17 Sep 2016, Yevgeniy Kuksenko wrote: > > > Hello all, I have been having a problem with upsmon on Fedora 24 on > boot. NUT is configured as a netclient to a Raspbian NUT server. After boot > up upsmon > > repeatedly says "connect failed: No such host". It is not able to > connect at all until the service is bounced. This seems to indicate a name > resolution > > problem but shouldn't this auto correct once name resolution is working > properly regardless? upsmon on the Raspbian NUT server works fine and is > attached > > to localhost:3493. > > > > If I use an ip instead of a DNS name this config works correctly on boot. > > Do commands on the client such as: > > echo "GET VAR ups01 battery.charge" | netcat ups.server.lan 3493 > echo "GET VAR ups01 battery.charge" | netcat 11.22.33.44 3493 > > reproduce the problem? If so, the problem may be with the DNS rather than > NUT. What does command dig ups.server.lan on the client report? > > Roger > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20160918/40eb58fb/attachment.html>