Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue May 23, 2017 9:37 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 36 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Network UPS Tools template -- update November 11, 2010
PostPosted: Wed Jan 24, 2007 9:35 am 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
I've been experimenting with Network UPS Tools package under Linux latetely, and put together this template for device monitoring.

Image

Specifically, this plugin uses PHP sockets to open a connection to the NUT daemon on the target host, and then uses the NUT protocol to enumerate and query the UPS devices for operational details. This model allows for more flexibility and speed over alternative approaches, but the downside is that you must have the PHP sockets library installed and operational.

--> see this page for the tarball and instructions <--


Last edited by ehall on Thu Nov 11, 2010 9:24 pm, edited 9 times in total.

Top
 Profile  
 
 Post subject: Problems with query and template import
PostPosted: Thu Feb 08, 2007 6:41 pm 
Offline

Joined: Wed Aug 30, 2006 5:18 pm
Posts: 3
I had trouble importing both the cacti_data_query_nut_ups_statistics.xml and the cacti_graph_template_ups_nut_ups_power_signal.xml files. Both imports reported 'Unmet Dependency: (Data Template Item)' multiple times.

I am using Cacti 0.8.6.i and PHP 5.1.6 on Fedora Core 5.


Attachments:
File comment: Results of importing cacti_data_query_nut_ups_statistics.xml
import_data_query.jpg
import_data_query.jpg [ 122.97 KiB | Viewed 58919 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 08, 2007 11:33 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
I exported everything possible. Delete whatever you've already got, import all the XML files, and copy the script to the right place. Let me know if that fixes it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 09, 2007 12:02 pm 
Offline

Joined: Wed Aug 30, 2006 5:18 pm
Posts: 3
Still having problems. I deleted everything related to Network UPS Tool and re-imported in the following order (not sure if order matters):

1) cacti_data_template_nut_ups_status.xml (no errors)
2) cacti_graph_template_ups_nut_ups_load_capacity.xml (no errors)
3) cacti_graph_template_ups_nut_ups_temperature.xml (no errors)
4) cacti_graph_template_ups_nut_ups_power_signal.xml (unmet dependencies)
5) cacti_data_query_nut_ups_statistics.xml (unmet dependencies)

Attached is a screenshot of importing the power signal template.

I have also determined that the nut_ups_status.php is getting called. However it looks like the RRD files are not being generated.


Attachments:
File comment: importing cacti_graph_template_ups_nut_ups_power_signal.xml
20060209-import-graph-tmplt-pwrsig.jpg
20060209-import-graph-tmplt-pwrsig.jpg [ 85.58 KiB | Viewed 58873 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 09, 2007 4:41 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
I uploaded the tarfile again, this time with the script_queries directory included...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 5:09 pm 
Offline

Joined: Wed Aug 30, 2006 5:18 pm
Posts: 3
Didn't help. I deleted the NUT data queries, graph templates and data templates along with the scripts. I reinstalled the php and xml scripts, and reimported all templates. I still get the Unmet Dependency messages on importing the cacti_graph_template_nut_ups_power_signal.xml and cacti_data_query_but_ups_statistics.xml files.

If I add these graphs do a device, I can see where the cacti poller is successfully calling the php script and adding the results to the poller_output table. But cacti is not producing an RRD file for the graph.

Please let me know if I can provide any additional information.


Top
 Profile  
 
 Post subject: Got it working
PostPosted: Mon Jul 02, 2007 6:03 pm 
Offline

Joined: Mon Jul 02, 2007 5:58 pm
Posts: 2
Heya,

After some tedious fixing I got this to work. I'm attaching my version of the .xml, but I wouldn't be surprised if this gives the same errors again. First of all, the data query file seems to be the only thing you have to import. It automatically includes all the other things.

So just import it, either my version or the original one. If you get unmet dependencies again, you can just fix up the data query + graph template (?) yourself. What happens is it loses the actual fields to graph, so if you manually reselect them everything will be fine again.

Before importing this, you might want to get rid of all the old UPS stuff first. My db was a total mess, I had to clean up parts of it by hand using the MySQL command-line client.

Good luck!


Attachments:
cacti_data_query_nut_ups_statistics.xml [32.24 KiB]
Downloaded 2593 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 06, 2007 9:48 am 
Offline
Cacti User
User avatar

Joined: Tue Jul 03, 2007 4:11 pm
Posts: 82
Location: San Luis Obispo
I took a look at these files and I don't see where you put the OID's. I did see that you put attribute descriptions.

($cacti_request_type != "ups.description") &&
($cacti_request_type != "battery.charge") &&

etc.

Is this what cacti will use to obtain the information requested? If so, the names in my MIB tree on my TrippLite 3000 are slightly different..
"upsIdentName"
"upsEstimatedChargeRemaining"

I don't think you would use this to gather the stats we would want, so where is the file that would contain the OID's for each of these? Is this something that needs to be configured on my end? If so, where (or which file)?
Obviously I don't know much about this all yet,, but I'm reading as much info as I can. Thanks in advance for any help I can get from you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 1:04 am 
Offline

Joined: Tue Jul 10, 2007 7:07 pm
Posts: 3
Mark. wrote:
I took a look at these files and I don't see where you put the OID's. I did see that you put attribute descriptions.


This doesn't use OIDs because it's not using SNMP. It's querying upsd using the upsd protocol. You need to configure upsd to talk to your particular UPS first.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 2:38 pm 
Offline
Cacti User
User avatar

Joined: Tue Jul 03, 2007 4:11 pm
Posts: 82
Location: San Luis Obispo
Cactiuser2,
Thanks for your help on that. I scrapped these xml files and created single OID data templates. Created my own graph templates. It took some time to learn all of that, and the graphs don't look nearly as good, yet, but I learned a lot about how cacti works.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 5:42 pm 
Offline

Joined: Mon Jul 02, 2007 5:58 pm
Posts: 2
Mark. wrote:
Cactiuser2,
Created my own graph templates. It took some time to learn all of that, and the graphs don't look nearly as good, yet, but I learned a lot about how cacti works.

Hmm, that shouldn't be necessary. I just fixed the broken templates, and my graphs look just like the screenshots.


Top
 Profile  
 
 Post subject: Not getting device.
PostPosted: Tue Aug 28, 2007 11:07 am 
Offline

Joined: Tue Aug 28, 2007 11:01 am
Posts: 9
Hi.

I tried to install this.
and got the same error as reported before with the dependancy's/

1 of the 2 was solved by a update in this issue, but the second one still exists.


now when i tried to execute number 4 of the howto, i did not get the list of ups's

the thing i saw was:
Image


does anybody know what i'm doing wrong?
the ups is connected to the localhost.
the ups just called UPS

Kind regards,


Top
 Profile  
 
 Post subject: cacti nut php success
PostPosted: Tue May 06, 2008 4:33 am 
Offline

Joined: Tue May 06, 2008 4:24 am
Posts: 4
After spending a week getting familiar with cacti, I finally got these nut php script graphs to work. After importing the templates the trick was to

1. go into the Console under Templates area, and select Data Templates, then NUT - UPS Status

2. You need to x out the duplicate entries for inputVoltage, batteryVoltage, etc. Just make sure the first tab of each type is listed, only. Click save.

3. go into the Console under the Collection Methods area, and select Data Queries

4. Click through to the NUT Load Capacity, Power Signal, and Temperature templates to make sure the corresponding fields like inputVoltage match; fix them if needed so they correspond again and click save.

Those were the main ones. From here, another helpful tip is to go into Data Sources under the Management area, and select each of the UPS Nut entries. When you go in there you will see a 'turn on data source debug mode' at the top right of the cacti screen. When you click that, you should see the rrdtool create command show up where you can confirm that inputVoltage, batteryVoltage, etc, are each listed just once. If cacti has trouble creating this you can paste that entire command into a shell into the /var/lib/cacti/rra directory or similar, then fix the permissions on the file that gets created.

Perhaps the next person will fill in any further gaps that I've missed. good luck!


Top
 Profile  
 
 Post subject: Re: cacti nut php success
PostPosted: Sun Apr 19, 2009 12:27 pm 
Offline

Joined: Wed Apr 15, 2009 8:50 am
Posts: 5
lvecsey wrote:
I finally got these nut php script graphs to work.


I had several "wrinkles" trying to get these scripts working, First I got the "unmet dependencies" errors when importing the templates, regardless of what order I imported them in.

Then as suggested by lvecsey, I deleted the duplicate data source items (Data Templates, NUT - UPS Status) if you have more than six data source items, delete duplicates until you just have

1: batteryCharge Delete
2: batteryVoltage Delete
3: inputFrequency Delete
4: inputVoltage Delete
5: upsLoad Delete
6: upsTemperature Delete

then when I added the NUT Data Query to an existing host, and added three graphs for ups load-capacity, temperature, power-signal, it seems reluctant to add all the required Data Sources, I ended up with two temperature sources, I could change one of them to a capacity source, but it won't add a power-signal data source, and I can't manually add one, it said it had to be done through add graphs for host


The power signal data query had no associated data templates, I had to edit the data source for each graph template item on the power signal graph template, and "re-connect" the graph items to the relevant data sources undr associated graph/data templates

Boy! I always end up almost hating cacti's naming of data sources, templates, items and associated this, that, the other when I edit something ... :cry:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 19, 2009 1:45 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group