Thanks for your help! In red below. Cheers simone On Thu, Jun 4, 2015 at 2:45 PM, Charles Lepple <clepple at gmail.com> wrote:> On Jun 3, 2015, at 11:45 AM, Simone Severini <severini.simone at gmail.com> > wrote: > > Hi everybody! > It has been a journey but I almost manage to make my UPS properly > communicate. > > This is the config: > > UPS Mecer/Mustek 2000 VA connected via USB with blazer_usb driver. > MASTER Raspberry PI-1 > SLAVE Raspberry PI-2 > SLAVE iMac OSX 10.10.3 > > I can get access to the UPS from any of the three devices successfully. > > Problems: > 1. When I launch /usr/local/ups/sbin/upsmon -c fed for testing I see > Rasp-2 Slave going down, Rasp-1 going down, iMac completely ignoring and > not receiving any broadcast message on the terminal then brutally killed as > the UPS auto shutdown. > > > If you search for 'upsmon' in /var/log/system.log on the iMac, does it > appear to be logged in to upsd on the master? > > Jun 4 16:34:23 Simone.Home upsmon[1081]: writepid: fopen > /opt/local/var/run/upsmon.pid: Permission denied > > Jun 4 16:34:24 Simone.Home upsmon[1081]: Login on UPS [ > ME-2000 at 192.168.1.69] failed - got [ERR ACCESS-DENIED] >So there is one problem. How can I change permission on upsilon.pid. The access denied is it due to wrong username/password?> My Mac has a local UPS, so I haven't looked into whether upsmon properly > reconnects after sleep. > > 2. When I have done a live test, the Master Rasp never intercepted any > FLAG from UPS and UPS just died but halting just RASP-1 properly (connected > via cable). iMac ignored the whole procedure. > > > You didn't mention which version of NUT you are using, but for recent > versions, both the blazer_usb and nutdrv_qx drivers can be configured to > generate their own LB signal based on runtime or percent charge. See the > documentation for 'ignorelb' in ups.conf. > > Thanks. I'm running Network UPS Tools upsmon 2.6.5-Unversioned directory> 3. Is there any way to intercept which type of flag message my UPS sends > (log files) to upsmon? > > > If you run upsmon with '-DDD', it will log changes to stderr. Another '-D' > should log each poll cycle regardless of whether status has changed. > > Another option is to run upslog to see the rate of discharge when the UPS > is on battery. If the charge is falling faster than you expect, the battery > may be dead, or the UPS may need to be recalibrated. This may help with the > previous question. > Thanks for the hint > > 4. I need to halt manually a linux based NAS via SSH. What is the best way > (upsched or a script that parses battery.charge and takes decision > independently from NUT). > > > It depends what you want the trigger to be. You can use upssched to power > down after a certain amount of time on battery, or when the low battery > flag is sent. Either way, you will probably need to ensure that the UPS > shuts off its outlets momentarily after the NAS has received the shutdown > signal, especially when the power comes back before the UPS battery is > depleted. >Got it> > -- > Charles Lepple > clepple at gmail > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150604/8057e5f1/attachment.html>
On Jun 4, 2015, at 10:41 AM, Simone Severini <severini.simone at gmail.com> wrote:> Thanks for your help! > In red below. > Cheers > simone > > > > On Thu, Jun 4, 2015 at 2:45 PM, Charles Lepple <clepple at gmail.com> wrote: > On Jun 3, 2015, at 11:45 AM, Simone Severini <severini.simone at gmail.com> wrote: > >> Hi everybody! >> It has been a journey but I almost manage to make my UPS properly communicate. >> >> This is the config: >> >> UPS Mecer/Mustek 2000 VA connected via USB with blazer_usb driver. >> MASTER Raspberry PI-1 >> SLAVE Raspberry PI-2 >> SLAVE iMac OSX 10.10.3 >> >> I can get access to the UPS from any of the three devices successfully. >> >> Problems: >> 1. When I launch /usr/local/ups/sbin/upsmon -c fed for testing I see Rasp-2 Slave going down, Rasp-1 going down, iMac completely ignoring and not receiving any broadcast message on the terminal then brutally killed as the UPS auto shutdown. > > > If you search for 'upsmon' in /var/log/system.log on the iMac, does it appear to be logged in to upsd on the master? > Jun 4 16:34:23 Simone.Home upsmon[1081]: writepid: fopen /opt/local/var/run/upsmon.pid: Permission denied > Jun 4 16:34:24 Simone.Home upsmon[1081]: Login on UPS [ME-2000 at 192.168.1.69] failed - got [ERR ACCESS-DENIED] > > So there is one problem. How can I change permission on upsilon.pid.The driver writes the PID file when it starts, and it drops privileges to a system username specified at ./configure time. So you would need to allow that user to write to /opt/local/var/run/ (or better yet, a NUT-specific subdirectory like /opt/local/var/run/nut).> The access denied is it due to wrong username/password?Yes. Bear in mind that these are NUT users defined in etc/upsd.users, not system usernames.> My Mac has a local UPS, so I haven't looked into whether upsmon properly reconnects after sleep. > >> 2. When I have done a live test, the Master Rasp never intercepted any FLAG from UPS and UPS just died but halting just RASP-1 properly (connected via cable). iMac ignored the whole procedure. > > You didn't mention which version of NUT you are using, but for recent versions, both the blazer_usb and nutdrv_qx drivers can be configured to generate their own LB signal based on runtime or percent charge. See the documentation for 'ignorelb' in ups.conf. > > Thanks. I'm running Network UPS Tools upsmon 2.6.5-Unversioned directoryFrom MacPorts? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150604/fa7e5d22/attachment-0001.html>
Thanks, yes from macports. Sent from my iPhone> On 05 Jun 2015, at 04:21, Charles Lepple <clepple at gmail.com> wrote: > > >> On Jun 4, 2015, at 10:41 AM, Simone Severini <severini.simone at gmail.com> wrote: >> >> Thanks for your help! >> In red below. >> Cheers >> simone >> >> >> >>> On Thu, Jun 4, 2015 at 2:45 PM, Charles Lepple <clepple at gmail.com> wrote: >>>> On Jun 3, 2015, at 11:45 AM, Simone Severini <severini.simone at gmail.com> wrote: >>>> >>>> Hi everybody! >>>> It has been a journey but I almost manage to make my UPS properly communicate. >>>> >>>> This is the config: >>>> >>>> UPS Mecer/Mustek 2000 VA connected via USB with blazer_usb driver. >>>> MASTER Raspberry PI-1 >>>> SLAVE Raspberry PI-2 >>>> SLAVE iMac OSX 10.10.3 >>>> >>>> I can get access to the UPS from any of the three devices successfully. >>>> >>>> Problems: >>>> 1. When I launch /usr/local/ups/sbin/upsmon -c fed for testing I see Rasp-2 Slave going down, Rasp-1 going down, iMac completely ignoring and not receiving any broadcast message on the terminal then brutally killed as the UPS auto shutdown. >>> >>> >>> If you search for 'upsmon' in /var/log/system.log on the iMac, does it appear to be logged in to upsd on the master? >>> Jun 4 16:34:23 Simone.Home upsmon[1081]: writepid: fopen /opt/local/var/run/upsmon.pid: Permission denied >>> Jun 4 16:34:24 Simone.Home upsmon[1081]: Login on UPS [ME-2000 at 192.168.1.69] failed - got [ERR ACCESS-DENIED] >> >> So there is one problem. How can I change permission on upsilon.pid. > > The driver writes the PID file when it starts, and it drops privileges to a system username specified at ./configure time. So you would need to allow that user to write to /opt/local/var/run/ (or better yet, a NUT-specific subdirectory like /opt/local/var/run/nut). > >> The access denied is it due to wrong username/password? > > Yes. Bear in mind that these are NUT users defined in etc/upsd.users, not system usernames. > >>> My Mac has a local UPS, so I haven't looked into whether upsmon properly reconnects after sleep. >>> >>>> 2. When I have done a live test, the Master Rasp never intercepted any FLAG from UPS and UPS just died but halting just RASP-1 properly (connected via cable). iMac ignored the whole procedure. >>> >>> You didn't mention which version of NUT you are using, but for recent versions, both the blazer_usb and nutdrv_qx drivers can be configured to generate their own LB signal based on runtime or percent charge. See the documentation for 'ignorelb' in ups.conf. >> Thanks. I'm running Network UPS Tools upsmon 2.6.5-Unversioned directory > > From MacPorts? > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150605/a544a2b1/attachment.html>