TrippLite PowerAlert UPS stats -- update November 11, 2010

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

Moderators: Moderators, Developers

Author
Message
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

TrippLite PowerAlert UPS stats -- update November 11, 2010

#1 Post by ehall » Fri Jan 27, 2006 12:51 am

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:

Image

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.

--> see this page for the tarball and instructions <--
Last edited by ehall on Thu Nov 11, 2010 9:29 pm, edited 8 times in total.

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#2 Post by ehall » Sat Feb 10, 2007 11:51 am

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.

User avatar
malichidemonos
Cacti User
Posts: 64
Joined: Fri Aug 04, 2006 2:12 pm
Location: MI

#3 Post by malichidemonos » Thu Jun 28, 2007 4:18 pm

Any idea why thold wont work with this? I'm setting a templete to monitor the battery charge and it will not even apply to the device.
Last edited by malichidemonos on Mon Jul 16, 2007 12:21 pm, edited 1 time in total.

User avatar
Mark.
Cacti User
Posts: 74
Joined: Tue Jul 03, 2007 4:11 pm
Location: San Luis Obispo

#4 Post by Mark. » Tue Jul 03, 2007 4:47 pm

Thanks for the files and all of your work.

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?)


Any ideas, need more information?

User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

I am not able to get this to work for me

#5 Post by chrisgapske » Wed Aug 15, 2007 2:21 pm

I am not able to get this to work for me looks like the script is not running ?
Attachments
Example1.GIF
one pic
Example1.GIF (39.43 KiB) Viewed 27329 times
Example2.GIF
two pic
Example2.GIF (35.17 KiB) Viewed 27328 times
Example3.GIF
three pic
Example3.GIF (4.9 KiB) Viewed 27329 times
TRIPPLITE-MIB.zip
tripp lite mib
(11.65 KiB) Downloaded 891 times

User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Second post

#6 Post by chrisgapske » Wed Aug 15, 2007 2:23 pm

I was having trouble putting images on this as it would just break.

I was able to see everything install ok just not get graphing from it.

Help would be great if you have any ideas.

Chris.

User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Interesting

#7 Post by chrisgapske » Tue Oct 02, 2007 8:31 am

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?

User avatar
chrisgapske
Cacti User
Posts: 278
Joined: Tue May 22, 2007 7:56 am
Location: Pensacola, Fl - Padacuh, Ky-Alpena, MI-Gulf Shores,AL

Error I am getting.

#8 Post by chrisgapske » Tue Oct 09, 2007 7:49 am

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.

Chris.
Attachments
snmp.zip
Both the Poweralert_ups_status.php and snmp.php. Incase I am missing somthing.
(5.72 KiB) Downloaded 614 times

variable
Posts: 5
Joined: Sun Aug 17, 2008 2:19 pm

#9 Post by variable » Sun Aug 17, 2008 2:20 pm

Will this work directly with the UPS? IE. with the websnmp card?

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#10 Post by ehall » Tue Apr 28, 2009 8:19 pm

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.

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#11 Post by ehall » Wed Apr 29, 2009 2:00 pm

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

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#12 Post by ehall » Sun Jun 21, 2009 6:03 pm

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.

I've also moved the files to this page on my web server so that I can more easily maintain them

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Re: TrippLite PowerAlert UPS stats -- update November 11, 20

#13 Post by ehall » Thu Nov 11, 2010 9:30 pm

I've uploaded a new version that is compatible with 0.8.7g

http://www.eric-a-hall.com/software/cacti-poweralert/

ssinay
Posts: 3
Joined: Fri Dec 03, 2010 5:59 pm

Re: TrippLite PowerAlert UPS stats -- update November 11, 20

#14 Post by ssinay » Fri Dec 03, 2010 6:04 pm

Eric,

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:::::::3664: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:::::::3664: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:::::::3664: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.

Thanks!

ssinay
Posts: 3
Joined: Fri Dec 03, 2010 5:59 pm

Re: TrippLite PowerAlert UPS stats -- update November 11, 20

#15 Post by ssinay » Thu Dec 16, 2010 3:54 pm

Discovered in the guide it says it's for php 5.2.

Mine is:


PHP 5.3.3-1ubuntu9.1 with Suhosin-Patch (cli) (built: Oct 15 2010 14:17:04)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies


I know the move to 5.3 broke some compat stuff across the board. Are there any plans for a future release? :)

Post Reply