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> 45 / 84<br />
upsmon (optional): certificate database and self certificate<br />
Like upsd, upsmon may need to authenticate itself (upsd’s CERTREQUEST directive set to REQUEST or REQUIRE). It must<br />
access to a certificate (and its private key) in a certificate database configuring CERTPATH and CERTIDENT in upsmon.conf in<br />
the same way than upsd.<br />
CERTPATH /usr/local/ups/etc/cert_db<br />
CERTIDENT ’certificate name’ ’database password’<br />
9.5.3 Restart upsd<br />
It should come back up without any complaints. If it says something about keys or certificates, then you probably missed a step.<br />
If you run upsd as a separate user ID (like nutsrv), make sure that user can read files in the certificate directory. NUT reads the<br />
keys and certificates after forking and dropping privileges.<br />
9.5.4 Restart upsmon<br />
You should see something like this in the syslog from upsd:<br />
foo upsd[1234]: Client mon@localhost logged in to <strong>UPS</strong> [myups] (SSL)<br />
If upsd or upsmon give any error messages, or the (SSL) is missing, then something isn’t right.<br />
If in doubt about upsmon, start it with -D so it will stay in the foreground and print debug messages. It should print something<br />
like this every couple of seconds:<br />
polling ups: myups@localhost [SSL]<br />
Obviously, if the [SSL] isn’t there, something’s broken.<br />
9.5.5 Recommended: sniff the connection to see it for yourself<br />
Using tcpdump, Wireshark (Ethereal), or another network sniffer tool, tell it to monitor port 3493/tcp and see what happens. You<br />
should only see STARTTLS go out, OK STARTTLS come back, and the rest will be certificate data and then seemingly random<br />
characters.<br />
If you see any plaintext besides that (USERNAME, PASSWORD, etc.) then something is not working.<br />
9.5.6 Potential problems<br />
If you specify a certificate expiration date, you will eventually see things like this in your syslog:<br />
Oct 29 07:27:25 rktoy upsmon[3789]: Poll <strong>UPS</strong> [for750@rktoy] failed -<br />
SSL error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE: certificate<br />
verify failed<br />
←↪<br />
You can verify that it is expired by using openssl to display the date:<br />
openssl x509 -enddate -noout -in <br />
It’ll display a date like this:<br />
notAfter=Oct 28 20:05:32 2002 GMT<br />
If that’s after the current date, you need to generate another cert/key pair using the procedure above.