Navigation

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

    NUT SNMP UPS and Eaton SNMP-card?

    pfSense Packages
    2
    6
    1853
    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.
    • iorx
      iorx last edited by

      I've read and googled but it has turned up with nothing use full. I've been in contact with Eaton about this SNMP-card. They claim it follows RFC-1628 (aka ietf?) and that I should be able to use a generic UPS-SNMP probe to get status and alarms.

      But no …  :( Can't get NUT to feel for this device.

      I've tried all the alternatives and SMTP v1, v2. No go.

      UPS info:

      UPS Model 	
      PW9130 2000VA-T
      	UPS Firmware version 	
      FP: 0.13 INV: 1.26
      	VA Rating 	
      2000 VA
      	User-Assigned Name 	
      ups1
      	Card's IP Address 	
      192.168.180.8
      	Firmware Revision 	
      ConnectUPS Web/SNMP Card V4.34
      
      

      Anyone got a good ideas? Anyone found instructions on how to customize/XML and get it working?

      Ref: 10/100Mb ConnectUPS Web/SNMP Card found here https://powerquality.eaton.com/Support/Software-Drivers/Downloads/connectivity-firmware.asp

      1 Reply Last reply Reply Quote 0
      • iorx
        iorx last edited by

        Digging around a bit, and not related to Eaton.
        Looks like nut.inc not playing along with versions and paths as it should.

        Doing a "rc.d/nut.sh start" give me this:

        
        [2.1.4-RELEASE][root@]/root(8): /usr/local/etc/rc.d/nut.sh start
        starting snmp-ups
        /usr/local/etc/rc.d/nut.sh: /usr/local/sbin/upsdrvctl: not found
        snmp-ups failed to start
        
        

        So, fixing NUT or upgrade to later version pf …

        1 Reply Last reply Reply Quote 0
        • iorx
          iorx last edited by

          Digging more. And it's running :)

          Didn't understand the nut.inc to well so I hacked the nut.sh.

          This makes thing work on 2.1.4. Someone more knowledgeable could maybe use this information to update the nut-package.

          Part of nut.sh

          
          #!/bin/sh
          # This file was automatically generated
          # by the pfSense service handler.
          
          rc_start() {
          	if [ `pgrep snmp-ups | wc -l` != 0 ]; then
          		if [ `pgrep upsmon | wc -l` != 0 ]; then
          		echo stopping upsmon
          		/usr/bin/killall upsmon
          		while [ `pgrep upsmon | wc -l` != 0 ]; do
          			sleep 1
          		done
          	fi
          	if [ `pgrep upsd | wc -l` != 0 ]; then
          		echo stopping upsd
          		/usr/bin/killall upsd
          	fi
          	if [ `pgrep snmp-ups | wc -l` != 0 ]; then
          		echo stopping snmp-ups
          #
          # old code
          #		/usr/local/sbin/upsdrvctl stop
          
          #
          # hacked code
          		/usr/local/libexec/nut/upsdrvctl stop
          	fi
          	sleep 1
          	if [ `pgrep snmp-ups | wc -l` != 0 ]; then
          		echo forcing snmp-ups termination
          		/usr/bin/killall snmp-ups
          		while [ `pgrep snmp-ups | wc -l` != 0 ]; do
          			sleep 1
          		done
          	fi
          
          	fi
          
          	echo starting snmp-ups
          #
          # new path /usr/local/libexec/nut/
          # old path /usr/local/sbin/
          # hacked code
          
          	if /usr/local/libexec/nut/upsdrvctl start; then
          		echo starting upsd
          		/usr/local/sbin/upsd -u root
          		echo starting upsmon
          		/usr/local/sbin/upsmon Eaton9130-8@localhost
          	else
          		echo snmp-ups failed to start
          	fi
          #
          # old code
          #	if /usr/local/sbin/upsdrvctl start; then
          #		echo starting upsd
          #		/usr/local/sbin/upsd -u root
          #		echo starting upsmon
          #		/usr/local/sbin/upsmon Eaton9130-8@localhost
          #	else
          #		echo snmp-ups failed to start
          #	fi
          
          }
          
          rc_stop() {
          		if [ `pgrep upsmon | wc -l` != 0 ]; then
          		echo stopping upsmon
          		/usr/bin/killall upsmon
          		while [ `pgrep upsmon | wc -l` != 0 ]; do
          			sleep 1
          		done
          	fi
          	if [ `pgrep upsd | wc -l` != 0 ]; then
          		echo stopping upsd
          		/usr/bin/killall upsd
          	fi
          	if [ `pgrep snmp-ups | wc -l` != 0 ]; then
          		echo stopping snmp-ups
          		/usr/local/sbin/upsdrvctl stop
          	fi
          	sleep 1
          	if [ `pgrep snmp-ups | wc -l` != 0 ]; then
          		echo forcing snmp-ups termination
          		/usr/bin/killall snmp-ups
          		while [ `pgrep snmp-ups | wc -l` != 0 ]; do
          			sleep 1
          		done
          	fi
          
          }
          
          case $1 in
          	start)
          		rc_start
          		;;
          	stop)
          		rc_stop
          		;;
          	restart)
          		rc_stop
          		rc_start
          		;;
          esac
          
          

          if /usr/local/libexec/nut/upsdrvctl start; then


          1 Reply Last reply Reply Quote 0
          • iorx
            iorx last edited by

            Again. Gave nut.inc a closer inspection.

            $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3)

            Doesn't return anything on 2.1.4. Resulting in wrong path written to nut.sh.

            Couldn't figure out how to make the code return anything to $pfs_version. Even setting it to "2.1" didn't work.
            So the ugly but working solution was to set it to make the if clause ("2.1" == "2.1") :-X

            Reconfig of NUT now works.

            Two places in the nut.inc was modified.

            
            		/* if($pfs_version == "2.1") */
            		if("2.1" == "2.1")
            			$upsdrvctl = "/usr/local/libexec/nut/upsdrvctl";
            		else
            			$upsdrvctl = "/usr/local/sbin/upsdrvctl";
            
            

            Someone skilled on php and bash can probably solve this the right way.

            ;) This is my thread, all mine! Don't You guys even dare to comment on it  ;D

            1 Reply Last reply Reply Quote 0
            • P
              phil.davis last edited by

              $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
              var_dump($pfs_version);
              

              On 2.1.5 I get:

              string(3) "2.1"
              

              On 2.2.2:

              string(3) "2.2"
              

              I am struggling to believe that 2.1.4 is any different about the content of /etc/version - bring that file up in Diagnostics->Edit file - it should show 2.1.4
              In any case, I would certainly upgrade pfSense to 2.1.5, and preferably to 2.2.2

              1 Reply Last reply Reply Quote 0
              • iorx
                iorx last edited by

                Yeah, your right. Working to get 2.1.4 working is the wrong way around. The install has allot of OpenVPN tunnels through out the country so I have hesitated a bit to replace it. Need the UPS support bolted on to this version for protection until their 2.2.2 is ready for prime time.

                I've now tried the 2.2.2 and NUT works as it should . No problem at all! :)

                Thank you!
                Brgs,

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                Products

                • Platform Overview
                • TNSR
                • pfSense
                • Appliances

                Services

                • Training
                • Professional Services

                Support

                • Subscription Plans
                • Contact Support
                • Product Lifecycle
                • Documentation

                News

                • Media Coverage
                • Press
                • Events

                Resources

                • Blog
                • FAQ
                • Find a Partner
                • Resource Library
                • Security Information

                Company

                • About Us
                • Careers
                • Partners
                • Contact Us
                • Legal
                Our Mission

                We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                Subscribe to our Newsletter

                Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                © 2021 Rubicon Communications, LLC | Privacy Policy