MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/local/src/munin-1.2.6/node/node.d.linux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/src/munin-1.2.6/node/node.d.linux/i2c.in
#!/bin/sh
#
# NOTE: This plugins is outdated. Use the sensors_ wildcard plugin instead.
#
# $Log$
# Revision 1.2  2004/02/05 16:47:02  jimmyo
# Added new wildcard plugin linux/sensors_ that replaces the i2c plugins (SF#890952).
#
# Revision 1.1  2004/01/02 18:50:01  jimmyo
# Renamed occurrances of lrrd -> munin
#
# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
# Import of LRRD CVS tree after renaming to Munin
#
# Revision 1.4  2003/11/07 17:43:16  jimmyo
# Cleanups and log entries
#


#%# family=contrib

STATEFILE="@@PLUGSTATE@@/plugin-i2c_temp.state"

if [ "$1" = "config" ]; then
        echo 'graph_title Temperatures'
	echo 'graph_vtitle Celsius'
	echo 'graph_args -l 0'
        echo 'cpu.label cpu'
	echo 'cpu.warning 60'
	echo 'cpu.critical 70'
        echo 'board.label board'
	echo 'board.warning 40'
	echo 'board.critical 50'
        exit 0
fi

if [ -f "$STATEFILE" ]; then
	if [ $(($(date +"%s")-$(stat -c "%Z" $STATEFILE))) -gt 60 ]; then
	    sensors $chips | tee $STATEFILE | awk '/temp[12]/ {++i; print (i%2 ? "board" : "cpu") ".value", $2+0}'
	else
	    cat $STATEFILE |awk '/temp[12]/ {++i; print (i%2 ? "board" : "cpu") ".value", $2+0}'
	fi
else
	sensors $chips | tee $STATEFILE | awk '/temp[12]/ {++i; print (i%2 ? "board" : "cpu") ".value", $2+0}'
fi



Anon7 - 2021