How-To : NUT Web Interface Add-On

Description :

I decided to use the NUT project, and was excited that there was a web interface included with it. Unfortunately the web interface is just a group of CGI URLs. I decided to create a central page to easily access the CGI scripts.

References :

Network UPS Tools (aka NUT)

nut-html (Web Interface Add-On)


Outline :


Procedure :

Screenshots

  • Main Page


  • Status Page


  • Settings Page

 

Installation

  • nut-html Version 1.1 - by Dave Breiland - bigwavedave@gmail.com
  • Download the nut-html-20050720b.tar.gz (above) to your base install of NUT. (i.e. /usr/local/nut)
  • Extract the files using "tar zxvf nut-html-20050720b.tar.gz".
  • You should now have a folder titled "html".
    • My directories now look like:
      [root@server /]# cd /usr/local/nut
      [root@server nut]# ls -al
      total 60
      drwxr-xr-x 10 root root 4096 Jul 20 14:58 .
      drwxr-xr-x 21 root root 4096 Jul 17 19:53 ..
      drwxr-xr-x 2 root root 4096 Jul 17 19:53 bin
      drwxr-xr-x 2 root root 4096 Jul 20 09:44 cgi-bin
      drwxr-xr-x 2 root root 4096 Jul 20 11:17 etc
      drwxr-xr-x 2 root root 4096 Jul 20 14:58 html
      drwxr-xr-x 4 root root 4096 Jul 17 19:53 man
      -rw-r--r-- 1 root root 830 Jul 20 14:57 nut-html-20050720.tar.gz
      drwxr-xr-x 2 root root 4096 Jul 17 19:53 sbin
      drwxr-xr-x 2 root root 4096 Jul 17 19:53 share
      [root@server nut]#
  • Now edit your Apache conf file, adding:
    • #Begin Section
      ScriptAlias /nut/cgi-bin/ /usr/local/nut/cgi-bin/
      <Directory "/usr/local/nut/cgi-bin/">
      AllowOverride AuthConfig
      Options ExecCGI
      Order allow,deny
      Allow from all
      </Directory>

      Alias /nut/ /usr/local/nut/html/
      <Directory "/usr/local/nut/html/">
      Options None
      AllowOverride AuthConfig
      Order allow,deny
      Allow from all
      </Directory>
      #End Section
  • Make sure to change the paths according to your configuration and installation.
  • Also make sure to restart Apache.
  • Configure the CGI scripts. Manpages can be found from:
    [root@server nut]# man -M /usr/local/nut/man/ upsstats.cgi
    [root@server nut]# man -M /usr/local/nut/man/ upsset.cgi
    [root@server nut]# man -M /usr/local/nut/man/ upsimage.cgi
    [root@server nut]# man -M /usr/local/nut/man/ hosts.conf
  • It is recommended that you use .htaccess files in the cgi-bin folder and the html folder. Please reference:
    http://httpd.apache.org/docs/howto/htaccess.html

 


Last Modified : 2005-07-20

If you feel information is missing... please email me.
If you feel I have missed giving credit to a person or organization... please email me.
Copyright © 2003-2012 - Dave Breiland (superdave@dynamicis.com)