1) Installation of the main component It is located under /usr/ports/sysutils/nut. You can either install it as a binary package: # pkg_add -r nut or as a port: # cd /usr/ports/sysutils/nut/ && make install clean By default, it will run as the user "uucp", but if you install as a port you can change that by defining NUT_USER=name_the_account. By default the CGI scripts used to monitor the UPS status via a web browser won't be installed: to get them, you have to install nut as a port and to define WITH_NUT_CGI. Unless you define NOPORTDOCS, documentation will be installed under /usr/local/share/doc/nut. Take some time to read it! A directory has been created for configuration: at this time it only contains samples. 2) Installation of the optional modules You have then to determine your driver, and you might also need to install the following ports: - sysutils/nut-libupsclient, the upsclient library; - sysutils/nut-snmp, the SNMP driver; - sysutils/nut-usb, the USB drivers. 3) Configuration - Three services has been installed under /usr/local/etc/rc.d (nut, nut_upslog and nut_upsmon); to enable them, you have to edit your /etc/rc.conf and add the following lines: nut_enable="YES" nut_upslog_enable="YES" nut_upsmon_enable="YES" - You have then to copy the samples configuration files and to edit them: a) Configure data acquisition # cd /usr/local/etc/nut # cp ups.conf.sample ups.conf Edit this ups.conf and modify it as below: [ups_name] driver = your_driver port = device_port Notes: ups_name is further used to address the UPS. You might change it according to your wish, but don't forget to also adapt it for the rest of this procedure. your_driver must be replaced by the right value, depending on your exact model (mge-utalk, mge-shut, newhidups or snmp-ups) device_port must be replaced by the right value. - For mge-utalk and mge-shut: the name of the serial port (ie /dev/cuad0, /dev/cuad1, ...) - For snmp-ups: the name of the SNMP Agent host - For newhidups: "auto" or whatever value as newhidups automagically probe for USB UPS. b) Configure data server # cp upsd.conf.sample upsd.conf This file is already configured to allow local monitoring only. If you need to modify it, have a look at upsd.conf (5) manual page. c) Configure user profiles # cp upsd.users.sample upsd.users Edit this file and modify it as below: # Supervision user [admin] password = mypass allowfrom = localhost actions = SET instcmds = ALL # Protection user [monuser] password = mypass allowfrom = localhost upsmon master Notes: For security reasons, prefer to change "mypass" references above, but don't forget to also adapt it for the rest of this procedure. d) Configure protection # cp upsmon.conf.sample upsmon.conf Edit this file and modify it as below: MONITOR ups_name@localhost 1 monuser mypass master 4) Permissions - Check that /var/db/nut belongs to uucp (or your NUT_USER) and that the permission is 0750 (should have been set by the port): # ls -ld /var/db/nut drwxr-x--- 2 uucp wheel 512 12 mai 2006 /var/db/nut - Check the permissions of the configuration files: they should be readable by uucp (or your NUT_USER); you can do: # chown uucp /usr/local/etc/nut/*.conf /usr/local/etc/nut/upsd.users - If you are using the USB driver, you have to explicitely set the permissions to the USB devices. To determine which device (ugen0, ..., ugenx) is used, unplug and re-plug the UPS. You should see this kind of message ugen0: MGE UPS SYSTEMS PROTECTIONCENTER, rev 1.10/42.41, addr 2 if it has been plugged in ugen0, and # usbdevs -v should report something like: Controller /dev/usb1: addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00 port 1 addr 2: low speed, power 20 mA, config 1, PROTECTIONCENTER(0xffff), MGE UPS SYSTEMS(0x0463), rev 42.41 if the controller usb1 is used. Then edit the file /etc/devfs.rules and add the following lines: [nut_usb=10] add path 'ugen0' group wheel user uucp mode 0660 And edit the file /etc/devfs.conf and add the following lines: perm usb1 0660 own usb1 root:uucp To take this rule into account, edit the file /etc/rc.conf and add the line: devfs_system_ruleset="nut_usb" and restart devfs: # /etc/rc.d/devfs restart 5) Start services Start all services (data acquisition driver, network server and protection) using: # /usr/local/etc/rc.d/nut start If all went fine, something like the following lines should be displayed: Network UPS Tools - UPS driver controller 2.0.5 Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.0.5) Detected a UPS: MGE UPS SYSTEMS/PROTECTIONCENTER Using subdriver: MGE HID 1.0 Starting nut. Network UPS Tools upsd 2.0.5 Connected to UPS [ups_name]: ups_name 6) Test your configuration This step is common to all Operating System. Please, follow the "step 3" instructions given on . 7) A KDE client is available in ports collection: sysutils/knutclient.