2007-07-02 19:26:18 +04:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
2012-08-28 01:50:19 +04:00
|
|
|
# $NetBSD: sensor_indicator,v 1.5 2012/08/27 21:50:19 pgoyette Exp $
|
2007-07-02 19:26:18 +04:00
|
|
|
#
|
2007-07-16 21:51:09 +04:00
|
|
|
# Generic script for indicator and integer sensors.
|
2007-07-02 19:26:18 +04:00
|
|
|
#
|
|
|
|
# Arguments passed by powerd(8):
|
|
|
|
#
|
|
|
|
# script_path device event sensor
|
|
|
|
|
|
|
|
case "${2}" in
|
|
|
|
normal)
|
2007-10-11 04:11:24 +04:00
|
|
|
logger -p warning "${0}: ($1) normal state entered [${3}]" >&1
|
2007-07-02 19:26:18 +04:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
critical)
|
2007-10-11 04:30:47 +04:00
|
|
|
logger -p warning "${0}: ($1) critical state entered [${3}]" >&1
|
2007-07-02 19:26:18 +04:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
critical-under)
|
2007-10-11 04:30:47 +04:00
|
|
|
logger -p warning "${0}: ($1) dropped below critical limit [${3}]" >&1
|
2007-07-02 19:26:18 +04:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
critical-over)
|
2007-10-11 04:11:24 +04:00
|
|
|
logger -p warning "${0}: ($1) critical limit exceeded [${3}]" >&1
|
2007-07-02 19:26:18 +04:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
warning-under)
|
2007-10-11 04:11:24 +04:00
|
|
|
logger -p warning "${0}: ($1) dropped below warning limit [${3}]" >&1
|
2007-07-02 19:26:18 +04:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
warning-over)
|
2007-10-11 04:11:24 +04:00
|
|
|
logger -p warning "${0}: ($1) warning limit exceeded [${3}]" >&1
|
2007-07-02 19:26:18 +04:00
|
|
|
exit 0
|
|
|
|
;;
|
2012-08-28 01:50:19 +04:00
|
|
|
state-changed)
|
|
|
|
logger -p warning "${0}: ($1) state changed [${3}] : ${4}" >&1
|
|
|
|
exit 0
|
|
|
|
;;
|
2007-07-02 19:26:18 +04:00
|
|
|
*)
|
|
|
|
logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|