Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Pushing CyberPower UPS to Grafana

Featured Replies

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.

  • 5 months later...

@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 by surfshack66

  • 2 weeks later...
  • 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!

  • 3 weeks later...
  • 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 by d.ohlin

  • 2 months later...

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

 

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.