Glen Pitt-Pladdy :: Blogapcupsd stats on Cacti (via SNMP) | |||
Following on from the basics of SNMP I did previously, this article now adds another set of SNMP extension scripts, config, and Cacti templates to monitor APC UPS' via apcupsd. apcupsd Configapcupsd is one of the standard ways of monitoring APC UPS' and has a huge variety of devices and connectivity options. It can also serve the status information to other hosts which avoids needing a network management card. To get the status for Cacti, I use the network service (NIS as it is known in the config), so you need to ensure that this is enabled and available on the local interface. Since I have already got SNMP v3 configured with encryption on the server, I chose to use this to transmit the data rather than allow apcupsd to serve the data to the cacti monitoring server. The script I provide could easily be modified to allow remote monitoring without SNMP by passing the hostname argument through to apcaccess and adding labels to the parameters. If your config is correct then you should be able to get a list of parameters from apcupsd by running: $ /sbin/apcaccess status localhost Getting apcupsd satus over SNMPI have created a simple Perl wrapper script for apcaccess to get it into SNMP. Download: Perl script and Cacti Templates for apcupsd are on GitHub I place script apcupsd-stats (make it executable first: chmod +x apcupsd-stats) in /etc/snmp In /etc/snmp/snmpd.conf add the following line: extend apcupsd /etc/snmp/apcupsd-stats Once you have added all this in you can test apcupsd-stats by running it from the command line, and via SNMP by appending the appropriate SNMP OID to the "snmpwalk" commands shown previously. Cacti TemplatesI have generated some basic Cacti Templates for apcupsd. Since different model UPS' give different information, not all the graphs may be appropriate on your UPS. On my one the Output Voltage always gives 230V. the Internal Temperature always 29.2°C, and although the Line Frequency does vary, it does this in steps of 1Hz which is way to course of be of interest. Simply import the template cacti_host_template_apcupsd.xml, and add the graphs you want to the appropriate device graphs in Cacti. It should just work if your SNMP is working correctly for that device (ensure other SNMP parameters are working for that device). Graph Screen Shots
Different versions of Cacti:One person had pointed out that there has been some problems on some versions of Cacti with importing the templates. The template was generated with version 0.8.7b (from Debain Lenny). The problem manifests it's self as "Cacti version does not exist" error, and appears to be cured by adding in this version, although in my version the file is actually global_arrays.php The relevant array from my global_arrays.php / config_array.php: $hash_version_codes = array(
|
|||
This is a bunch of random thoughts, ideas and other nonsense, and is not intended to be taken seriously. I'm experimenting and mostly have no idea what I am doing with most of this so it should be taken with cuation and at your own risk. Intrustive technologies are minimised where possible. For the purposes of reducing abuse and other risks hCaptcha is used and has it's own policies linked from the widget.
Copyright Glen Pitt-Pladdy 2008-2023
|