source: npl/overig/apcupsd/syn3-apccheck @ 250d444

gcc484perl-5.22
Last change on this file since 250d444 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 882 bytes
Line 
1#!/bin/bash
2# Syn-3 apc ups checker (C) DatuX
3
4if ! STATUS=`apcaccess | grep ^STATUS`; then
5        syn3-state --ignorenew apcupsd ALERT "APC UPS not found!"
6elif echo $STATUS | grep ONLINE >/dev/null; then
7        syn3-state apcupsd OK "UPS is online."
8elif echo $STATUS | grep ONBATT >/dev/null; then
9        syn3-state apcupsd ALERT "Power failure! Running on battery!"
10elif echo $STATUS | grep SHUTTING >/dev/null; then
11        syn3-state apcupsd ALERT "UPS battery almost empty, shutting down system."
12elif echo $STATUS | grep COMMLOST >/dev/null; then
13        syn3-state --ignorenew apcupsd ALERT "Communication failure! Please check UPS status and cables."
14elif echo $STATUS | grep REPLACE >/dev/null; then
15        syn3-state apcupsd CAUTION "UPS battery needs to be replaced!"
16else
17        syn3-state apcupsd ALERT "UPS reports status: $STATUS. Please check UPS status."
18fi
Note: See TracBrowser for help on using the repository browser.