Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Here is a script and two associated charts for gathering basic UPS stats from TrippLite PowerAlert 12 agents. Here is what data from a TrippLite managed UPS looks like:
PowerAlert can monitor multiple UPSes (local devices as well as remote devices attached to other PowerAlert nodes). PowerAlert 12 also supports multiple vendor devices, although it should be noted that not all devices provide all of the monitored information.
The posted update contains a fix that converts the SNMP timeout value from Cacti's millisecond format to PHP/Net-SNMP microsecond format. The lack of conversion in the earlier script would sometimes result in excessive retries or complete failure.
I was able to get the temperature graph template working but I can't get the signal and capacity templates to show up under each UPS host. They are visible via the Graph Templates page but not where I would select the graph template to be used under a specific host.
To use this, import the XML definition and copy the script to the cacti/resources/script_queries/ directory, then link the data query to a device that has PowerAlert 12 running on it (A UPS or a different Machine?)
It looks like most every script and many plugins are going to need updating when they move to a newer version of cacti.
As the Cacti group splitup the database information from the rest of the informatiion. Most files have to now be pointed to global.php insted of config.php.
The problem I am having is my php seems to hang when running this script? Anybody have any ideas on this or what I can do to resolve my problem?
CACTI01 2007-10-09 07:40:13 php: PHP Warning: Missing argument 10 for cacti_snmp_get(), called in /var/www/html/scripts/poweralert_ups_status.php on line 197 and defined in /var/www/html/lib/snmp.php on line 39
I am getting this error and do not know what Is wrong or to look at.
I uploaded a new version that should work with the SNMP APIs in 0.8.6 and 0.8.7 alike, added the ability to probe for battery temperature, and also cleaned up some of the code
As for the question about working directly with the UPS SNMP-Web card, yes it will but you have to change the port number in the data template to 161. Alternatively, create a new data template that is specifically for use with the SNMP cards, but keep the data source names the same, and you will be able to use the graphs between both the software and the cards.
The latest version of poweralert has a bug where it reads some batteries as 120 volts (wrong by 10x) so I added a control condition that if batteryVoltage was >= 100 then divide by 10
I posted a new version of the script with many significant enhancements. The biggest change is a switch from the expensive and slow script query interface to the persistent and fast script server interface. I also dropped the comma-separated parameters and switched to a colon-separated "bundle" for SNMP arguments, tightened up the array and variable management, added a lot more error checking, and otherwise did a complete rewrite of the script.
Due to the changes, the script and resource xml files need to be reinstalled and any data queries need to be reimported. However the existing graphs and data sources should continue to operate afterwards.
Thanks for your work on this, however I cannot get things working with .8.7g. When I run Verbose Query under Associated Data Queries for a given device, I get:
+ Running data query [10].
+ Found type = '6 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/poweralert_ups_status.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/site/scripts/ss_poweralert_ups_status.php 172.16.0.4:1:tlremote::::::1500 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/ss_poweralert_ups_status.php 172.16.0.4:1:tlremote::::::1500 query upsDevice'
+ Found item [upsDevice='1'] index: 1
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/ss_poweralert_ups_status.php 172.16.0.4:1:tlremote::::::1500 query upsName'
+ Found item [upsName=' Unable to locate UPS attribute data in SNMP'] index: FATAL
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/poweralert_ups_status.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/poweralert_ups_status.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/poweralert_ups_status.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/poweralert_ups_status.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/poweralert_ups_status.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_server/poweralert_ups_status.xml'
When I run the php script it seems not to like the upsName variable. I am running the most current version of the Tripplite Agent downloaded today from their website.
When I snmpwalk the device, I do get values and device name, but all I can see are the OID numbers and not the variable name.
I was wondering if you might offer a suggestion about this.