Server Technology Sentry 3 Phase Switched / Smart CDU

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

eschoeller
Cacti User
Posts: 234
Joined: Mon Dec 13, 2004 3:03 pm

Server Technology Sentry 3 Phase Switched / Smart CDU

Post by eschoeller »

UPDATE: Templates upgraded and moved to docs.cacti.net
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
What to expect while importing this host template:

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]
This template pack relies on two parts: The Host template which includes all associated data templates and graph templates, and the 3phase-cdu.pl script. This is placed in <path_cacti>/scripts/

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"             
Unfortunately, cacti had some trouble understanding the two layers of indexes here, and was expecting the value of each index to be a numerical ID (like interfaces in a system) from 1-6 not AB-BC. I tried various methods to get this working, but in the end the way in which I was passing the query to cacti did not allow me to graph all infeeds on a single graph (which is what I wanted). I bailed at this point, and wrote a perl script to gather the data along with several Data Input Methods.

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

New CDEFs
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.
Attachments
cacti-sentry-3phase-cdu-v1-1.zip
Import host template as per usual in Cacti. Place the perl script in &lt;path_cacti&gt;/scripts. Place sentry-env.xml in &lt;path_cacti&gt;/resource/snmp_queries
(13.18 KiB) Downloaded 3491 times
Example Load (Amps) graph. Shaded pink area represents &amp;quot;average load&amp;quot; for the entire 2 tower system. This makes it easy to identify which towers are above and below average load, and thus, if you have a 3 phase imbalance, and which phases need t
Example Load (Amps) graph. Shaded pink area represents &quot;average load&quot; for the entire 2 tower system. This makes it easy to identify which towers are above and below average load, and thus, if you have a 3 phase imbalance, and which phases need t
swcduamps.png (52.41 KiB) Viewed 30100 times
Example Power (watts) graph. Shaded pink region is the average power per infeed.
Example Power (watts) graph. Shaded pink region is the average power per infeed.
swcdupower.png (54.61 KiB) Viewed 30100 times
Example graph from a Temperature / Humidity probe. Title is generated automatically. I have not renamed my sensor from the default, but this can be changed at will with the &amp;quot;Re-Apply Suggested Names&amp;quot; function in Cacti. I hope to add &amp;quot;Dewpoi
Example graph from a Temperature / Humidity probe. Title is generated automatically. I have not renamed my sensor from the default, but this can be changed at will with the &quot;Re-Apply Suggested Names&quot; function in Cacti. I hope to add &quot;Dewpoi
swcduenv.png (41.87 KiB) Viewed 30100 times
Last edited by eschoeller on Wed Sep 26, 2012 7:51 pm, edited 4 times in total.
eschoeller
Cacti User
Posts: 234
Joined: Mon Dec 13, 2004 3:03 pm

Post by eschoeller »

Please provide any feedback that you may have!
cvicente
Posts: 6
Joined: Tue Oct 14, 2008 11:21 pm
Location: NH

Missing data query XML?

Post by cvicente »

Thanks for sharing this. I just imported the template and tried to create graphs. I got "Error in data query". I went to the Data Queries menu option and selected "Sentry CDU Power", which has:
<path_cacti>/resource/snmp_queries/sentry-pwr.xml
in the XML Path field. The same page says "Could not locate XML file". I checked that directory and the file is not there.

Any hints?

Thx
cvicente
Posts: 6
Joined: Tue Oct 14, 2008 11:21 pm
Location: NH

Missing data query XML?

Post by cvicente »

BTW, I also got:

Could not find data query XML file at '/var/www/cacti/resource/snmp_queries/sentry-env.xml'

In the Data Query Debug Information.

cv
eschoeller
Cacti User
Posts: 234
Joined: Mon Dec 13, 2004 3:03 pm

Post by eschoeller »

cvicente,

My apologies. Please remove the template and re-download the updated .zip file above (I edited the original post). It includes the sentry-env.xml file. The template is also updated so that it does not require sentry-pwr.xml (3phase-cdu.pl replaces it)

If you're unsure of how to completely remove the existing template, let me know and I can give you step by step instructions.
toolman667
Posts: 5
Joined: Mon Nov 03, 2008 6:58 pm

Post by toolman667 »

eschoeller:

Is there anyway you could help me get this template to work with a non 3-phase unit?

I have just the single phase SentryCDU master/slave pairs.

I am just a bit confused as to how you would adapt this template to the different model.
eschoeller
Cacti User
Posts: 234
Joined: Mon Dec 13, 2004 3:03 pm

Post by eschoeller »

Hmm. I didn't know there was a single phase smart/switched model.

Can you perform the following snmp command?

Code: Select all

snmpwalk -m ALL -v2c -c <COMMUNITY> <IPADDRESS> .1.3.6.1.4.1.1718.3.2.2.1.7
(replace <COMMUNITY> and <IPADDRESS> respectively)

And post the output?
toolman667
Posts: 5
Joined: Mon Nov 03, 2008 6:58 pm

Post by toolman667 »

Here is the output:

Code: Select all

SNMPv2-SMI::enterprises.1718.3.2.2.1.7.1.1 = INTEGER: 2225
SNMPv2-SMI::enterprises.1718.3.2.2.1.7.2.1 = INTEGER: 1838
I was told they are single phase. But they are the Smart CDUs with 16 ports, with a master, and a slave tower.
eschoeller
Cacti User
Posts: 234
Joined: Mon Dec 13, 2004 3:03 pm

Post by eschoeller »

Indeed. That's the output I would expect from 2 single phase units in a master/slave configuration, especially given your loads which seem to be 22 amps and 18 amps.

I need to decide whether to create separate templates for single,dual and triple phase units or whether to create a single template set that could handle all three. I am leaning towards creating a single template set, but that would require a good deal of time, and could possibly carry along too many data input methods and data templates for individuals that only need one version.

At any rate, you can modify the current template set to work with this single phase unit if you want.

Basically, you need to remove all references to .AB .AC .BB .BC for the power and load templates. You do NOT need to modify the Environmental templates. Those should work just fine regardless of how many phases your unit has.

Here is a start:

In 3phase-cdu.pl change line 78:

Code: Select all

print "infeedLoadValue.AA:@loads[0] infeedLoadValue.AB:@loads[1] infeedLoadValue.AC:@loads[2] infeedLoadValue.BA:@loads[3] infeedLoadValue.BB:@loads[4] infeedLoadValue.BC:@loads[5] infeedLoadHighThresh:$cduloadthreshold infeedCapacity:$cdufeedcapacity";
To:

Code: Select all

print "infeedLoadValue.AA:@loads[0] infeedLoadValue.BA:@loads[1] infeedLoadHighThresh:$cduloadthreshold infeedCapacity:$cdufeedcapacity";
And line 90 to:

Code: Select all

print "infeedPower.AA:@powers[0] infeedPower.BA:@powers[1]";
In both of the Data Input Methods (Get ServerTech 3Phase CDU ...) Remove all output fields that have .AB .AC .BB .BC

Then in both of the Data Templates (ServerTech 3Phase CDU ...)
Remove the data source items ending in the same (lie. loadAB loadAC loadBB etc)

Finally, in the graph templates, (ServerTech CDU ...) Remove all Graph Template items that are for the other phases (again, loadAB, loadAC, or powerAB)

Now cross your fingers that it all will work ;) If it does, and you feel so inclined, change the name of the script from 3phase-cdu to 1phase-cdu or something - and then change the Input String on both Data Input methods to reflect the new name.

Again, you do not need to touch the Environmental monitors at all. (Data Query, Data Template and Graph Template)

Whew ...

To anyone else reading this post, the same procedure described above should also work to convert this to work on a 2 phase uint. Just remove only AC and BC references, and keep AB BB ...
toolman667
Posts: 5
Joined: Mon Nov 03, 2008 6:58 pm

Post by toolman667 »

Thank you so much for the lesson on Cacti! I got it working with your changes.

One question, how can I change the "Tower Averages"... since there are only two towers, instead of 6... I assume I need to change the math somewhere to only calculate the two towers. Question is, where?

Thanks so much for your help! I appreciate your hard work.
eschoeller
Cacti User
Posts: 234
Joined: Mon Dec 13, 2004 3:03 pm

Post by eschoeller »

Great, I'm glad those changes worked.

To fix the extra GPRINT value for "All Towers: Avg:" You need to edit the "Total All Data Sources Divide by 600" and "Total All Data Sources Divide by 6" CDEFs. Head over to "Graph Management" -> "CDEFs". Click on "Total All Data Sources Divide by 600". The second item should read "Custom String: 600" Click on this and switch the custom string to 200.

Then click on "Total All Data Sources Divide by 6" and change the custom string on Item #2 to "2" instead of "6". You can optionally rename the CDEFs if you wish to reflect these changes, just verify that the CDEFs are still being applied in the Graph Templates.

Let me know if that works!
phila
Posts: 20
Joined: Fri Mar 07, 2008 3:47 pm

Temp graph is too high

Post by phila »

Hi,

Thank you for such great addition to cacti.

The Amp/Watt graphs seem to be working fine on our CDUs, but the temperature looks off, I am currently seeing 175 F on all my CDUs. Actual temp is ~85F.
The Humidity line is correct.
Could it be that CDEF is wrong or smthn?

Thanks,
phila
Posts: 20
Joined: Fri Mar 07, 2008 3:47 pm

Re: Temp graph is too high

Post by phila »

figured it out, the CDUs already report it in Farenheit. After modifying the CDEF, to just account for 10^2 factor and not do the conversion all is good.

Thanks again!

phila wrote:Hi,

Thank you for such great addition to cacti.

The Amp/Watt graphs seem to be working fine on our CDUs, but the temperature looks off, I am currently seeing 175 F on all my CDUs. Actual temp is ~85F.
The Humidity line is correct.
Could it be that CDEF is wrong or smthn?

Thanks,
eschoeller
Cacti User
Posts: 234
Joined: Mon Dec 13, 2004 3:03 pm

Post by eschoeller »

Oops, sorry I missed your original post. Yes, this template relies on your CDU being configured to report temperatures in Celsius. If not, you will need to make changes to the CDEF as you suggested.
reed
Posts: 2
Joined: Wed Feb 11, 2009 4:38 am

Re: Server Technology Sentry 3 Phase Switched / Smart CDU

Post by reed »

eschoeller wrote: New CDEFs
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.
...
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.
Cacti 0.8.7c is out. Do you expect to release an updated .zip soon?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests