• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gitignoreH A D01-Oct-2013321 2524

AUTHORSH A D01-Oct-201380 32

COPYINGH A D01-Oct-201317.6 KiB341281

Makefile.amH A D01-Oct-20131.1 KiB3819

NEWSH A D01-Oct-2013705 2317

READMEH A D01-Oct-20136.4 KiB275182

autogen.shH A D01-Oct-2013132 95

build.shH A D01-Oct-201373 74

check_snmp_disk.cH A D01-Oct-20135.6 KiB254181

check_snmp_load.cH A D01-Oct-20134.5 KiB200144

check_snmp_proc.cH A D01-Oct-20137.2 KiB317242

check_snmp_swap.cH A D01-Oct-20134 KiB200139

configure.inH A D01-Oct-20132.8 KiB10184

nagios-snmp-plugins.cfg.inH A D01-Oct-20131.8 KiB8464

nagios-snmp-plugins.spec.inH A D01-Oct-20131.5 KiB6451

snmp_common.cH A D01-Oct-20135.9 KiB273161

snmp_common.hH A D01-Oct-20132.1 KiB10849

README

1
2			 Nagios SNMP Plugins
3			 ===================
4
5What is it?
6-----------
7
8These are two plugins to be used with Nagios. They should still work
9with NetSaint, but as this is now really ancient, I don't support
10Netsaint any longer. You also need the Net SNMP Daemon in a reasonable
11new version.
12
13Nagios:   	http://www.nagios.org/
14Net-SNMPD: 	http://www.net-snmp.org/
15
16
17Who wrote it?
18-------------
19
20These programs are (C) 2002-2008 by
21Henning P. Schmiedehausen
22
23(C) 2010-2013 Elan Ruusamäe <glen@delfi.ee>
24
25Distributed under GNU GENERAL PUBLIC LICENSE v2
26(See file COPYING in the distribution).
27
28
29Where to get it?
30----------------
31
32Homepage: https://github.com/glensc/nagios-snmp-plugins
33Release downloads: https://github.com/glensc/nagios-snmp-plugins/releases
34
35Acknowlegdements & Thanks
36-------------------------
37
38Elan Ruusamäe <glen at pld-linux.org>
39   - enhanced reporting for the check_snmp_proc plugin. Also
40     the only patch I ever got from a distribution vendor. :-)
41
42Jose Pedro Oliveira <jpo at di.uminho.pt>
43
44   - for maintaining the Fedora Extras RPM; I rolled a number of
45   things from that spec file back into the "official" one.
46
47Oliver Faenger <oliver.faenger at cityweb.de>
48   - representing many many people who reported and sent me patches
49     for the gcc4 compilation issue.
50
51Mark Janssen <maniac at maniac.nl>
52   - patch that displays the checked devices and processes
53
54Henning P. Schmiedehausen
55   - original code author
56
57
58All the Linux distributions who included that little hack into their
59package lists. BTW: I'd appreciate if you drop me a quick line when
60you include nagios-snmp-plugins into a distribution. So far I know of:
61
62- Fedora 7
63- Fedora Extras
64- PLD Linux
65
66
67What can these plugins do?
68--------------------------
69
70NET-SNMP gives you an unique feature: It makes checks for running
71processes and/or disk size configurable in the SNMP daemon and
72queryable via SNMP. So you can do
73
74proc  syslogd
75proc  klogd
76
77disk  /    5%
78disk  /usr 10%
79
80
81in your snmpd.local.conf and have the snmp daemon check that you
82always have free space on your root and usr file system and that you
83have syslogd and klogd processes running.
84
85Querying this from a monitoring tool however, is very cumbersome. You
86need to check what disks are there, then query error status.
87
88These two plugins does all the work for you.
89
90
91Where do the plugins run?
92-------------------------
93
94Well, on Linux. :-) That's where I wrote them. They should compile on
95any other *x like Operating system, too. If you get them to compile,
96please let me know.
97
98I compiled and tested these plugins on
99
100RedHat Linux 9
101Fedora Core 1
102Fedora Core 3
103Fedora Core 4
104Fedora Core 5
105Fedora Core 6
106RedHat Enterprise Linux 3
107RedHat Enterprise Linux 4
108RedHat Enterprise Linux 5
109CentOS 5
110
111using various nagios versions between 1.2 and 2.9.
112
113Users reported success on various SuSE Linux and SLES
114versions. Compilation on *BSD seems to be possible if you have a GNU
115getline library.
116
117
118How do I build and install?
119---------------------------
120
121- Unpack the distribution.
122
123- Run
124
125    aclocal
126    autoheader
127    automake --add-missing
128    autoconf
129    ./configure
130    make
131
132  or simply
133
134    ./build.sh
135
136- you should now have two binaries:  check_snmp_disk and check_snmp_proc
137
138- copy them into your Nagios plugins directory.
139
140
141How do I configure the plugins?
142-------------------------------
143
144Using Nagios there are two ways to configure the plugins:
145
146The old way:
147
148- add the following two lines to your /etc/nagios/command.cfg:
149
150command[check_snmp_disk]=/usr/lib/nagios/plugins/check_snmp_disk -H $HOSTADDRESS$ -C $ARG1$
151command[check_snmp_proc]=/usr/lib/nagios/plugins/check_snmp_proc -H $HOSTADDRESS$ -C $ARG1$
152
153  Replace /usr/lib/nagios/plugins/ with the directory where you copied
154  the binaries!
155
156The new way:
157
158- add the following lines to your /etc/nagios/checkcommands.cfg
159
160# 'check_snmp_disk' command definition
161define command	{
162	command_name	check_snmp_disk
163	command_line	$USER1$/check_snmp_disk -H $ARG1$ -C $USER3$
164}
165
166
167# 'check_snmp_proc' command definition
168define command	{
169	command_name	check_snmp_proc
170	command_line	$USER1$/check_snmp_proc -H $ARG1$ -C $USER3$
171}
172
173- The Community password should be defined in your resources.cfg If you don't use
174  $USER3$, adjust the definition above.
175
176
177How do I use the plugins?
178-------------------------
179
180First, select something to check. You find a detailed description in
181man snmpd.conf(5).
182
183I, e.g. use (in /etc/snmpd/snmpd.local.conf under RedHat/Fedora):
184
185#
186# SNMP checked disks
187#
188disk	/		5%
189disk	/usr		5%
190disk	/var		10%
191disk	/boot		1%
192disk	/mnt/disk0	10%
193#
194# SNMP checked Processes
195#
196proc	crond
197proc	ntpd
198proc	sshd
199proc	syslogd
200proc	klogd
201
202Which assures that all my disks do not fill up and that I have the
203most important processes running on my boxes.
204
205You need a configured snmpd with at least a read community configured.
206
207Now try your configuration: Run the disk plugin manually:
208
209check_snmp_disk -H <host to check> -C <community>
210
211It should report either
212
213"Checked <xxx> disks."  and a return code of 0 if everything is fine
214(<xxx> should be the number of disks configured in the snmp.local.conf
215file),
216
217or
218
219"<diskname>: less than <xxx>% free (= <yyy>%) (<devicename>)" and a
220return code of 2 if there is a problem (diskname and devicename depend
221on the disk, <xxx> is the threshold configured and <yyy> is the actual
222free space).
223
224
225The same testing can be done with the check_snmp_proc plugin.
226
227Now configure your monitor program to monitor a host (in hosts.cfg):
228
229The old way:
230
231service[myhost]=DISK;0;24x7;3;5;1;admins;120;24x7;1;1;0;;check_snmp_disk!<community>
232service[myhost]=PROC;0;24x7;3;5;1;admins;120;24x7;1;1;0;;check_snmp_proc!<community>
233
234where <community is your read-community from above) and you're
235set. The ";0;24x7;3;5;1;admins;120;24x7;1;1;0;;" parameters should be
236of course your very own configuration. :-)
237
238The new way:
239
240# Service definition
241define service	{
242	use				generic-service
243
244	host_name			myhost
245	service_description		Disk Space
246	check_command			check_snmp_disk!myhost
247}
248
249# Service definition
250define service	{
251	use				generic-service
252
253	host_name			myhost
254	service_description		Running processes
255	check_command			check_snmp_proc!myhost
256}
257
258Of course you should replace "myhost" with your host.
259
260
261What is left to do?
262-------------------
263
264- Hard/Soft Thresholds
265
266- If multiple failures occur, only the first is reported
267  (Nagios restriction) and every further error only when the
268  first is fixed.
269
270
271Release History
272---------------
273
274see NEWS FILE
275