http://docs.cacti.net/usertemplate:host ... nology:cdu
Original Posting: Thu Oct 16, 2008 4:55 pm
This is a host template for trending the watts, amps and environmental sensors on a Server Technology Sentry CDU.
This template was developed against a Switched 3phase CDU with expansion module (CW-24VDY-L30MS & CX-24VDY-L30MS). This template will not work correctly with 2phase models at this time. It should work just fine with a 3 phase Smart CDU unit. All development and testing was done against Sentry firmware version 6.0d
Requirements:
- Cacti 0.8.7b (earlier versions MAY work)
RRDTool 1.2.x (some graphs use opacity)
net-snmp userland utilities
Code: Select all
CDEF
[success] Divide By 100 [new]
[success] Total All Data Sources Divide by 100 [new]
[success] Total All Data Sources Divide by 600 [new]
[success] Total All Data Sources [update]
[success] Total All Data Sources Divide by 6 [new]
[success] Divide By 10 and Convert Celsius to Farenheit [new]
GPRINT Preset
[success] Normal [update]
[success] Load Average [update]
Data Input Method
[success] SNMP - Get ServerTech 3phase CDU Loads (Amps) [new]
[success] SNMP - Get ServerTech 3phase CDU Powers (Watts) [new]
[success] Get SNMP Data (Indexed) [update]
Data Template
[success] SNMP - ServerTech 3Phase CDU Load (Amps) [new]
[success] SNMP - ServerTech 3Phase CDU Power (Watts) [new]
[success] Sentry CDU Enviornmental Monitors [new]
Graph Template
[success] ServerTech CDU Load (Amps) [new]
[success] ServerTech CDU Power (Watts) [new]
[success] ServerTech CDU Temperature and Humidity [new]
Data Query
[success] Sentry CDU Enviornmental Monitors [new]
Host Template
[success] ServerTech 3phase Sentry CDU [new]
Initially I tried to use an SNMP query for both the environmental sensors and power information. The SNMP query for the environmental sensors works very well. I had lots of trouble trying to get the SNMP query for power information to work. This is due to the way in which the infeeds are indexed within the ServerTech MIB. Specifically:
Code: Select all
Sentry3-MIB::infeedID.1.1 = STRING: "AA"
Sentry3-MIB::infeedID.1.2 = STRING: "AB"
Sentry3-MIB::infeedID.1.3 = STRING: "AC"
Sentry3-MIB::infeedID.2.1 = STRING: "BA"
Sentry3-MIB::infeedID.2.2 = STRING: "BB"
Sentry3-MIB::infeedID.2.3 = STRING: "BC"
Most cacti templates will use a single Data Input Method for this type of situation. This often is inefficient, in that all data is collected whether a particular graph/RRD actually needs/uses that data. The cost is that you end up with an extra Data Input Method and Data Template for this host template, which I felt was acceptable. This keeps the resulting RRD files smaller, and reduces the SNMP Traffic and script run-time, which inevitably will help with poller performance.
The backend 3phase-cdu.pl script could definitely use some optimization, and could probably be completely re-written to use the perl SNMP module. Currently the script relies on standard userland snmp tools. Make sure to change the $snmpwalk and $snmpget variables if your net-snmp installation is in a location other than /usr/bin/. Thankfully, the snmp agent on the switched CDUs is very responsive. Here is some runtime information:
Code: Select all
host: /usr/local/cacti/scripts> time /usr/local/bin/perl /usr/local/cacti/scripts/3phase-cdu.pl 192.168.1.2 2 public 161 500 load
infeedLoadValue.AA:175 infeedLoadValue.AB:88 infeedLoadValue.AC:100 infeedLoadValue.BA:225 infeedLoadValue.BB:25 infeedLoadValue.BC:213 infeedLoadHighThresh:24 infeedCapacity:30
real 0m0.174s
user 0m0.063s
sys 0m0.007s
host: /usr/local/cacti/scripts> time /usr/local/bin/perl /usr/local/cacti/scripts/3phase-cdu.pl 192.168.1.2 2 public 161 500 power
infeedPower.AA:210 infeedPower.AB:106 infeedPower.AC:120 infeedPower.BA:256 infeedPower.BB:30 infeedPower.BC:256
real 0m0.078s
user 0m0.021s
sys 0m0.004s
There are also several new CDEFs that come along with this host template. I apologize in advance if you don't like the idea of cluttering your installation with single-time use CDEFs. With the release of 0.8.7c several of these CDEFs will no longer be needed. "Total All Data Sources Divide by 600" and "Total All Data Sources Divide by 6" are used to compute averages for each of the 6 infeeds on a CDU. In 0.8.7c there are some new standard CDEFs that will make averaging data sources much easier, and these extra CDEFs will be removed.
The amp load for a switched CDU is presented via SNMP in a 10^2 power. This is why I have created a Divide by 100 CDEF. The temperature is stored in Celsius in a 10^1 power, so in order to get Fahrenheit I needed to create a "Divide by 10, Convert Celsius to Fahrenheit" CDEF.
Future Improvements:
- Given Temperature and %RH it would be possible to graph the Dewpoint on the Temperature and Humidity graphs. I need to come up with a CDEF function for this, which is challenging.
- You'll notice that the "load" query outputs some extra information that is stored in the RRD database infeedLoadHighThresh:24 and infeedCapacity:30. In the future, cacti may provide the functionality to use queries for HRULE values. When that occurs, it will be possible to graph the High Load Threshold and Capacity as HRULE values on the load graph. Unfortunately this data is stored during every polling cycle in the RRD file - an SNMP data query would have been much more logical for this purpose - but as mentioned before, this was not possible.
Known Issues:
- You need to define titles for both the load and power graphs, they are not generated automatically - this would have been possible if an SNMP data query was used. Unfortunately, if you attempt to create both graphs at the same time, you'll only be prompted for one title. I am not sure why this is occurring in my installation. As a workaround, create both graphs separately to be prompted for a title. Otherwise, one of them will be created with a blank title.
- This template/script pair does not support snmp V3. No consideration was taken at all to try and make this work. The 3phase-cdu.pl would need to be tweaked, along with the Data Input methods for this to work.
Two Phase Units
This host template will most likely work with 2 phase units if you're using cacti version 0.8.7c. This new version of cacti (spine?) won't choke on an entire data source if some of the values come back undefined. If using this template with a 2 phase unit you'll need to modify the graph templates and several CDEFs, otherwise you'll have NaNs in your graphs and the averages won't be right. Hopefully with newer versions of this template pack, and with newer versions of Cacti, it will be possible to make using 2phase units easier. Please speak to me if you need help getting a 2phase unit working.