• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

NUT as slave, Synology as UPS-server, some different error messages

Scheduled Pinned Locked Moved pfSense Packages
15 Posts 3 Posters 17.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    Mr. Jingles
    last edited by Jan 7, 2014, 9:53 AM Jan 7, 2014, 9:38 AM

    G'day all lovers of the finest firewall in the world  ;D

    I am having trouble getting this situation to work. In another thread I asked if apccupsd could do this which appeared not to be possible 'the easy way', but luckily fellow member Gogol replied what worked for him. Of course, it doesn't work for me  :P

    I'll quote first:

    @gogol:

    @Hollander:

    G'day Danilo  ;D

    Could I ask a question? I have an APC-UPS (SmartUPS 1000), which connects to a Synology NAS via a USB-cable which has some (I don't know which one yet, but Synology runs Linux) UPS-server running. So the APC-UPS sends a signal to the Synology when there is a power problem, after which the Synology can shut down itself and the other Synology NAS-ses I have via LAN. Would your package be able to act as a slave towards the Synology also? As in:
    APC-UPS: power problem signal to Synology NAS 1
    –----------> Synology NAS 1 (UPS server monitoring software)
    -------------------------------> signal to other Synologies: shutdown
    -------------------------------> signal to pfSense: shutdown

    If so, what would be the settings in your package to accomplish this? I have been poking around, but to be honest: I have no clue  :-[

    Thank you in advance for your answer  ;D

    Bye,
    [/quote]

    I have done this with the NUT package. The USB cable from my backups ES700 is connected to a Synology NAS and this NAS acts as a server for my Pfsense box.
    Works like a charm:

    • On your NAS check shutdown UPS and enable Network UPS Server

    • In Permitted disk stations enter IP adres of your Pfsense box (Lan IP address in most cases)

    • In the NUT package settings set Remote UPS

    • And Remote NUT ups settings set name to "ups", Remote address to you NAS IP, User "monuser" and Password "secret"

    Thats all there is. But don't forget that with a power failure your network doesn't have power too, so your switch must be connected to the UPS too (that's what I forgot while testing) :D

    So I have told Synology pfSense is allowed as a slave. I created a user 'monuser' in Synology also, made him even admin there so he has sufficient rights, and explicitly added a firewall rule in the Synology to allow access from the UPS.

    In NUT, I entered the settings per the screenshot attached. I tinkered around a little bit with the type of UPS to see if it works, but it doesn't.

    There are multiple problems it appears:

    • There is the 'ERROR: Data Stale!'. I found some threats in this forum about dealing with that by changing config files. I didn't do that yet, since there are more intriguing errors as well:
    /usr/local/libexec/nut/upsdrvctl start
    
    This Belkin device (050d:3201) is not (or perhaps not yet) supported
    by usbhid-ups. Please make sure you have an up-to-date version of NUT. If
    this does not fix the problem, try running the driver with the
    '-x productid=3201' option. Please report your results to the NUT user's
    mailing list <nut-upsuser@lists.alioth.debian.org>.
    
    Network UPS Tools - Generic HID driver 0.37 (2.6.5)
    USB communication driver 0.31
    No matching HID UPS found
    Driver failed to start (exit status=1)
    Network UPS Tools - UPS driver controller 2.6.5</nut-upsuser@lists.alioth.debian.org>
    

    This is weird, since I didn't tell it it was a Belkin, I told it it is an APC Smart-UPS (1000).

    And if gets even stranger:

    /usr/local/etc/rc.d/nut.sh start 
    
    $ /usr/local/etc/rc.d/nut.sh start
    kill: No such process <---- I made this bold, but that appears not allowed within [ code ][ / code ].
    UPS: ups@192.168.2.41 (slave) (power value 1)
    Using power down flag file /etc/killpower
    
    Broadcast Message from root@pfs.workgroup
            (no tty) at 10:52 CET...
    
    Communications with UPS ups@192.168.2.41 lost
    

    So, I am not really sure how to get this working. Would anybody be willing to help me out of my misery ( ;D).

    Thank you in advance,

    Bye,

    ups001.jpg
    ups001.jpg_thumb

    6 and a half billion people know that they are stupid, agressive, lower life forms.

    1 Reply Last reply Reply Quote 0
    • G
      gogol
      last edited by Jan 8, 2014, 12:37 AM

      Did you test your NUT ups settings first with the pfsense box directly connected with a usb cable to the ups?

      You don't need a "monuser" on Synology. This is the default user to login to the NUT server on the synology NAS.

      In the attachments my settings for my UPS:

      Schermafbeelding-2014-01-08-om-8-jan.01.27.54.jpg
      Schermafbeelding-2014-01-08-om-8-jan.01.27.54.jpg_thumb
      Schermafbeelding-2014-01-08-om-8-jan.01.30.22.jpg
      Schermafbeelding-2014-01-08-om-8-jan.01.30.22.jpg_thumb
      Schermafbeelding-2014-01-08-om-8-jan.01.29.06.jpg
      Schermafbeelding-2014-01-08-om-8-jan.01.29.06.jpg_thumb

      1 Reply Last reply Reply Quote 0
      • M
        Mr. Jingles
        last edited by Jan 8, 2014, 1:37 PM

        Thanks very much for your reply, Gogol  ;D

        I tested it connecting directly pfSense <-> SmartUPS. NUT recognizes it. But as soon as I point it to the Synology it just comes back with the ERROR: Data Stale, and the errors mentioned previously. I tried every APC-UPS model in the list in the NUT-GUI, but the error remains the same.

        The Synology in itself works fine; this Syno controls two other Synologies also, UPS-wise, and that just works.

        So I have no clue  :'(

        2014-01-08_142449.jpg
        2014-01-08_142449.jpg_thumb
        2014-01-08_143858.jpg
        2014-01-08_143858.jpg_thumb

        6 and a half billion people know that they are stupid, agressive, lower life forms.

        1 Reply Last reply Reply Quote 0
        • M
          Mr. Jingles
          last edited by Jan 8, 2014, 1:39 PM

          More pics:

          2014-01-08_144021.jpg
          2014-01-08_144021.jpg_thumb
          2014-01-08_144033.jpg
          2014-01-08_144033.jpg_thumb

          6 and a half billion people know that they are stupid, agressive, lower life forms.

          1 Reply Last reply Reply Quote 0
          • G
            gogol
            last edited by Jan 8, 2014, 10:02 PM

            What is in your  system log (upsmon)?

            1 Reply Last reply Reply Quote 0
            • M
              Mr. Jingles
              last edited by Jan 9, 2014, 4:44 AM

              Thank you for your reply, Gogol  ;D

              There are several messages for 'upsmon' in Status/System Logs/General:

              Jan 8 14:32:22 upsmon[75026]: UPS [ups@192.168.2.41]: connect failed: Connection failure: Operation not permitted
              Jan 8 14:32:22 upsmon[74937]: Startup successful
              Jan 8 14:32:22 upsmon[66702]: upsmon parent: read
              Jan 8 14:32:00 upsmon[61573]: upsmon parent: read
              Jan 8 14:32:00 upsmon[61900]: Signal 15: exiting
              Jan 8 14:31:41 upsmon[61900]: UPS ups@192.168.2.41 is unavailable
              Jan 8 14:31:36 upsmon[61900]: Communications with UPS ups@192.168.2.41 lost
              Jan 8 14:31:36 upsmon[61900]: UPS [ups@192.168.2.41]: connect failed: Connection failure: Operation not permitted
              Jan 8 14:31:36 upsmon[61573]: Startup successful
              Jan 8 14:31:33 upsmon[21416]: Signal 15: exiting
              Jan 8 14:30:36 upsmon[21416]: Poll UPS [ups@localhost] failed - Data stale
              Jan 8 14:30:31 upsmon[21416]: Poll UPS [ups@localhost] failed - Data stale
              Jan 8 14:30:26 upsmon[21416]: UPS ups@localhost is unavailable
              Jan 8 14:30:26 upsmon[21416]: Poll UPS [ups@localhost] failed - Data stale
              Jan 8 14:25:31 upsmon[21416]: Communications with UPS ups@localhost lost
              Jan 8 14:25:31 upsmon[21416]: Poll UPS [ups@localhost] failed - Data stale
              Jan 8 14:23:36 upsmon[21393]: Startup successful

              (There were lots of these messages, I removed all the duplicates to make it readable).

              I was looking for the ups conf files, but I am still looking where they are  ;D

              6 and a half billion people know that they are stupid, agressive, lower life forms.

              1 Reply Last reply Reply Quote 0
              • G
                gogol
                last edited by Jan 10, 2014, 7:02 AM

                I have the default settings in Synology NAS for firewall and QOS. Did you made changes there?

                1 Reply Last reply Reply Quote 0
                • M
                  Mr. Jingles
                  last edited by Jan 10, 2014, 4:51 PM

                  @gogol:

                  I have the default settings in Synology NAS for firewall and QOS. Did you made changes there?

                  Thanks  ;D

                  I don't use QOS, and the firewall is disabled in the Synology. It doesn't matter, it doesn't work. But there is something very strange going on:

                  Today I set up Syslog server on the Synology, as I want to see what my switch is doing. I told my switch and pfSense to send the logs there. The switch happily does, but pfSense does not:

                  
                  Jan 10 15:00:16 syslogd: kernel boot file is /boot/kernel/kernel 
                  syslogd: sendto: Operation not permitted 
                  
                  

                  So pfSense NUT can not talk to the Synology, and now syslogd also can't. But the switch can, and so can my desktop-PC's, my HTPC's, my tablet and my smart phone.

                  I have no idea how to debug that  :-[

                  6 and a half billion people know that they are stupid, agressive, lower life forms.

                  1 Reply Last reply Reply Quote 0
                  • P
                    P3R
                    last edited by Jan 10, 2014, 7:14 PM

                    I would start by going through the firewall rules in detail. It sounds as if the Synology is out of the allowed ip address range…

                    1 Reply Last reply Reply Quote 0
                    • G
                      gogol
                      last edited by Jan 10, 2014, 8:25 PM

                      Yes, I would look also to the firewall rules and network settings on the pfsense box. As I have shown it is possible and I have tested it with cutting off the power to the UPS (without removing the plug from the wall socket). I can get "stale data" also, but that is when they don't see each other.

                      1 Reply Last reply Reply Quote 0
                      • M
                        Mr. Jingles
                        last edited by Jan 11, 2014, 2:59 PM

                        @P3R:

                        I would start by going through the firewall rules in detail. It sounds as if the Synology is out of the allowed ip address range…

                        @gogol:

                        Yes, I would look also to the firewall rules and network settings on the pfsense box. As I have shown it is possible and I have tested it with cutting off the power to the UPS (without removing the plug from the wall socket). I can get "stale data" also, but that is when they don't see each other.

                        Thank you to the both of you  ;D

                        Well shoot me if you want to, it works now and I have no clue what I have done (I've had an accident with brain damage and suffer from short term memory problems, this is not a joke, so it is hard for me to remember what I do if I don't write it down immediately). I have been doing a lot of things in different packages, cleaning up firewall rules, and so on. And this morning I tried it again. Not only is NUT now working, but surprisingly pfSense now also is sending syslog messages to the Synology syslog-server  :o

                        So once again thank you very much for helping me  ;D

                        Might I ask one final thing: NUT now shows like the attached screenshot. That isn't too much. But I was more wondering: where do you configure when pfSense needs to shut down when it gets a signal from the UPS-server in the Synology NAS?

                        I mean: in the Synologies I can tell each Synology to shut down x seconds/minutes after the main Synology sends its signal, but I don't see where you configure that in NUT? Or don't you? If not, what does it do then? Shutdown immediately after it receives the signal? Because that isn't necessary; I have power outages from time to time, that last seconds. My APC UPS can handle the machines for over an hour, so pfSense should not shut down in the first second, but only if there isn't power again say after 5 minutes.

                        Thank you again  ;D

                        nut_works.jpg
                        nut_works.jpg_thumb

                        6 and a half billion people know that they are stupid, agressive, lower life forms.

                        1 Reply Last reply Reply Quote 0
                        • G
                          gogol
                          last edited by Jan 11, 2014, 11:01 PM Jan 11, 2014, 10:53 PM

                          You don't have to do anything. Synology NAS sends a system halt command and waits for pfSense to halt and then shutdown itself and stops the UPS and then when the power comes back both machines startup.
                          I have set mine to shutdown after 5 minutes, because in the Netherlands when we have a power failure it lasts for a minimum of 60-90 minutes.

                          1 Reply Last reply Reply Quote 0
                          • P
                            P3R
                            last edited by Jan 11, 2014, 11:50 PM

                            @gogol:

                            Synology NAS sends a system halt command…

                            I agree.

                            …and waits for pfSense to halt...

                            To do what? Would it stay up beyond it's configured shutdown time if the halt signal (what kind of signal is that?) from pfSense never arrives?

                            …and then shutdown itself and stops the UPS...

                            I don't think it could happen in that order but more importantly, is there really a shutdown command available from the monitoring system (in this case the Synology) to shut down the UPS (and then with the UPS starting to supply power again when main power is restored I assume)?

                            I would have expected a normal consumer UPS to signal loss of power to the monitoring system but have no means of shutting down the battery power and also not to be able to power the protected systems back up again? If I'm wrong, please explain how that works.

                            I'm not trying to scare anybody or looking for a fight here, I'm only very interested to understand the details so please enlighten me if I have have misunderstood things.

                            1 Reply Last reply Reply Quote 0
                            • G
                              gogol
                              last edited by Jan 12, 2014, 5:38 PM Jan 12, 2014, 5:35 PM

                              You are probably right about the order of my words or the order of the events  ;)

                              I thought I have read somewhere on Synology forum or article that a Synology NUT server waits for the other Synology client for shutdown ( maybe by pinging or so or not receiving polls at 5 second interval anymore). So I assume pfsense with NUT behaves the same.

                              I did only tested once with my settings and after cutting the power I watched first my pfsense box receiving a halt command after 5 minutes and then the Synology NAS starting to halt and then the UPS switches off. I know the UPS switched off because a monitor connected to the pfsense box and UPS stayed on with the text that the system has halted while the Synology NAS was halting until the UPS and the NAS and switch switched off.

                              I hope it is more clear now. :)

                              1 Reply Last reply Reply Quote 0
                              • M
                                Mr. Jingles
                                last edited by Mar 30, 2014, 12:47 PM

                                G'day all lovers of the finest firewall in the world  ;D

                                Would anybody happen to know what this error means:

                                Poll UPS [ups@192.168.4.37] failed - Write error: Operation not permitted
                                

                                The 4.37 is the Synology that acts as the UPS server. Yesterday I was literally flooded with this (a couple of 100 emails about this), and normally I also get these a couple of times a week.

                                Google didn't help me any further. I am trying to understand who is trying to write what to where and who is messing around with that ( :P). In NUT the light is green, the synology also doesn't complain about anything UPS-related, so I am, at least temporary, once again completely lost.

                                Thank you for any help  ;D

                                6 and a half billion people know that they are stupid, agressive, lower life forms.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                  This community forum collects and processes your personal information.
                                  consent.not_received