Network UPS Tools User Manual
Network UPS Tools User Manual
Network UPS Tools User Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Network</strong> <strong>UPS</strong> <strong>Tools</strong> <strong>User</strong> <strong>Manual</strong> 2 / 84<br />
2.6 <strong>Network</strong> Information<br />
These programs are designed to share information over the network. In the examples below, localhost is used as the hostname.<br />
This can also be an IP address or a fully qualified domain name. You can specify a port number if your upsd process runs<br />
on another port.<br />
In the case of the program upsc, to view the variables on the <strong>UPS</strong> called sparky on the upsd server running on the local<br />
machine, you’d do this:<br />
/usr/local/ups/bin/upsc sparky@localhost<br />
The default port number is 3493. You can change this with "configure --with-port" at compile-time. To make a client talk to upsd<br />
on a specific port, add it after the hostname with a colon, like this:<br />
/usr/local/ups/bin/upsc sparky@localhost:1234<br />
This is handy when you have a mixed environment and some of the systems are on different ports.<br />
The general form for <strong>UPS</strong> identifiers is this:<br />
[@[:]]<br />
Keep this in mind when viewing the examples below.<br />
2.7 Manifest<br />
This package is broken down into several categories:<br />
• drivers - These programs talk directly to your <strong>UPS</strong> hardware.<br />
• server - upsd serves data from the drivers to the network.<br />
• clients - They talk to upsd and do things with the status data.<br />
• cgi-bin - Special class of clients that you can use with your web server.<br />
• scripts - Contains various scripts, like the Perl and Python binding, integration bits and applications.<br />
2.8 Drivers<br />
These programs provide support for specific <strong>UPS</strong> models. They understand the protocols and port specifications which define<br />
status information and convert it to a form that upsd can understand.<br />
To configure drivers, edit ups.conf. For this example, we’ll have a <strong>UPS</strong> called "sparky" that uses the apcsmart driver and is<br />
connected to /dev/ttyS1. That’s the second serial port on most Linux-based systems. The entry in ups.conf looks like<br />
this:<br />
[sparky]<br />
driver = apcsmart<br />
port = /dev/ttyS1<br />
To start and stop drivers, use upsdrvctl. By default, it will start or stop every <strong>UPS</strong> in the config file:<br />
/usr/local/ups/sbin/upsdrvctl start<br />
/usr/local/ups/sbin/upsdrvctl stop<br />
However, you can also just start or stop one by adding its name:<br />
/usr/local/ups/sbin/upsdrvctl start sparky<br />
/usr/local/ups/sbin/upsdrvctl stop sparky<br />
To find the driver name for your device, refer to the section below called "HARDWARE SUPPORT TABLE".