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