-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
ups=$1 | ||
key=$2 | ||
|
||
if [ $key = ups.status ]; then | ||
state=`/bin/upsc $ups $key` | ||
case $state in | ||
OL) echo 1 ;; #'On line (mains is present)' ;; | ||
OB) echo 2 ;; #'On battery (mains is not present)' ;; | ||
LB) echo 3 ;; #'Low battery' ;; | ||
RB) echo 4 ;; #'The battery needs to be replaced' ;; | ||
CHRG) echo 5 ;; #'The battery is charging' ;; | ||
DISCHRG) echo 6 ;; #'The battery is discharging (inverter is providing load power)' ;; | ||
BYPASS) echo 7 ;; #'UPS bypass circuit is active echo no battery protection is available' ;; | ||
CAL) echo 8 ;; #'UPS is currently performing runtime calibration (on battery)' ;; | ||
OFF) echo 9 ;; #'UPS is offline and is not supplying power to the load' ;; | ||
OVER) echo 10 ;; #'UPS is overloaded' ;; | ||
TRIM) echo 11 ;; #'UPS is trimming incoming voltage (called "buck" in some hardware)' ;; | ||
BOOST) echo 12 ;; #'UPS is boosting incoming voltage' ;; | ||
* ) echo 0 ;; #'unknown state' ;; | ||
esac | ||
else | ||
/bin/upsc $ups $key | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
UserParameter=upsmon[*],/etc/zabbix/sh/ups_status.sh $1 $2 |