Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Network UPS Tools template -- update June 21, 2009
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
ehall
Cacti User


Joined: 09 Dec 2005
Posts: 237

PostPosted: Wed Jan 24, 2007 9:35 am    Post subject: Network UPS Tools template -- update June 21, 2009 Reply with quote

I've been experimenting with Network UPS Tools package under Linux latetely, and put together this template for device monitoring.



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 Tue Jun 23, 2009 11:27 am; edited 8 times in total
Back to top
jrhodes



Joined: 30 Aug 2006
Posts: 3

PostPosted: Thu Feb 08, 2007 6:41 pm    Post subject: Problems with query and template import Reply with quote

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.



import_data_query.jpg
 Description:
Results of importing cacti_data_query_nut_ups_statistics.xml
 Filesize:  122.97 KB
 Viewed:  24966 Time(s)

import_data_query.jpg


Back to top
ehall
Cacti User


Joined: 09 Dec 2005
Posts: 237

PostPosted: Thu Feb 08, 2007 11:33 pm    Post subject: Reply with quote

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.
Back to top
jrhodes



Joined: 30 Aug 2006
Posts: 3

PostPosted: Fri Feb 09, 2007 12:02 pm    Post subject: Reply with quote

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.



20060209-import-graph-tmplt-pwrsig.jpg
 Description:
importing cacti_graph_template_ups_nut_ups_power_signal.xml
 Filesize:  85.58 KB
 Viewed:  24920 Time(s)

20060209-import-graph-tmplt-pwrsig.jpg


Back to top
ehall
Cacti User


Joined: 09 Dec 2005
Posts: 237

PostPosted: Fri Feb 09, 2007 4:41 pm    Post subject: Reply with quote

I uploaded the tarfile again, this time with the script_queries directory included...
Back to top
jrhodes



Joined: 30 Aug 2006
Posts: 3

PostPosted: Mon Feb 12, 2007 5:09 pm    Post subject: Reply with quote

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.
Back to top
Wilmer



Joined: 02 Jul 2007
Posts: 2

PostPosted: Mon Jul 02, 2007 6:03 pm    Post subject: Got it working Reply with quote

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!



cacti_data_query_nut_ups_statistics.xml
 Description:

Download
 Filename:  cacti_data_query_nut_ups_statistics.xml
 Filesize:  32.24 KB
 Downloaded:  1291 Time(s)

Back to top
Mark.



Joined: 03 Jul 2007
Posts: 47
Location: San Luis Obispo

PostPosted: Fri Jul 06, 2007 9:48 am    Post subject: Reply with quote

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.
Back to top
cactiuser2



Joined: 10 Jul 2007
Posts: 3

PostPosted: Wed Jul 11, 2007 1:04 am    Post subject: Reply with quote

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.
Back to top
Mark.



Joined: 03 Jul 2007
Posts: 47
Location: San Luis Obispo

PostPosted: Wed Jul 11, 2007 2:38 pm    Post subject: Reply with quote

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.
Back to top
Wilmer



Joined: 02 Jul 2007
Posts: 2

PostPosted: Tue Jul 24, 2007 5:42 pm    Post subject: Reply with quote

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.
Back to top
tropicalview



Joined: 28 Aug 2007
Posts: 9

PostPosted: Tue Aug 28, 2007 11:07 am    Post subject: Not getting device. Reply with quote

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:



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

Kind regards,
Back to top
lvecsey



Joined: 06 May 2008
Posts: 4

PostPosted: Tue May 06, 2008 4:33 am    Post subject: cacti nut php success Reply with quote

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!
Back to top
andyburns



Joined: 15 Apr 2009
Posts: 5

PostPosted: Sun Apr 19, 2009 12:27 pm    Post subject: Re: cacti nut php success Reply with quote

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 ...
Back to top
ehall
Cacti User


Joined: 09 Dec 2005
Posts: 237

PostPosted: Sun Apr 19, 2009 1:45 pm    Post subject: Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group