Configure UPS Monitoring on SME Server Using A Powercom UPS

This document is based on ‘Configure UPS Monitoring on SME Server’; from Sonora Communications, Inc.

Configure UPS Monitoring on SME Server

This document is very limited in scope as it pertains only to SME Server 7 being used with the included NUT 2.0.5 UPS monitoring software in conjunction with a PowerCom BTN-2000 UPS.

NUT UPS Monitoring Software Network UPS Tools is probably the best open-source UPS monitoring tool available for Linux. The software does not run on Windows, but the WinNUT tool allows you to control a Windows box that might be connected to the same UPS.

Configure SME Server and NUT
Connect the serial cable that came with the UPS from the SME server to the UPS. This is a 9-pin female to a 9-pin male. Do not use any other cable.

At the SME console as root:

Update the NUT package to the latest:

yum update e-smith-nutUPS

Configure UPS monitoring:

config setprop nut Model genericups
config setprop nut Device /dev/ttyS0
config setprop nut Type KIN1500AP
config setprop nut mfr PowerCom
config setprop nut mdl KIN1500AP
config setprop nut status enabled

You can then view the settings like this:

config show nut

Create a custom template to specify the ups type:

touch -p /etc/e-smith/templates-custom/etc/ups/ups.conf/UPS

vi /etc/e-smith/templates-custom/etc/ups/ups.conf/UPS

Paste the following section into the template:

my $model = $nut{Model} || “newhidups”;
my $device = $nut{Device} || “/var/lib/ups/hiddev0”;
my $type = $nut{Type};
my $mfr = $nut{mfr};
my $mdl = $nut{mdl};
$OUT .= “[UPS]\n”;
$OUT .= “\tdriver = $model\n”;
$OUT .= “\ttype = $type\n”;
if ($model eq ‘genericups’)
$OUT .= “\tupstype = $type\n” if defined $type;
$OUT .= “\tmfr = $mfr\n” if defined $mfr;
$OUT .= “\tmodel = $mdl\n” if defined $mdl;
$OUT .= “\tport = $device\n”;

Save the fragment.

Apply the new settings like this (server will reboot):

signal-event post-upgrade; signal-event reboot

If you don’t want to reboot the server, you can do this instead:

expand-template /etc/sysconfig/ups
expand-template /etc/ups/*
/etc/rc7.d/S15nut start

You can confirm the communication with this command:

upsc UPS@localhost

You can view log entries with one or more of these commands:

grep nut /var/log/messages

grep ups /var/log/messages

egrep ‘nut|ups’ /var/log/messages

Configure a Windows Slave

We run multiple Windows servers running MS Exchange, MS SQL Server, Terminal Services and WSUS. We run WinNUT on the Windows servers to shutdown the servers in case of prolonged power failure.

Download and install WinNUT on the Windows server as an administrator.

Use these commands at the SME server console to gather the needed configuration information:

cat /etc/ups/upsd.conf
cat /etc/ups/upsd.users
cat /etc/ups/ups.conf

On the Windows machine, click the Edit button to edit the upsmon.conf file. Enter a line similar to this a the top. You can just un-comment a MONITOR line and edit it:

MONITOR UPS@<sme servername or IP> 1 upsslave <password of upsslave> slave


MONITOR UPS@myserver 1 upsslave 123456789123456 slave

Save the changes and continue configuring WinNUT:

  • Install as a Service
  • Automatic Startup
  • Apply and Start WinNUT

You can then click the View button to check the results.