# Access and control of UPS

How is UPS monitoring started? I have Network UPS Tools (NUT) core system loaded on ubuntu 11.04 (client), but can find no application to run from the system menus. The software center description says the following programs in NUT are run from a terminal: upsc, upscmd, upsd, upsdrvctl, upslog, upsmon, upsrw, upssched. I want to monitor and configure a single UPS via a GUI interface. I checked device manager and the UPS is visible (via usb port). I also checked sysv-rc-conf to confirm that NUT is running on levels 2-5. Is there another interface I need to install? What's the next step?

-
Did you check under the power icon on the icon bar at the top of the screen? –  Thomas W. Jul 14 '11 at 22:34
There is no power icon. –  wam Jul 14 '11 at 22:39
You might be running in to the same issue I did. Or at least you may get some hints here: How to control UPS via nut rather than gnome-power-manager? - Ask Ubuntu - Stack Exchange –  nealmcb Feb 3 '12 at 0:36

Configuration is mostly done with text files in /etc/nut. The example files provided are well documented, and should include a full set of files. I deploy the following: - nut.conf (all systems) - standard startup mode script, now checked by Ubuntu - upsmon.conf (all systems) - controls which ups to monitor for power failure - upssched.conf (all systems) - controls scheduled activities based on events - upssched-cmd (all systems) - command script run by upssched.conf (see below) - upsd.conf (NUT servers) - controls network access for the server - ups.conf (NUT servers) - controls which UPS(s) get monitored - /etc/default/nut (Debian based systems, including Ubuntu) - controls which programs are launched on system reboot.

If you have multiple systems on one UPS you will need to decide if files need to be modified per system or type. nut.conf will at should be different for clients and NUT servers. The NUT server configuration files need to be done per server. upsmon.conf needs to indicate which UPS(s) to monitor and use to trigger a shutdown. Seen the man pages and/or documentation.

You can configure and control your UPS with the nut-cgi package which provides a web based interace via http://localhost/cgi-bin/nut/upsset.cgi. I use upstats.cgi to monitor the UPS. You can use the supplied templates, or modify them to suit. It requires the following files: - hosts.conf - which hosts to report on - upsset.conf - indicates you have secured your server and wish to enable upsset.cgi

For on-line configuration, I have had success with knutclient. It provides a nice interface to monitor and configure your UPS. Once the configuration is done, it is rare you need to use it. The NUT site lists other tools under Related Projects.

I wrote the following script to dump load shortly after a power failure (Don´t trigger them on the monitoring server. I don't use it any more, but may give you an idea how to do it.

#!/bin/bash
# /etc/nut/upssched-cmd - Run scheduled commands

case $1 in apc1-on-batt) /sbin/shutdown -h now +0 ;; belkin-on-batt) /sbin/shutdown -h now +0 ;; *) logger -t upssched-cmd "Unrecognized command:$1"
;;
esac

# EOF 
-