OK, this is a long post, and for that I apologize. It contains information on changes/additions required to several hobbit config files and it also contains several scripts in their entirety (cut and pasted from a working server)
I also apologize for the serious lack of any real documentation here. This post was thrown together quickly, to get the information out into the wild. Hopefully this will be addressed in the near future (by me or by someone else with a lot of free time) and this post will be properly organized and migrated to the shire.
Some things to note:
First and foremost, a NUT (Network UPS Tools) server managing at least one UPS is required since this hobbit monitoring implementation pulls UPS data points from a NUT server.
This configuration has been in place for about 3 months monitoring the bat-charge, bat-voltage, in-voltage, out-voltage and ups-load on two APC1500 UPSes and has performed well for me. Your mileage may vary.
The scripts, graphs, and other configurations listed here represent the required configurations for hobbit to monitor two UPSes attached to one NUT server. You will need to modify much of this, paying careful attention to UPS names etc. In other words, everywhere you see two UPSes defined, strip one out and rename the remaining one to match your environment.
While the plan was to write the scripts so that they are able to monitor multiple UPSes connected to multiple NUT UPS servers, I know that as written they will not work properly. Once I have more NUT servers up, this will be addressed. They currently work fine with multiple UPSes attached to one NUT server, however.
Please report back to me if you are able to successfully implement this configuration. It would be encouraging to know that others have found this to be useful and it may force me to find the time to clean it up for the shire. :)
Comments are welcomed
What follows is a BARE BONES listing of what changes need to be made to your hobbit system files and the scripts used to pull the data and report back to the hobbit server.
Please read though each of the lists, and each of the scripts, modifying system names, UPS names, IP addresses as you see fit before simply cutting and pasting any of this. You should also read through and understand the the "how to set up custom graphs" help file here: http://your.hobbit.server.ip/hobbit/help/howtograph.html to get an understanding of how this all fits together.
----[hobbitserver.cfg changes]---- Add the following definitions to the TEST2RRD variable: "bat-charge=ncv,bat-voltage=ncv,in-voltage=ncv,out-voltage=ncv,ups-load=ncv"
Add the following definitions to the GRAPHS variable: "bat-charge,bat-voltage,in-voltage,out-voltage,ups-load"
Add the following NCV definition lines to the end of the file: NCV_bat-charge="apc1500115:GAUGE,apc1500117:GAUGE" NCV_bat-voltage="apc1500115:GAUGE,apc1500117:GAUGE" NCV_in-voltage="apc1500115:GAUGE,apc1500117:GAUGE" NCV_out-voltage="apc1500115:GAUGE,apc1500117:GAUGE" NCV_ups-load="apc1500115:GAUGE,apc1500117:GAUGE" ----[end of hobbitserver.cfg changes]----
----[hobbitgraph.cfg changes]---- Add the following graph definitions to the hobbitgraph.cfg file:
[bat-charge] TITLE Battery % Charge YAXIS % DEF:apc1500115=bat-charge.rrd:apc1500115:AVERAGE DEF:apc1500117=bat-charge.rrd:apc1500117:AVERAGE LINE2:apc1500115#00CCCC:apc1500-115 LINE2:apc1500117#FF0000:apc1500-117 COMMENT:\n GPRINT:apc1500115:LAST: apc1500-115 \: %5.1lf%s (cur) GPRINT:apc1500115:MAX: \: %5.1lf%s (max) GPRINT:apc1500115:MIN: \: %5.1lf%s (min) GPRINT:apc1500115:AVERAGE: \: %5.1lf%s (avg)\n GPRINT:apc1500117:LAST: acp1500-117 \: %5.1lf%s (cur) GPRINT:apc1500117:MAX: \: %5.1lf%s (max) GPRINT:apc1500117:MIN: \: %5.1lf%s (min) GPRINT:apc1500117:AVERAGE: \: %5.1lf%s (avg)\n [bat-voltage] TITLE Battery VDC YAXIS VDC DEF:apc1500115=bat-voltage.rrd:apc1500115:AVERAGE DEF:apc1500117=bat-voltage.rrd:apc1500117:AVERAGE LINE2:apc1500115#00CCCC:apc1500-115 LINE2:apc1500117#FF0000:apc1500-117 COMMENT:\n GPRINT:apc1500115:LAST: apc1500-115 \: %5.1lf%s (cur) GPRINT:apc1500115:MAX: \: %5.1lf%s (max) GPRINT:apc1500115:MIN: \: %5.1lf%s (min) GPRINT:apc1500115:AVERAGE: \: %5.1lf%s (avg)\n GPRINT:apc1500117:LAST: acp1500-117 \: %5.1lf%s (cur) GPRINT:apc1500117:MAX: \: %5.1lf%s (max) GPRINT:apc1500117:MIN: \: %5.1lf%s (min) GPRINT:apc1500117:AVERAGE: \: %5.1lf%s (avg)\n [in-voltage] TITLE Input AC Voltage YAXIS VAC DEF:apc1500115=in-voltage.rrd:apc1500115:AVERAGE DEF:apc1500117=in-voltage.rrd:apc1500117:AVERAGE LINE2:apc1500115#00CCCC:apc1500-115 LINE2:apc1500117#FF0000:apc1500-117 COMMENT:\n GPRINT:apc1500115:LAST: apc1500-115 \: %5.1lf%s (cur) GPRINT:apc1500115:MAX: \: %5.1lf%s (max) GPRINT:apc1500115:MIN: \: %5.1lf%s (min) GPRINT:apc1500115:AVERAGE: \: %5.1lf%s (avg)\n GPRINT:apc1500117:LAST: acp1500-117 \: %5.1lf%s (cur) GPRINT:apc1500117:MAX: \: %5.1lf%s (max) GPRINT:apc1500117:MIN: \: %5.1lf%s (min) GPRINT:apc1500117:AVERAGE: \: %5.1lf%s (avg)\n [out-voltage] TITLE Output AC Voltage YAXIS VAC DEF:apc1500115=out-voltage.rrd:apc1500115:AVERAGE DEF:apc1500117=out-voltage.rrd:apc1500117:AVERAGE LINE2:apc1500115#00CCCC:apc1500-115 LINE2:apc1500117#FF0000:apc1500-117 COMMENT:\n GPRINT:apc1500115:LAST: apc1500-115 \: %5.1lf%s (cur) GPRINT:apc1500115:MAX: \: %5.1lf%s (max) GPRINT:apc1500115:MIN: \: %5.1lf%s (min) GPRINT:apc1500115:AVERAGE: \: %5.1lf%s (avg)\n GPRINT:apc1500117:LAST: acp1500-117 \: %5.1lf%s (cur) GPRINT:apc1500117:MAX: \: %5.1lf%s (max) GPRINT:apc1500117:MIN: \: %5.1lf%s (min) GPRINT:apc1500117:AVERAGE: \: %5.1lf%s (avg)\n [ups-load] TITLE UPS Load % YAXIS % DEF:apc1500115=ups-load.rrd:apc1500115:AVERAGE DEF:apc1500117=ups-load.rrd:apc1500117:AVERAGE LINE2:apc1500115#00CCCC:apc1500-115 LINE2:apc1500117#FF0000:apc1500-117 COMMENT:\n GPRINT:apc1500115:LAST: apc1500-115 \: %5.1lf%s (cur) GPRINT:apc1500115:MAX: \: %5.1lf%s (max) GPRINT:apc1500115:MIN: \: %5.1lf%s (min) GPRINT:apc1500115:AVERAGE: \: %5.1lf%s (avg)\n GPRINT:apc1500117:LAST: acp1500-117 \: %5.1lf%s (cur) GPRINT:apc1500117:MAX: \: %5.1lf%s (max) GPRINT:apc1500117:MIN: \: %5.1lf%s (min) GPRINT:apc1500117:AVERAGE: \: %5.1lf%s (avg)\n ----[end of hobbitgraph.cfg changes]----
----[hobbitlaunch.cfg]---- Add the following script definitions to the hobbitlaunch.cfg file:
[batcharge] ENVFILE /usr/local/hobbit/client/etc/hobbitclient.cfg CMD /usr/local/hobbit/client/ext/bat-charge.sh INTERVAL 5m [batvoltage] ENVFILE /usr/local/hobbit/client/etc/hobbitclient.cfg CMD /usr/local/hobbit/client/ext/bat-voltage.sh INTERVAL 5m [involtage] ENVFILE /usr/local/hobbit/client/etc/hobbitclient.cfg CMD /usr/local/hobbit/client/ext/in-voltage.sh INTERVAL 5m [outvoltage] ENVFILE /usr/local/hobbit/client/etc/hobbitclient.cfg CMD /usr/local/hobbit/client/ext/out-voltage.sh INTERVAL 5m [upsload] ENVFILE /usr/local/hobbit/client/etc/hobbitclient.cfg CMD /usr/local/hobbit/client/ext/ups-load.sh INTERVAL 5m ----[end of hobbitlaunch.cfg changes]----
----[ external client scripts to reside in ~hobbit/client/ext ]----
BATTERY CHARGE SCRIPT
#!/bin/bash
waa - 20080616 - bat-charge.sh
William A. Arlofski
Reverse Polarity, LLC
860-824-2433 Office
http://www.revpol.com/
20080319 - Initial version
- Client script for use with Hobbit monitoring server
and NUT UPS monitoring software
###############################################################################
Copyright (C) 2008 William A. Arlofski - waa-at-revpol-dot-com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or visit http://www.gnu.org/licenses/gpl.txt
###############################################################################
---------------------
Set up some variables
---------------------
upsc="/usr/bin/upsc" nutserver="UPS fqdn or IP Address" upslist="apc1500-115 apc1500-117" datatest="battery\.charge:" yellowcharge="80" redcharge="65"
----------------
hobbit variables
----------------
COLUMN=bat-charge COLOR=green MSG=""
for server in $nutserver; do
for ups in $upslist; do
data="$upsc" "$ups"@"$server" 2>&1 | grep "$datatest" | cut -d' ' -f2
MSG="${MSG} $ups : $data" if [ "$data" -le "$redcharge" ]; then COLOR=red elif [ "$data" -le "$yellowcharge" ]; then COLOR=yellow fi done done
report status to Hobbit Server
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR date
${MSG} " exit 0
BATTERY VOLTAGE SCRIPT
#!/bin/bash
waa - 20080616 - bat-voltage.sh
William A. Arlofski
Reverse Polarity, LLC
860-824-2433 Office
http://www.revpol.com/
20080319 - Initial version
- Client script for use with Hobbit monitoring server
and NUT UPS monitoring software
###############################################################################
Copyright (C) 2008 William A. Arlofski - waa-at-revpol-dot-com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or visit http://www.gnu.org/licenses/gpl.txt
###############################################################################
---------------------
Set up some variables
---------------------
upsc="/usr/bin/upsc" nutserver="UPS fqdn or IP Address" upslist="apc1500-115 apc1500-117" datatest="battery\.voltage:" yellowvoltage="260" redvoltage="220"
----------------
hobbit variables
----------------
COLUMN=bat-voltage COLOR=green MSG=""
for server in $nutserver; do
for ups in $upslist; do
data="$upsc" "$ups"@"$server" 2>&1 | grep "$datatest" | cut -d' ' -f2
datanopoint=echo "$data" | sed -e 's/\.//'
MSG="${MSG}
$ups : $data"
if [ "$datanopoint" -le "$redvoltage" ]; then
COLOR=red
elif [ "$datanopoint" -le "$yellowvoltage" ]; then
COLOR=yellow
fi
done
done
report status to Hobbit Server
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR date
${MSG} " exit 0
AC INPUT VOLTAGE SCRIPT
#!/bin/bash
waa - 20080616 - in-voltage.sh
William A. Arlofski
Reverse Polarity, LLC
860-824-2433 Office
http://www.revpol.com/
20080319 - Initial version
- Client script for use with Hobbit monitoring server
and NUT UPS monitoring software
###############################################################################
Copyright (C) 2008 William A. Arlofski - waa-at-revpol-dot-com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or visit http://www.gnu.org/licenses/gpl.txt
###############################################################################
-----------------------------
Set up some initial variables
-----------------------------
upsc="/usr/bin/upsc" nutserver="UPS fqdn or IP Address" upslist="apc1500-115 apc1500-117" datatest="input\.voltage:" yellowvoltage="1150" redvoltage="1090"
----------------
hobbit variables
----------------
COLUMN=in-voltage COLOR=green MSG=""
for server in $nutserver; do
for ups in $upslist; do
data="$upsc" "$ups"@"$server" 2>&1 | grep "$datatest" | cut -d' ' -f2
datanopoint=echo "$data" | sed -e 's/\.//'
MSG="${MSG}
$ups : $data"
if [ "$datanopoint" -le "$redvoltage" ]; then
COLOR=red
elif [ "$datanopoint" -lt "$yellowvoltage" ]; then
COLOR=yellow
fi
done
done
report status to Hobbit Server
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR date
${MSG} " exit 0
AC OUTPUT VOLTAGE SCRIPT
#!/bin/bash
waa - 20080616 - out-voltage.sh
William A. Arlofski
Reverse Polarity, LLC
860-824-2433 Office
http://www.revpol.com/
20080319 - Initial version
- Client script for use with Hobbit monitoring server
and NUT UPS monitoring software
###############################################################################
Copyright (C) 2008 William A. Arlofski - waa-at-revpol-dot-com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or visit http://www.gnu.org/licenses/gpl.txt
###############################################################################
---------------------
Set up some variables
---------------------
upsc="/usr/bin/upsc" nutserver="UPS fqdn or IP Address" upslist="apc1500-115 apc1500-117" datatest="output\.voltage:" yellowvoltage="1150" redvoltage="1090"
----------------
hobbit variables
----------------
COLUMN=out-voltage COLOR=green MSG=""
for server in $nutserver; do
for ups in $upslist; do
data="$upsc" "$ups"@"$server" 2>&1 | grep "$datatest" | cut -d' ' -f2
datanopoint=echo "$data" | sed -e 's/\.//'
MSG="${MSG}
$ups : $data"
if [ "$datanopoint" -le "$redvoltage" ]; then
COLOR=red
elif [ "$datanopoint" -lt "$yellowvoltage" ]; then
COLOR=yellow
fi
done
done
report status to Hobbit Server
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR date
${MSG} " exit 0
UPS % LOAD SCRIPT
#!/bin/bash
waa - 20080616 - ups-load.sh
William A. Arlofski
Reverse Polarity, LLC
860-824-2433 Office
http://www.revpol.com/
20080319 - Initial version
- Client script for use with Hobbit monitoring server
and NUT UPS monitoring software
###############################################################################
Copyright (C) 2008 William A. Arlofski - waa-at-revpol-dot-com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or visit http://www.gnu.org/licenses/gpl.txt
###############################################################################
---------------------
Set up some variables
---------------------
upsc="/usr/bin/upsc" nutserver="UPS fqdn or IP Address" upslist="apc1500-115 apc1500-117" datatest="ups\.load:" yellowload="800" redload="900"
----------------
hobbit variables
----------------
COLUMN=ups-load COLOR=green MSG=""
for server in $nutserver; do
for ups in $upslist; do
data="$upsc" "$ups"@"$server" 2>&1 | grep "$datatest" | cut -d' ' -f2
datanopoint=echo "$data" | sed -e 's/\.//'
MSG="${MSG}
$ups : $data"
if [ "$datanopoint" -ge "$redload" ]; then
COLOR=red
elif [ "$datanopoint" -ge "$yellowload" ]; then
COLOR=yellow
fi
done
done
report status to Hobbit Server
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR date
${MSG} " exit 0
----[end of client external scripts ]----
-- Bill Arlofski Reverse Polarity, LLC waa at revpol.com http://www.revpol.com/
- Stop the NSA from illegally eavesdropping on your personal email * Learn about PGP and start encrypting your email today http://gnupg.org or http://www.pgp.com
participants (1)
-
waa-hobbitml@revpol.com