<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-03-29 5:49 GMT+02:00 Spike <span dir="ltr"><<a target="_blank" href="mailto:spike@drba.org">spike@drba.org</a>></span>:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr">Hi,</div></blockquote><div> <br></div><div>Hi again Spike ;)<br><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div></div><div>I've been setting up a few Eatons 1500 USB in master/slave mode and run into what I'm thinking is a hostname resolution problem.</div><div><br></div><div>Basically, to avoid hardcoding ips, I'd love to be able to add a LISTEN on the lan's ip which has hostname, let's say, server1.local .</div><div><br></div><div>If I set up upsd.conf such as LISTEN server1.local 3493 what I end up with is upsd listening on 127.0.0.1 . I'm guessing it gets this value from /etc/hosts which overrides server1.local dns resolution.</div></div></blockquote><div> <br></div><div>probably /etc/hosts indeed. <br></div><div>however, server1 should resolve to a non local IP@, so that one should work (need DNS resolution, possibly through DHCP bridging)<br></div><div><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div></div><div>So basically if I want it to listen on anything other than localhost I need to hardcode an ip in upsd.conf or add a line to /etc/hosts, which is not quite convenient if the computer gets its ip from dhcp.</div></div></blockquote><div><br></div><div>no<br>simply add 1 or more LISTEN lines, with the DNS resolvable names (if DHCP served)<br></div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div></div><div>What's more, it seems that upsc does the same thing, so if I have a line such as:</div><div>MONITOR eaton@server1.local ... that will fail if I specified the external ip. However this will succeed from the slave, because there's no server1.local in /etc/hosts I'm guessing so the name resolves to the same ip in the LISTEN.</div></div></blockquote><div><br></div><div>upsd serves the data to the rest of the world, i.e. all NUT clients, including upsc / upsrw / upscmd / upsmon<br></div><div>so the LISTEN line(s) impacts all these....<br></div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div></div><div>Is this really the desired behavior? I can certainly work with it, but it seems it'd be nice if it could work with dns resolution (at least client side, the LISTEN statement I guess it's ok), but maybe I'm missing some good reason why this would cause other issues.</div></div></blockquote></div><br></div><div class="gmail_extra">this is indeed undocumented (will fix it after this mail and a quick lunch), but that works<br><br></div><div class="gmail_extra">LISTEN myhostname.domain1<br></div><div class="gmail_extra"><div class="gmail_extra">LISTEN myhostname.domain2<br></div><br></div><div class="gmail_extra">We once had ACL (ACCEPT / REJECT) to refine the job, but that's really a firewall job ;)<br><br clear="all"></div><div class="gmail_extra">So another approach is to "LISTEN 0.0.0.0" (i.e. everything) and use your firewall to restrict INPUT interfaces.<br clear="all"></div><div class="gmail_extra"><br></div><div class="gmail_extra">Hope it helps,<br></div><div class="gmail_extra">cheers,<br></div><div class="gmail_extra">Arno<br></div><div class="gmail_extra">-- <br><div class="gmail_signature">Eaton Data Center Automation Solutions - Opensource Leader - <a target="_blank" href="http://42ity.org">http://42ity.org</a><br>NUT (Network UPS Tools) Project Leader - <a target="_blank" href="http://www.networkupstools.org">http://www.networkupstools.org</a><br>Debian Developer - <a target="_blank" href="http://www.debian.org">http://www.debian.org</a><br>Free Software Developer - <a target="_blank" href="http://arnaud.quette.fr">http://arnaud.quette.fr</a><br></div>
</div></div>