{"id":424,"date":"2009-08-12T22:55:23","date_gmt":"2009-08-13T02:55:23","guid":{"rendered":"https:\/\/lowtek.ca\/roo\/?p=424"},"modified":"2009-08-10T23:58:33","modified_gmt":"2009-08-11T03:58:33","slug":"ups-monitoring","status":"publish","type":"post","link":"https:\/\/lowtek.ca\/roo\/2009\/ups-monitoring\/","title":{"rendered":"UPS Monitoring"},"content":{"rendered":"<p>One of the things that I just hadn&#8217;t got around to after migrating to the new server was restoring my <a href=\"http:\/\/en.wikipedia.org\/wiki\/Uninterruptible_power_supply\">UPS<\/a> monitoring.\u00a0 The first time I set it up, it seemed pretty involved &#8211; partly because the version of Ubuntu I was using (<a href=\"https:\/\/wiki.ubuntu.com\/DapperDrake\">Dapper<\/a>) needed some special <a href=\"http:\/\/en.wikipedia.org\/wiki\/Universal_Serial_Bus\">USB<\/a> configuration.\u00a0 Now that my server is on a more recent level of Ubuntu, it just works like it is supposed to.<\/p>\n<p>The <a href=\"https:\/\/help.ubuntu.com\/community\/apcupsd\">Ubuntu Community Documentation<\/a> is well done and covers all the details.\u00a0 Basically I needed to install apcupsd.\u00a0 Reading through <a href=\"http:\/\/www.apcupsd.com\/manual\/manual.html#known-linux-usb-issues\">the known Linux USB issues<\/a> listed on the APCUPSD site made my scratch my head a bit.\u00a0 It tells you to check the file \/proc\/bus\/usb\/devices to see if the USB device is recognized.\u00a0 My Ubuntu install doesn&#8217;t have this, I suspect it is due to <a href=\"http:\/\/www.linux-usb.org\/USB-guide\/x173.html\">usbfs<\/a> not running.\u00a0 The <a href=\"http:\/\/linuxcommand.org\/man_pages\/lsusb8.html\">lsusb<\/a> utility seems to find the device just fine:<\/p>\n<p><code><br \/>\n$ lsusb<br \/>\nBus 005 Device 001: ID 0000:0000<br \/>\nBus 004 Device 001: ID 0000:0000<br \/>\nBus 003 Device 001: ID 0000:0000<br \/>\nBus 002 Device 001: ID 0000:0000<br \/>\nBus 001 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply<br \/>\nBus 001 Device 001: ID 0000:0000<\/code><\/p>\n<p>So I figured I&#8217;d install and see what happened.<\/p>\n<p><code>sudo apt-get install apcupsd apcupsd-cgi<\/code><\/p>\n<p>You&#8217;ll note that I installed the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Common_Gateway_Interface\">CGI<\/a> package as well so I can check in via the web, this is optional.\u00a0 You do need to do some minor configuration, this is covered in detail by the <a href=\"https:\/\/help.ubuntu.com\/community\/apcupsd\">Ubuntu Community Documentation on apcupsd<\/a>.\u00a0 In my case it was set UPSCABLE usb; UPSTYPE usb; and comment out DEVICE in the file \/etc\/apcupsd\/apcupsd.conf.\u00a0 Then change ISCONFIGURED to yes in the \/etc\/default\/apcupsd file.<\/p>\n<p>All that was left was to start the service:<\/p>\n<p><code>sudo \/etc\/init.d\/apcupsd start<\/code><\/p>\n<p>and test it using <code>apcaccess<\/code>.\u00a0 I&#8217;ll leave the cgi-bin setup as an exercise for the reader.<\/p>\n<p>So why bother doing this at all?\u00a0 Well, the apcupsd service (daemon) will shut down the machine in a controlled manner if there is an extended power failure, configured correctly it will also come back up when the power has been restored.\u00a0 Logs are also generated to indicate when power failures have happened.\u00a0\u00a0 Knowing when, and how long the power was out is comforting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the things that I just hadn&#8217;t got around to after migrating to the new server was restoring my UPS monitoring.\u00a0 The first time I set it up, it seemed pretty involved &#8211; partly because the version of Ubuntu I was using (Dapper) needed some special USB configuration.\u00a0 Now that my server is on &hellip; <a href=\"https:\/\/lowtek.ca\/roo\/2009\/ups-monitoring\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;UPS Monitoring&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-computing"],"_links":{"self":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":3,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":427,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/424\/revisions\/427"}],"wp:attachment":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}