2007-07-02 19:26:18 +04:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
2007-07-16 21:51:09 +04:00
|
|
|
# $NetBSD: sensor_indicator,v 1.2 2007/07/16 17:51:09 xtraeme 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)
|
|
|
|
logger -p warning "${0}: ${3}: NORMAL: state entered (${1})" >&1
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
critical)
|
|
|
|
logger -p warning "${0}: ${3}: CRITICAL: state entered (${1})" >&1
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
critical-under)
|
|
|
|
logger -p warning "${0}: ${3}: CRITICAL: dropped below limit (${1})" >&1
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
critical-over)
|
|
|
|
logger -p warning "${0}: ${3}: CRITICAL: limit exceeded (${1})" >&1
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
warning-under)
|
|
|
|
logger -p warning "${0}: ${3}: WARNING: dropped below limit (${1})" >&1
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
warning-over)
|
|
|
|
logger -p warning "${0}: ${3}: WARNING: limit exceeded (${1})" >&1
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|