<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">How would I capture with Wireshark when it seemingly happens at random?  Whenever I test, everything appears to work normally.  I wish I could somehow replicate it.  Maybe I need to test manually and see if it’ll happen in front of me; I’ve never actually seen it happen… always happens when I’m away.</div>
</div>
<div name="messageSignatureSection"><br />
<p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue"; color: rgb(34, 34, 34);">--</p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue"; color: rgb(51, 51, 51);"><span style="color: #222222"><b>Todd Benivegna</b></span> <span style="color: #222222">//</span> <a href="mailto:todd@benivegna.com">todd@benivegna.com</a></p>
</div>
<div name="messageReplySection">On Aug 2, 2020, 12:12 PM -0400, Manuel Wolfshant <wolfy@nobugconsulting.ro>, wrote:<br />
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">
<div class="moz-cite-prefix">On 8/1/20 11:25 PM, Todd Benivegna wrote:<br /></div>
<blockquote type="cite" cite="mid:74f3f9aa-f5f0-4ac5-89aa-367d5bd733e9@Spark">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<div name="messageBodySection">
<div dir="auto">I'm hoping that someone can shed some light on this… I have a Synology NAS (DS416) that has a feature where you can enable a “Network UPS Server” which is a NUT server.  I have been trying to get the Synology to shut down three Ubuntu 20.04 servers that I have. While it does work when I test it out manually, sometimes when I am away and the power goes out briefly, the servers shut down when the power has been out for like five seconds (or less sometimes).  When I come home and turn on the servers, they boot up but then immediately shut down again.  This happens until I restart the Synology; then they will boot up and stay up.  I‘d like them to stay up a little longer than that.  Ideally, I’d like them to stay up until battery is low, then shut down, then all come back on when power is restored. <br />
<br />
This is what I have done so far:  I have enabled "Enable Network UPS server" on the Synology and have installed NUT on each of my servers running Ubuntu 20.04.  I have added the appropriate IPs to the Permitted DiskStation Devices” list.  I have also tried setting it on the Synology to shut down when battery is low and after a specified amount of time (20 minutes).  Either way, the servers will shut down after like 5 seconds or less.  I have edited upsmon.conf and added my MONITOR line and setup systemctl so that the nut-client service starts automatically at boot.  I have no made any other changes to the file; the rest is still set to defaults.<br />
<br />
So I'm not sure where exactly the problem is; if it's the Synology or NUT on Ubuntu.  Strange thing is, when I manually test by shutting off the power briefly (or for a few seconds, or a few minutes - I've tried everything;) every time I do a test, everything works perfect and they will shut down when they are supposed to.  Seems to only happen when there is a passing storm that knocks the power out for a few seconds.<br />
<br />
Also, this is what I found in the syslog on one of the machines:<br />
Jul 31 18:33:29 plex upsmon[970]: UPS <a class="moz-txt-link-abbreviated" href="mailto:ups@192.168.1.70">ups@192.168.1.70</a> on battery<br />
Jul 31 18:33:34 plex upsmon[970]: UPS <a class="moz-txt-link-abbreviated" href="mailto:ups@192.168.1.70">ups@192.168.1.70</a> on line power<br />
Jul 31 18:34:04 plex upsmon[970]: Executing automatic power-fail shutdown<br />
Jul 31 18:34:04 plex upsmon[970]: Auto logout and shutdown proceeding<br />
Jul 31 18:34:09 plex systemd[1]: nut-monitor.service: Succeeded.<br />
<br />
If I’m not mistaken, it is shutting down after power came back on line….?<br /></div>
</div>
</blockquote>
<p>My first suspect is the Synology version of nut. More specifically, I suspect that nut triggers a shutdown immediately after the switch to "on battery" state and only cancels it after a restart.</p>
<p>What I would do is to use wireshark to sniff the communication between the Synology and one of the Ubuntu machines and log what exactly ( and when ) is sent by the nut server to the clients. I'd also couple that with <a moz-do-not-send="true" href="https://networkupstools.org/docs/man/upslog.html">a bit of logging on the nut side</a> as well ( for 60 secs or so, starting shortly before the switch to on-battery, with a very short interval between polls )<br /></p>
_______________________________________________<br />
Nut-upsuser mailing list<br />
Nut-upsuser@alioth-lists.debian.net<br />
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser<br /></blockquote>
</div>
</body>
</html>