Network UPS Tools template -- update November 11, 2010

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

Moderators: Developers, Moderators

andyburns
Posts: 5
Joined: Wed Apr 15, 2009 8:50 am

Post by andyburns »

ehall wrote:sorry for the trouble, these are on my list of templates to update for 0.8.7 and I'll try to clean them up when I get there
Well it was still easier to use your package than last time I was monitoring a UPS, by extracting results from nut's upsc and feeding it direct to rrdtool. :D
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

I uploaded a new version of the tarball that should be cleaner. One of the graph templates had become corrupted somehow and appears to have been the source of the problems.
bobr
Posts: 1
Joined: Tue Jun 09, 2009 4:51 pm

Post by bobr »

Hello. First of I'm new to graphing ups data. I use cacti already for local server and seperate storage snmp enabled server. All is fine with that.
Now I would like to connect NUT with cacti using this template but I'm having issues :(. I use ubuntu 8.04.2 with standard packages and I followed all steps as instructed.

Importing template gave me this unmet dependency:

Code: Select all

GPRINT Preset
[success] Normal [update]

Data Input Method
[success] Get Script Data (Indexed) [update]

Data Template
[success] NUT - UPS Status [update]

Graph Template
[success] UPS - NUT - UPS Temperature [update]
[success] UPS - NUT - UPS Load Capacity [update]
[success] UPS - NUT - UPS Power Signal [update]

Data Query
[success] NUT - UPS Statistics [update]
   + Found Dependency: (Data Input Method) Get Script Data (Indexed)
   + Found Dependency: (Graph Template) UPS - NUT - UPS Power Signal
   + Found Dependency: (Data Template) NUT - UPS Status
   + Unmet Dependency: (Data Template Item)
   + Found Dependency: (Graph Template) UPS - NUT - UPS Load Capacity
   + Found Dependency: (Data Template Item) batteryCharge
   + Found Dependency: (Data Template Item) upsLoad
   + Found Dependency: (Graph Template) UPS - NUT - UPS Temperature
   + Found Dependency: (Data Template Item) upsTemperature
After creating all relevant graphs I'm getting data for battery charge. This one shows 100 as it should.
Temperature and output load shows me zero. :roll:
Power signal graph is not visible at all and gives me this debuging error: :roll:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Server - UPS Power Signal - Tripplite" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="quality" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/lib/cacti/rra/server_upstemperature_33.rrd":inputVoltage:AVERAGE \
DEF:b="/var/lib/cacti/rra/server_upstemperature_33.rrd":inputFrequency:AVERAGE \
DEF:c="/var/lib/cacti/rra/server_upstemperature_33.rrd":batteryVoltage:AVERAGE \
LINE1:a#00FF00FF:"Input Voltage"  \
GPRINT:a:LAST:"  Current\:%8.2lf%s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:a:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:b#0000FFFF:"Input Frequency"  \
GPRINT:b:LAST:"Current\:%8.2lf%s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:b:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:c#FF00FFFF:"Battery Voltage"  \
GPRINT:c:LAST:"Current\:%8.2lf%s"  \
GPRINT:c:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:c:MIN:"Minimum\:%8.2lf%s"  \
GPRINT:c:MAX:"Maximum\:%8.2lf%s\n" 

RRDTool Says:

ERROR: reading the cookie off /var/lib/cacti/rra/server_upstemperature_33.rrd faild
Ups is working fine by the way:

Code: Select all

root@atom:# upsc tripplite@localhost
battery.charge: 100
battery.voltage: 13.4
driver.name: tripplite
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyS0
driver.version: 2.2.1-
driver.version.internal: 0.8
input.frequency: 50.20
input.voltage: 118
input.voltage.maximum: 118
input.voltage.minimum: 118
ups.delay.reboot: 64
ups.delay.shutdown: 64
ups.delay.start: 60
ups.firmware: DB
ups.load:  18
ups.mfr: Tripp Lite
ups.model: Smart 2200
ups.status: OL
ups.temperature:  47
ups.test.result: OK
Is there any good soul out there who can help me out? :oops:
Attachments
Screenshot of curent situation
Screenshot of curent situation
ups.JPG (53.25 KiB) Viewed 24353 times
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

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 NUT protocol 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
johnjore
Posts: 1
Joined: Mon Dec 07, 2009 12:45 pm

Hm..

Post by johnjore »

Hi!
Just tried to import the template and I got a lot of "Unmet Dependency" in Graph Templet, UPS Power Input. (around 15)

And 3 "Unmet Dependency" in Data Query / UPS Statistics.

New installation of 0.8.7e. I could run the php script manually and it works with the remote UPS, no issues there.

Any ideas?


Somehow managed to get graphs generated, but 4 of 5 numbers are wrong:

batteryCharge: 40, upsc says battery.charge: 100
OutputLoad: 40, upsc says ups.load: 30
Inputvoltage: 100, upsc says input.voltage: 249.0
InputFreq: NaN, upsc says input.frequency: 50.0

Correct:
BatteryVoltage: 40, upsc says battery.voltage: 40.0


Btw, php ss_nut_ups_status.php 192.168.1.41:: get <div> ups0
shows all the correct values.

Someting is a bit fishy here...


JJ

PS: My ups does not support temperature reading. Could this be the reason the script failes?



PS2: That was the error. Modified the script and removed temperature readings, all values look ok now. As a feature request I would suggest modifying the script to check if the read values are "legal" for the UPS type and gracefully handle a failure.
atrias
Posts: 25
Joined: Sat Dec 29, 2007 8:01 am

Post by atrias »

my UPS also does not support temperature and I also got unmet dependencies while importing the template

can you tell me what changes did you make on the script?

Code: Select all

Cacti has imported the following items:

GPRINT Preset
[success] Normal [update]

Data Input Method
[success] Get script Server Data (Indexed) [update]

Data Template
[success] NUT - UPS Status [new]

Graph Template
[success] UPS - NUT - UPS Temperature [new]
[success] UPS - NUT - UPS Load Capacity [new]
[success] UPS - NUT - UPS Power Input [new]
   + Unmet Dependency: (Data Template Item)
   + Found Dependency: (GPRINT Preset) Normal
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)

Data Query
[success] NUT - UPS Statistics [new]
   + Found Dependency: (Data Input Method) Get Script Server Data (Indexed)
   + Found Dependency: (Graph Template) UPS - NUT - UPS Power Input
   + Found Dependency: (Data Template) NUT - UPS Status
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Unmet Dependency: (Data Template Item)
   + Found Dependency: (Graph Template) UPS - NUT - UPS Load Capacity
   + Found Dependency: (Data Template Item) batteryCharge
   + Found Dependency: (Data Template Item) upsLoad
   + Found Dependency: (Graph Template) UPS - NUT - UPS Temperature
   + Found Dependency: (Data Template Item) upsTemperature
now the load capacity graph works OK
the temperature graph shows NaN (that is expected because my UPS does not show temperature)
but the power input graph should be working but it doesn't

my cacti is 0.8.7e
atrias
Posts: 25
Joined: Sat Dec 29, 2007 8:01 am

Post by atrias »

i found the solution

the error is in the graph template of Power Input

you must click each item and select the appropriate data source because after the template import it was <none>

input voltage for items 1-5
input frequency for items 6-10
battery voltage for items 11-15

after that you must go to Data Queries , select NUT - UPS Statistics and then Power Input

then you select the appropriate data source and check the box for
battery voltage
input frequency
input voltage
Emilien
Posts: 17
Joined: Tue Sep 23, 2008 3:08 pm

Post by Emilien »

I have the same problem with Power Input graph.
atrias wrote:i found the solution

the error is in the graph template of Power Input

you must click each item and select the appropriate data source because after the template import it was <none>

input voltage for items 1-5
input frequency for items 6-10
battery voltage for items 11-15
Can you explain me more about this, in what menu entry I must go to do this?

Best regards,

Emilien :)
Ilya Evseev
Posts: 11
Joined: Sun Mar 01, 2009 7:39 am
Location: Saint-Petersburg, Russia
Contact:

Post by Ilya Evseev »

I have the same problem with cacti-nut.0.5.tar.gz

How to use nut_ups_status_data_query.xml?
As the update for cacti-nut or as standalone template installed on clean system?
Attachments
install_problems_selected.png
install_problems_selected.png (38.12 KiB) Viewed 22478 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Network UPS Tools template -- update June 21, 2009

Post by TheWitness »

The original author needs to run the repair template script on the template and then re-publish it.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Ilya Evseev
Posts: 11
Joined: Sun Mar 01, 2009 7:39 am
Location: Saint-Petersburg, Russia
Contact:

Re: Network UPS Tools template -- update June 21, 2009

Post by Ilya Evseev »

TheWitness wrote:The original author needs to run the repair template script on the template
cacti/cli/repair_templates.php? It seems useless for that... :(
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Re: Network UPS Tools template -- update November 11, 2010

Post by ehall »

I uploaded a new version that is compatible with 0.8.7g

http://www.eric-a-hall.com/software/cacti-nut/
Ilya Evseev
Posts: 11
Joined: Sun Mar 01, 2009 7:39 am
Location: Saint-Petersburg, Russia
Contact:

Re: Network UPS Tools template -- update November 11, 2010

Post by Ilya Evseev »

ehall wrote:I uploaded a new version that is compatible with 0.8.7g

http://www.eric-a-hall.com/software/cacti-nut/
Cacti-0.8.7f, php-5.2.11, cacti-nut 0.6:
Cacti has imported the following items:

GPRINT Preset

[success] Normal [update]
Data Input Method

[success] Get script Server Data (Indexed) [update]
Data Template

[success] NUT - UPS Status [new]
Graph Template

[success] UPS - NUT - UPS Temperature [new]
[success] UPS - NUT - UPS Load Capacity [new]
[success] UPS - NUT - UPS Power Input [new]
+ Unmet Dependency: (Data Template Item)
+ Found Dependency: (GPRINT Preset) Normal
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
Data Query

[success] NUT - UPS Statistics [update]
+ Found Dependency: (Data Input Method) Get Script Server Data (Indexed)
+ Found Dependency: (Graph Template) UPS - NUT - UPS Power Input
+ Found Dependency: (Data Template) NUT - UPS Status
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
+ Found Dependency: (Graph Template) UPS - NUT - UPS Load Capacity
+ Found Dependency: (Data Template Item) batteryCharge
+ Found Dependency: (Data Template Item) upsLoad
+ Found Dependency: (Graph Template) UPS - NUT - UPS Temperature
+ Found Dependency: (Data Template Item) upsTemperature
Eliza30
Posts: 1
Joined: Thu Jun 30, 2011 6:05 am

Re: Network UPS Tools template -- update November 11, 2010

Post by Eliza30 »

Network tool can be very useful for the functioning of the Office. Once you have this tool to your system, you can index hundreds and hundreds of files, the entire network. When you set up folders, directories, and the places you want to index, you can run a search for one or more files that you need a few seconds. This victory will contact each team behind and ask them if they remember to create a physical file on hand. Fortunately for you, if the writer in question is a very large memory.


network tools
merlin956
Posts: 1
Joined: Thu Aug 11, 2011 10:01 pm

Re: Network UPS Tools template -- update November 11, 2010

Post by merlin956 »

I am not having much luck installing this template.

I get all the unmet dependencies previously mentioned but I am not all that worried about them, I am sure I can fix them when I get the query working.

I have the latest nut installed for Ubuntu Natty 11.04

I have an Eaton Powerware 5110 attached to the USB port and get the following output from upsc:

ambient.temperature.high: 1
battery.charge.low: 22
battery.voltage: 27.7
device.mfr: Eaton
device.model: POWERWARE UPS 1000i
device.serial: ����
device.type: ups
driver.name: bcmxcp_usb
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.internal: 0.23
input.frequency: 50.1
input.frequency.high: 55
input.frequency.low: 45
input.frequency.nominal: 50
input.transfer.boost.high: 216
input.transfer.high: 280
input.transfer.low: 186
input.transfer.trim.low: 260
input.voltage: 242
input.voltage.nominal: 240
output.current: 0.0
output.current.nominal: 2.5
output.frequency: 50.1
output.phases: 1
output.voltage: 242
output.voltage.nominal: 240
ups.beeper.status: enabled
ups.firmware: Cont:00.50 Inve:01.50
ups.load: 0.0
ups.mfr: Eaton
ups.model: POWERWARE UPS 1000i
ups.power.nominal: 1000
ups.serial: ����
ups.status: OL

running the following query gives the expected result:

php /usr/share/cacti/site/scripts/ss_nut_ups_status.php localhost:: query ups.description
eaton:Eaton Powerware 5110

however when I try to run this query I get:

php /usr/share/cacti/site/scripts/ss_nut_ups_status.php 127.0.0.1:: query input.frequency eaton
FATAL: Unable to locate the requested data in NUT output

I don't know much PHP but it seems to be this test that fails:

if (preg_match("/^VAR \S+ \S+ \"(\d*\.?\d*)\"$/", $nut_response, $scratch) == 0) {

and a couple of echo's to show the data that is being processed show:

nut_response: VAR eaton input.frequency " 50.1"

scratch: Array

however that is the extent of my PHP. I have no idea where to go from here.

Can anyone point me towards a solution?

Thanks in advance.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests