File: acpi.in

package info (click to toggle)
munin 1.2.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,940 kB
  • ctags: 98
  • sloc: sh: 4,215; makefile: 452; perl: 135
file content (62 lines) | stat: -rw-r--r-- 1,594 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
#
# Plugin to graph temperatures based on output from ACPI. Needs the
# "acpi" program to work.
#
# Parameters:
#
# 	acpi      - Override path to acpi program
#
#
# $Log$
# Revision 1.6  2004/10/19 19:14:18  jimmyo
# Plugin generic/acpi now autodetects even if the acpi version does not contain the acpi_available program.
#
# Revision 1.5  2004/09/14 20:47:34  jimmyo
# Updated/simplified plugin.
#
# Revision 1.4  2004/05/20 19:02:36  jimmyo
# Set categories on a bunch of plugins
#
# Revision 1.3  2004/05/14 21:16:46  jimmyo
# "Upped" som plugins from contrib/manual to auto.
#
# Revision 1.2  2004/05/14 20:32:06  jimmyo
# Improved autoconf mechanism
#
# Revision 1.1  2004/05/06 21:39:54  jimmyo
# Added plugin acpi, contributed by Alexandre Dupouy.
#
#
#%# family=auto
#%# capabilities=autoconf

if [ "$1" = "autoconf" ]; then
	acpi_available 2>/dev/null >/dev/null || ${acpi:-acpi} -t -B 2>/dev/null >/dev/null
        if [ "$?" = "0" ]; then
		acpi -t -B 2>/dev/null | grep '\d' >/dev/null 2>/dev/null
		if [ "$?" = "0" ]; then
		    echo yes
		    exit 0
		fi
		echo "no (thermal not supported by ACPI)"
		exit 1
	else
		echo "no (ACPI program not found)"
		exit 2
	fi
fi

if [ "$1" = "config" ]; then

        echo 'graph_title CPU temperature'
        echo 'graph_args --base 1000 -l 0'
        echo 'graph_vlabel temp in C'
        echo 'graph_category sensors'
		echo 'graph_info This graph shows temperatures based on output from ACPI.'
        echo cpu.label cpu
		echo cpu.info CPU temperature.
        exit 0
fi

${acpi:-acpi} -t -B | awk '{print "cpu.value " $4}'