Post

Setting Up NUT

Setting Up NUT

Setting up NUT Monitoring for APC NMC enabled UPS

  1. Install NUT:
    1
    2
    
     sudo apt install nut
     sudo apt install nut-snmp
    
  2. Edit Config Files:
    1. /etc/nut/ups.conf
      1
      2
      3
      4
      5
      6
      7
      8
      
      [UPS_NAME]
      driver = "snmp-ups"
      port = UPS_DNS_NAME
      mibs = 'ietf'
      community = public
      snmp_version = v1
      pollfreq = 15
      desc = "DESCRIPTION"
      
    2. /etc/nut/upsmon.conf
      1
      2
      
        RUN_AS_USER root
        MONITOR UPS_NAME@localhost 1 admin secret master
      
    3. /etc/nut/upsd.conf
      1
      
        LISTEN 0.0.0.0 3493
      
    4. /etc/nut/upsd.users
      1
      2
      3
      
        [monuser]
          password = secret
          admin master
      
    5. /etc/nut/nut.conf
      1
      
        MODE=netserver
      
  3. Restart NUT Services
    1
    2
    3
    4
    5
    
     sudo service nut-server restart
     sudo service nut-client restart
     sudo systemctl restart nut-monitor
     sudo upsdrvctl stop
     sudo upsdrvctl start
    

Enabling NUT WebGUI

1
2
3
4
5
sudo apt install apache2 nut-cgi -y
sudo echo "MONITOR UPS_NAME@localhost "UPS_DESCRIPTION"" >> /etc/nut/hosts.conf
sudo a2enmod cgi
sudo systemctl restart apache2
sudo echo "I_HAVE_SECURED_MY_CGI_DIRECTORY" >> /etc/nut/upsset.conf

Web URL: http://NUT_SERVER_FQDN/cgi-bin/nut/upsstats.cgi

Testing

  • From Server: upsc UPS_NAME@localhost
  • From Remote: upsc UPS_NAME@NUT_SERVER_FQDN
This post is licensed under CC BY 4.0 by the author.