An IT Services Company

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.

Installing nagios on SME 7.1.x


Nagios is an application that monitors, reports and optionally can act on events on the network.

This document describes the process of installing nagious 2.8 on SME 7.1.x.

Software Requirements

  1. nagios-2.8-1.el4.rf.i386.rpm – This is the main nagios software package.
  2. nagios-plugins-1.4.5-1.el4.rf.i386.rpm – This contains the plugins required by nagios. Without the plugins nagios will not be able to monitor anything.
  3. gd-2.0.28-4.4E.1.i386.rpm – Required by nagios 2.8
  4. xorg-x11-libs-6.8.2-1.EL.13.37.i386.rpm – Required by gd
  5. fontconfig-2.2.3-7.centos4.i386.rpm – Required by xorg-x11-libs
  6. xorg-x11-Mesa-libGL-6.8.2-1.EL.13.37.i386.rpm – Required by xorg-x11-libs
  7. fping-2.4-1.b2.2.el4.rf.i386.rpm – Required by nagios-plugins
  8. perl-Net-SNMP-5.2.0-1.2.el4.rf.noarch.rpm – Required by nagios-plugins
  9. perl-Crypt-DES-2.05-3.2.el4.rf.i386.rpm – Required by perl-Net-SNMP

Installation Procedure

  • Create an Information Bay for nagios

In server-manager create an information bay called ‘nagios’ with the following permissions:

Information bay name nagios
User access via file sharing or user ftp
Public access via web or anonymous ftp
Execution of dynamic content (CGI, PHP, SSI)
  • Install nagios

The « character is a line continuation character and should not be included in the command.

#rpm -ivh fontconfig-2.2.3-7.centos4.i386.rpm «
xorg-x11-Mesa-libGL-6.8.2-1.EL.13.37.i386.rpm xorg-x11-libs-6.8.2-1.EL.13.37.i386.rpm
#rpm -ivh nagios-2.8-1.el4.rf.i386.rpm
#rpm -ivh fping-2.4-1.b2.2.el4.rf.i386.rpm
#rpm -ivh perl-Crypt-DES-2.05-3.2.el4.rf.i386.rpm perl-Net-SNMP-5.2.0-1.2.el4.rf.noarch.rpm
#rpm -ivh nagios-plugins-1.4.5-1.el4.rf.i386.rpm

  • Configure nagios to use the ibay

I prefer to place all the nagios data in the ibay. If your requirements are not the same you can skip this step.

Edit the nagios configuration files in /etc/nagios
#vi /etc/nagios/nagios.cfg

Change the following lines:

#vi /etc/nagios/cgi.cfg

Change the following lines:

Note: Setting use_authentication=0 disables authentication. It is sufficient for our needs. If you require authentication then use_authentication should not be changed. Setting up authentication is beyond the scope of this document

  • Edit /etc/nagios/localhost.cfg

Define all the hosts, hostgroups, services, etc. according to your requirements.

  • Copy the CGI scripts to the ibay

#cp -r /usr/lib/nagios/cgi/* /home/e-smith/files/ibays/nagios/cgi-bin/.

  • Copy the web files to the ibay

#cp -r /usr/share/nagios/* /home/e-smith/files/ibays/nagios/html/.

  • Configure nagios to start in runlevel 7

#ln -s /etc/rc.d/init.d/nagios /etc/rc7.d/S97nagios

  • Start nagios

#chmod 777 /home/e-smith/files/ibays/nagios/files
#/etc/rc.d/init.d/nagios start

This should start the nagios service. Fix any errors in the configuration files if the startup returns any errors. It is also good to have a look at the nagios log file /var/log/nagios/nagios.log. Any errors during the operation of nagios such as missing plugins, etc. will be logged in the log file

  • Connect to the nagios web

Open your browser and browse to http://your.server/nagios