Annotation of nagios/check_hw_sensors/index.html, Revision 1.7
1.5 andrew 1: <html><head><title>Nagios Check - check_hw_sensors</title></head>
2: <body>
3: <h1>Nagios Check - check_hw_sensors</h1>
4: <p>check_hw_sensors plugin for Nagios monitors sysctl hw.sensors on OpenBSD</p>
5: <p>With the new sensor framework in OpenBSD 3.9, I wanted to be able to monitor the new hw.sensors from <a href='http://www.nagios.org/'>Nagios</a> and this is what I have. The documentation is a bit thin and I don't know how reliable it is. I would be happy to accept patches. Send them to <a href='mailto:andrew+nagios@rraz.net'>andrew+nagios@rraz.net</a>. I know the docs aren't as good as I would like, so if there are places that need clarification, please let me know!</p>
1.7 ! andrew 6: <p>New in this release is support for the new 2 level sensors in OpenBSD 4.0-current. They seem way more better, and I may change some stuff to only support that version after I get all my machines moved to 4.1.</p>
! 7: <p>They changed the output again, so 1.23 is an update to fix that.</p>
1.5 andrew 8: <p>It has the ability to check the sensors that report their status. Since many sensors support this, it can make the size of your sensorsd.conf much smaller. For example, check_hw_sensors will automatically check these two sensors:
9: <ul>
10: <li>hw.sensors.76=esm0, Fan 4, 3629 RPM, OK</li>
11: <li>hw.sensors.77=esm0, Fan 5, 0 RPM, CRITICAL</li>
12: </ul>
13: It will report the status listed to Nagios. For 76, it would be OK, for 77 it would be CRITICAL. You don't need to put anything in a config file to support those.</p>
14: <p>What I think is really kewl about this plugin is that it can use the same sensorsd.conf as sensorsd. That means that they can be easily kept in sync. But, since Nagios supports both warning and critical alerts, it turned out really handy that sensorsd ignores any additional capabilities in the file. The addtional capabilities check_hw_sensors supports are described below. If you have an /etc/sensorsd.conf with the checks you want, it can be run as simply as 'check_hw_sensors -f'. If you only want to check the sensors that report their status, you can ever run it as just 'check_hw_sensors'.</p>
15: <p>TODO:
16: <ul>
17: <li>need real documentation.</li>
18: <li>the RANGE using the colon to separate probably screws up the getcap of sensorsd.conf, so it should probably get replaced with a dash or somesuch</li>
19: </ul>
20: </p>
1.7 ! andrew 21: <p><center><b><a href='check_hw_sensors-1.25.tar.gz'>Download the current version here</a></b></center></p>
1.5 andrew 22: <h4>
23: Please be sure to support the <a href="http://www.openbsd.org">OpenBSD</a>
24: project by purchasing
25: <a href="http://www.openbsd.org/items.html">CDs</a>,
26: <a href="http://www.openbsd.org/tshirts.html">T-shirts</a>, or making a
27: <a href="http://www.openbsd.org/donations.html">donation</a>.
28: <br />
29: These finances ensure that OpenBSD will continue to exist, and
30: will remain <a href="http://www.openbsd.org/policy.html">free</a>
31: for everyone to use and reuse as they see fit.
32: </h4>
33: <pre>
34: check_hw_sensors [-i] (-f [<FILENAME>]|(-s <hw.sensors id> [-w limit] [-c limit]))
35:
36: Usage:
37: -i, --ignore-status
38: Don't check the status of sensors that report it.
39: -f, --filename=FILE
40: FILE to load checks from (defaults to /etc/sensorsd.conf)
41: -s, --sensor=ID
42: ID of a single sensor. "-s 0" means hw.sensors.0.
43: -w, --warning=RANGE or single ENTRY
44: Exit with WARNING status if outside of RANGE or if != ENTRY
45: -c, --critical=RANGE or single ENTRY
46: Exit with CRITICAL status if outside of RANGE or if != ENTRY
47: </pre>
48: <p>FILE is in the same format as <a href='http://www.openbsd.org/cgi-bin/man.cgi?query=sensorsd.conf'>sensorsd.conf(5)</a> plus some additional entries. These additional entries in the file are ignored by <a href='http://www.openbsd.org/cgi-bin/man.cgi?query=sensorsd'>sensorsd(8)</a>. </p>
49:
50: <p>check_hw_sensors understands the following entries:<br>
51: low, high, crit, warn, crit.low, crit.high, warn.low, warn.high,
52: ignore, status</p>
53:
54: <p>An ENTRY depends on the type. The descriptions in <a href='http://www.openbsd.org/cgi-bin/man.cgi?query=sensorsd.conf'>sensorsd.conf(5)</a>
55: can be used when appropriate, or you can use the following:
56:
57: <ul>
58: <li>fanrpm, volts_dc, amps, watthour, amphour, integer (raw), percent, lux or timedelta<br>
59: Anything that includes digits.
60: Both the value of the check and the value of the sensor
61: response that are not either a digit or period are stripped
62: and then the two resultant values are compared.</li>
63:
64: <li>temp<br>
65: Can be as above, but if the entry has an F in it,
66: it compares farenheit, otherwise it uses celcius.</li>
67:
68: <li>indicator or drive<br>
69: does a case sensitive match of each
70: entry in the comma separated list and if it does not match
71: any of the entries, it sets the status.</li>
72: </ul>
73:
74: <p>The entries 'crit' or 'warn' (or the -c or -w on the command line)
75: may be a RANGE or a comma separated list of acceptable values.
76: The comma separated list of values contains a list of things that
77: will NOT cause the status. This is possibly counterintuitive, but
78: you are more likely to know good values than bad values.</p>
79:
80: <p>A RANGE is a low ENTRY and a high ENTRY separated by a colon (:).
81: It can also be low: or :high with the other side left blank to only
82: make the single check..<p>
83:
84: <p>An entry marked "ignore" will cause that sensor to be skipped.
85: Generally used with status checking of all sensors to ignore sensors you
86: don't care about or that report incorrectly.</p>
87:
88: <p>If you are using --ignore-status, you can still check the status of
89: individual sensors with a status entry.</p>
90:
1.6 andrew 91: <p>check_hw_sensors (nagios-plugins 1.4.2) 1.22<br>
1.5 andrew 92: The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
93: copies of the plugins under the terms of the GNU General Public License.
94: For more information about these matters, see the file named COPYING.</p>
95:
96: <h3>Example sensorsd.conf</h3>
97: <pre>
1.6 andrew 98: # hw.sensors.acpibat0.volt0=7.40 V DC, (voltage), OK
99: # hw.sensors.acpibat0.volt1=8.30 V DC, (current voltage), OK
100: # hw.sensors.acpibat0.watthour0=57.72 Wh, (last full capacity)
101: # hw.sensors.acpibat0.watthour1=0.00 Wh, (warning capacity)
102: # hw.sensors.acpibat0.watthour2=0.12 Wh, (low capacity)
103: # hw.sensors.acpibat0.watthour3=57.72 Wh, (remaining capacity)
104: hw.sensors.acpibat0.watthour3:warn.low=50 Wh:crit.low=30 Wh
105: # hw.sensors.acpibat0.raw0=2, (battery charging), OK
106: # hw.sensors.acpibat0.raw1=99, (rate)
107: # hw.sensors.acpiac0.indicator0=On, (power supply)
108: hw.sensors.acpiac0.indicator0:crit=On
109: # hw.sensors.acpitz0.temp0=62.95 degC, (zone temperature)
110: hw.sensors.acpitz0.temp0:warn.high=65 degC:crit.high=75 degC
1.5 andrew 111: </pre>
112: <h3>CVS log for check_hw_sensors</h3>
113: <pre>
114: RCS file: /cvs/scripts/Admin scripts/check_hw_sensors/check_hw_sensors,v
115: Working file: check_hw_sensors
1.7 ! andrew 116: head: 1.25
1.5 andrew 117: branch:
118: locks: strict
119: access list:
120: symbolic names:
121: keyword substitution: kv
1.7 ! andrew 122: total revisions: 25; selected revisions: 25
1.5 andrew 123: description:
124: ----------------------------
1.7 ! andrew 125: revision 1.25
! 126: date: 2008/03/10 16:21:53; author: andrew; state: Exp; lines: +5 -5
! 127: Fix it for sensors with more than 1 digit at the end.
! 128: ----------------------------
! 129: revision 1.24
! 130: date: 2007/02/14 21:59:10; author: andrew; state: Exp; lines: +5 -4
! 131: Add an idea to the TODO list.
! 132: ----------------------------
! 133: revision 1.23
! 134: date: 2007/01/22 02:38:35; author: andrew; state: Exp; lines: +8 -5
! 135: again they change the output!
! 136: ----------------------------
1.6 andrew 137: revision 1.22
138: date: 2007/01/06 03:16:41; author: andrew; state: Exp; lines: +11 -4
139: Support the new dual level sensors
140: ----------------------------
1.5 andrew 141: revision 1.21
142: date: 2006/12/05 16:26:27; author: andrew; state: Exp; lines: +5 -5
143: new better example for 4.0
144: and fix the s/drive\s// from the data, not the type
145: ----------------------------
146: revision 1.20
147: date: 2006/12/05 00:17:47; author: andrew; state: Exp; lines: +35 -26
148: Match sensors differently depending on OS Version from the Config module.
149:
150: Also support checks on the other sensor types and document that.
151:
152: and refactor the way I return a $sensor->{'status'} from ~10 lines to 1.
153: ----------------------------
154: revision 1.19
155: date: 2006/12/04 23:33:53; author: andrew; state: Exp; lines: +8 -3
156: add a regex for the 'percent' type of sensor
157: ----------------------------
158: revision 1.18
159: date: 2006/12/02 02:15:17; author: andrew; state: Exp; lines: +74 -9
160: fix it for the output from OpenBSD 4.0
161: ----------------------------
162: revision 1.17
163: date: 2006/10/25 23:30:23; author: andrew; state: Exp; lines: +4 -7
164: get the docs up to match the new version
165: ----------------------------
166: revision 1.16
167: date: 2006/10/25 18:36:46; author: andrew; state: Exp; lines: +4 -4
168: Stuff in CVS should output nagios format
169: ----------------------------
170: revision 1.15
171: date: 2006/10/25 18:35:59; author: andrew; state: Exp; lines: +73 -46
172: add support for the status as reported by the sensors. it is teh r0x0r!
173: ----------------------------
174: revision 1.14
175: date: 2006/05/04 01:30:29; author: andrew; state: Exp; lines: +6 -4
176: I thought I checked this in already
177: ----------------------------
178: revision 1.13
179: date: 2006/05/03 22:16:42; author: andrew; state: Exp; lines: +7 -6
180: Some more fixing of the help
181: ----------------------------
182: revision 1.12
183: date: 2006/05/03 21:54:43; author: andrew; state: Exp; lines: +51 -30
184: Get the help output cleaned up. Still not 100% what I want, but so far so good.
185: ----------------------------
186: revision 1.11
187: date: 2006/05/03 20:01:09; author: holligan; state: Exp; lines: +4 -4
188: updated and clarified help
189: ----------------------------
190: revision 1.10
191: date: 2006/05/03 03:31:22; author: andrew; state: Exp; lines: +27 -42
192: A bunch of cleanup and some kewl refactoring into loops.
193:
194: Still need to find a way to refactor the checks that are so similar!
195: ----------------------------
196: revision 1.9
197: date: 2006/05/03 02:26:47; author: andrew; state: Exp; lines: +8 -8
198: It now doesn't do nonexistent checks (for some stuff anyway)
199: Also changed the <br /> to <br>. Not valid XHTML whatever, but it does get stripped before getting sent to my pager.
200: ----------------------------
201: revision 1.8
202: date: 2006/05/02 21:23:29; author: andrew; state: Exp; lines: +6 -16
203: Better looking output for the web page.
204: ----------------------------
205: revision 1.7
206: date: 2006/05/02 20:03:53; author: andrew; state: Exp; lines: +5 -5
207: oops, that's an array ref!
208: ----------------------------
209: revision 1.6
210: date: 2006/05/02 19:59:47; author: andrew; state: Exp; lines: +7 -5
211: Better output for the OK checks
212: ----------------------------
213: revision 1.5
214: date: 2006/05/02 19:49:29; author: andrew; state: Exp; lines: +19 -12
215: Only show details for things other than OK, cuZ we are limited in the amount of data we can return :-(
216: ----------------------------
217: revision 1.4
218: date: 2006/05/02 15:54:42; author: andrew; state: Exp; lines: +44 -21
219: Some cleanup, as well as making it output a single line like nagios supposedly likes.
220: ----------------------------
221: revision 1.3
222: date: 2006/05/02 01:39:23; author: andrew; state: Exp; lines: +3 -3
223: fix the help getopts.
224: ----------------------------
225: revision 1.2
226: date: 2006/05/02 01:29:33; author: andrew; state: Exp; lines: +427 -11
227: Adding the sensors from one of the routers, cuZ there were a lot and I can use it for testing.
228:
229: Also, now the check_hw_sensors now seems to be OK. I need to put it on a few machines and set up the checks now. If it works for the rest of the week, I can clean it up and mebbe put it on teh interweb and post to undeadly.
230: ----------------------------
231: revision 1.1
232: date: 2006/05/01 18:11:23; author: andrew; state: Exp;
233: add this so I can check it out on a box for testing
234: =============================================================================
235: </pre>
236: <p>Andrew Fresh <<a href='mailto:andrew@mad-techies.org'>andrew@mad-techies.org</a>></p>
1.7 ! andrew 237: <p><small>$RedRiver: index.html,v 1.6 2007/01/06 03:27:53 andrew Exp $</small></p>
1.5 andrew 238: </body>
239: </html>
240:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>