Created
February 2, 2024 20:50
-
-
Save mrl22/b38ae7a9e74b261ad91146b080ea72c2 to your computer and use it in GitHub Desktop.
APCUPSD / APCACCCESS - Get power consumption in Watts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
APC=$(apcaccess status) | |
NOMPOWER=$(echo "$APC"|grep NOMPOWER|cut -d' ' -f3) | |
LOADPCT=$(echo "$APC"|grep LOADPCT|cut -d' ' -f4) | |
WATTS=$(echo "$NOMPOWER / $LOADPCT"|bc) | |
echo "$WATTS Watts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment