Network UPS Tools template -- update November 11, 2010
Moderators: Developers, Moderators
Network UPS Tools template -- update November 11, 2010
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 <--
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.
Problems with query and template import
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.
I am using Cacti 0.8.6.i and PHP 5.1.6 on Fedora Core 5.
- Attachments
-
- Results of importing cacti_data_query_nut_ups_statistics.xml
- import_data_query.jpg (122.97 KiB) Viewed 74481 times
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.
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
-
- importing cacti_graph_template_ups_nut_ups_power_signal.xml
- 20060209-import-graph-tmplt-pwrsig.jpg (85.58 KiB) Viewed 74435 times
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.
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.
Got it working
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!
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 6066 times
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.
($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.
-
- Posts: 3
- Joined: Tue Jul 10, 2007 7:07 pm
Hmm, that shouldn't be necessary. I just fixed the broken templates, and my graphs look just like the screenshots.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.
-
- Posts: 9
- Joined: Tue Aug 28, 2007 11:01 am
Not getting device.
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,
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,
cacti nut php success
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!
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!
Re: cacti nut php success
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.lvecsey wrote:I finally got these nut php script graphs to work.
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 ...
Who is online
Users browsing this forum: No registered users and 0 guests