April 17, 20188 yr Hi all, I wasn't exactly sure which forum section to ask this in, so apologies in advance if this is the wrong place. I am wondering if anyone has an idea how to install CyberPower PowerPanel Business Edition on my unRAID machine? My unRAID server is connected by usb to a CyberPower UPS which shuts the server down during a power loss as desired. However, I would like to install PowerPanel Business Edition for Virtual Machines so that I can push my CyberPower UPS's info to Grafana using Telegraf and InfluxDB (possibly using this docker, though I'm not sure if I can do it more directly). I found this guide for setting this up on ESXI, but since unRAID can't load VMs from OVA or OVF files I'm not sure what to do exactly. Does anyone know if it's possible to create a VM running centOS on Unraid and then install PowerPanel Business Edition for Virtual Machines within that VM and still push the data to Grafana running in another docker on the host? Or does anyone have another suggestion for how to monitor my UPS within Grafana? Thanks.
September 24, 20187 yr @zandrsn Did you ever figure this out? I want my cyberpower ups stats in grafana as well. Instead of a VM, its possible (although not sure how to do this exactly) to install PPBE in a docker using WINE.... Edited September 24, 20187 yr by surfshack66
September 25, 20187 yr I believe another way to achieve this is to use the NUT plugin and output the upsc results to telegraf or directly to influxdb. Here a couple ways I have found....would appreciate someone with more experience to help get this to work on unraid.. https://agrrh.com/2017/gathering-ups-metrics-with-nut-and-telegraf https://github.com/lf-/influx_nut
September 26, 20187 yr I got this working on mine. I used this https://technicalramblings.com/blog/setting-grafana-influxdb-telegraf-ups-monitoring-unraid/ You can do this with NUT too however I don't know how the syntax to write a user script in linux. You are able to display NUT's output, so I'm sure there is a way to input it into Influx.
October 10, 20187 yr Author Sorry for the slow reply, I did end up getting it working. I'll be honest though, I'm not sure I remember everything since I probably fixed this at around 3am while procrastinating on something else, but (if memory serves) I used the User Scripts plugin and the script posted here to send my UPS data to my InfluxDB Grafana database. Hope that helps!
October 26, 20187 yr Community Expert For what it's worth, here is the version of the script that @zandrsn mentioned that I heavily modified for use with Nut...this is working to pull what I wanted to pull from my USB-connected Liebert GXT3 UPS. Also I'm terrible with this kind of stuff, so this took me several hours last night and there's probably stuff that could be improved LOL but if anyone else can get use out of it then I figure I might as well post it here to share! #!/usr/bin/php <?php $command = "upsc"; $args = "ups"; $tagsArray = array( "battery.charge", "device.model", "ups.status" ); //do system call $call = $command." ".$args; $output = shell_exec($call); //parse output for tag and value foreach ($tagsArray as $tag) { preg_match("/".$tag."\s*:\s*([\w|\s|\.|\/]+)\n/si", $output, $matches); //send measurement, tag and value to influx #print("$matches[1],$tag"); sendDB($matches[1], $tag); } //end system call //send to influxdb function sendDB($val, $tagname) { $curl = "curl -i -XPOST 'http://[influxdb_ip]:8086/write?db=nut' --data-binary 'ups,host=tower,region=us-west $tagname=\"$val\"'"; $excsr = exec($curl); } ?> Edited October 26, 20187 yr by d.ohlin
January 15, 20197 yr I've been trying to get this to work for my dell UPS on nut, but always end up with this error: Can't seem to figure out the issue! Parse error: syntax error, unexpected '$call' (T_VARIABLE) in /tmp/user.scripts/tmpScripts/UPS Monitor/script on line 14
January 17, 20197 yr modified to the following & everything is working after a few modifications as I have actual wattage used instead of Percentage.... #!/usr/bin/php <?php $command = "upsc"; $args = "ups"; $tagsArray = array( "battery.charge", "device.model", "ups.realpower", "ups.load", "battery.runtime", "output.voltage" ); //do system call $call = $command." ".$args; $output = shell_exec($call); //parse output for tag and value foreach ($tagsArray as $tag) { preg_match("/".$tag."\s*:\s([\d|\.]+)/si", $output, $match); //send measurement, tag and value to influx sendDB($match[1], $tag); } //end system call //send to influxdb function sendDB($val, $tagname) { $curl = "curl -i -XPOST 'http://192.168.0.XX:8086/write?db=UPS' --data-binary 'APC,host=Tower,region=us-west " .$tagname."=".$val."'"; $execsr = exec($curl); } ?>
Archived
This topic is now archived and is closed to further replies.