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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
|
--- nagiosplug-1.3-beta1/acconfig.h Sun May 26 19:01:09 2002
+++ nagiosplug-1.3-beta1.new/acconfig.h Mon Oct 14 12:21:57 2002
@@ -35,6 +35,7 @@
#undef SSH_COMMAND
#undef SWAP_COMMAND
#undef SWAP_FORMAT
+#undef SWAP_LINE
#undef USE_PS_VARS
#undef VSZ_COMMAND
#undef VSZ_FORMAT
--- nagiosplug-1.3-beta1/configure.in Wed Jun 12 20:03:07 2002
+++ nagiosplug-1.3-beta1.new/configure.in Mon Oct 14 11:59:56 2002
@@ -757,14 +757,18 @@
if [swap -l 2>/dev/null | egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" >/dev/null]
then
AC_DEFINE_UNQUOTED(SWAP_FORMAT,[" %*d %*s %*d,%*d %*d %*d %d %d"])
+ AC_DEFINE_UNQUOTED(SWAP_LINE,[""])
echo " using IRIX format"
elif [swap -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null]
then
AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %*[[0-9,-]] %*d %d %d"])
+ AC_DEFINE_UNQUOTED(SWAP_LINE,[""])
echo " using Solaris format"
fi
+
+
EXTRAS="$EXTRAS check_swap"
-elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null]
+elif [swapinfo -k 2>&1 | egrep -i "^Device" >/dev/null]
then
echo "found swapinfo command"
AC_DEFINE(HAVE_SWAP)
@@ -773,8 +777,23 @@
if [swapinfo -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
then
AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"])
+ AC_DEFINE_UNQUOTED(SWAP_LINE,[""])
+dnl AC_DEFINE_UNQUOTED(SWAP_LINE,["Total"])
+dnl Can't exactly test the above, but thought it would be nice.
echo " using FreeBSD format"
fi
+elif [swapinfo 2>&1 | egrep -i "^memory" >/dev/null]
+then
+ echo "found swapinfo command"
+ AC_DEFINE(HAVE_SWAP)
+ AC_PATH_PROG(PATH_TO_SWAP,swapinfo)
+ AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP")
+ if [swapinfo 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE +USED" >/dev/null]
+ then
+ AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"])
+ AC_DEFINE_UNQUOTED(SWAP_LINE,["memory"])
+ echo " using HP-UX format"
+ fi
EXTRAS="$EXTRAS check_swap"
fi
--- nagiosplug-1.3-beta1/plugins/check_swap.c Wed Feb 27 22:42:59 2002
+++ nagiosplug-1.3-beta1.new/plugins/check_swap.c Mon Oct 14 12:00:18 2002
@@ -64,6 +64,7 @@
fclose (fp);
#else
#ifdef HAVE_SWAP
+
child_process = spopen (SWAP_COMMAND);
if (child_process == NULL) {
printf ("Could not open pipe: %s\n", SWAP_COMMAND);
@@ -92,17 +93,19 @@
status = ssprintf (status, "%s", "Swap used:");
while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
- sscanf (input_buffer, SWAP_FORMAT, &total_swap, &free_swap);
- used_swap = total_swap - free_swap;
- percent_used = 100 * ((float) used_swap) / ((float) total_swap);
- status = ssprintf
- (status,
- "%s %2d%% (%d bytes out of %d)",
- status, percent_used, used_swap, total_swap);
- if (percent_used >= crit_percent || free_swap <= crit_size)
- result = STATE_CRITICAL;
- else if (percent_used >= warn_percent || free_swap <= warn_size)
- result = STATE_WARNING;
+ if (strstr (input_buffer, SWAP_LINE)) {
+ sscanf (input_buffer, SWAP_FORMAT, &total_swap, &free_swap);
+ used_swap = total_swap - free_swap;
+ percent_used = 100 * ((float) used_swap) / ((float) total_swap);
+ status = ssprintf
+ (status,
+ "%s %2d%% (%d bytes out of %d)",
+ status, percent_used, used_swap, total_swap);
+ if (percent_used >= crit_percent || free_swap <= crit_size)
+ result = STATE_CRITICAL;
+ else if (percent_used >= warn_percent || free_swap <= warn_size)
+ result = STATE_WARNING;
+ }
}
/* If we get anything on STDERR, at least set warning */
--- nagiosplug-1.3-beta1/plugins/config.h.in Thu Jun 13 07:02:16 2002
+++ nagiosplug-1.3-beta1.new/plugins/config.h.in Mon Oct 14 12:10:37 2002
@@ -1,54 +1,4 @@
-/* plugins/config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define for DGUX with <sys/dg_sys_info.h>. */
-#undef DGUX
-
-/* Define if the `getloadavg' function needs to be run setuid or setgid. */
-#undef GETLOADAVG_PRIVILEGED
-
-/* Define if your system has its own `getloadavg' function. */
-#undef HAVE_GETLOADAVG
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if your struct nlist has an n_un member. */
-#undef NLIST_NAME_UNION
-
-/* Define if you have <nlist.h>. */
-#undef NLIST_STRUCT
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef pid_t
-
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define on System V Release 4. */
-#undef SVR4
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
-
-/* Define for Encore UMAX. */
-#undef UMAX
-
-/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
- instead of <sys/cpustats.h>. */
-#undef UMAX4_3
-
+/* plugins/config.h.in. Generated from configure.in by autoheader. */
#undef CGIURL
#undef DF_COMMAND
#undef HAVE_GETOPT_H
@@ -86,6 +36,7 @@
#undef SSH_COMMAND
#undef SWAP_COMMAND
#undef SWAP_FORMAT
+#undef SWAP_LINE
#undef USE_PS_VARS
#undef VSZ_COMMAND
#undef VSZ_FORMAT
@@ -93,137 +44,230 @@
#undef PACKAGE
#undef VERSION
-/* Define if you have the getloadavg function. */
-#undef HAVE_GETLOADAVG
+/* Define to 1 if using `getloadavg.c'. */
+#undef C_GETLOADAVG
-/* Define if you have the getopt_long_only function. */
-#undef HAVE_GETOPT_LONG_ONLY
+/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
+#undef DGUX
-/* Define if you have the select function. */
-#undef HAVE_SELECT
+/* Define to 1 if the `getloadavg' function needs to be run setuid or setgid.
+ */
+#undef GETLOADAVG_PRIVILEGED
-/* Define if you have the socket function. */
-#undef HAVE_SOCKET
+/* Define to 1 if you have the <crypto.h> header file. */
+#undef HAVE_CRYPTO_H
-/* Define if you have the strdup function. */
-#undef HAVE_STRDUP
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
-/* Define if you have the strstr function. */
-#undef HAVE_STRSTR
+/* Define to 1 if you have the <err.h> header file. */
+#undef HAVE_ERR_H
-/* Define if you have the strtod function. */
-#undef HAVE_STRTOD
+/* Define to 1 if you have the `getloadavg' function. */
+#undef HAVE_GETLOADAVG
-/* Define if you have the strtol function. */
-#undef HAVE_STRTOL
+/* Define to 1 if you have the `getopt_long_only' function. */
+#undef HAVE_GETOPT_LONG_ONLY
-/* Define if you have the strtoul function. */
-#undef HAVE_STRTOUL
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
-/* Define if you have the <crypto.h> header file. */
-#undef HAVE_CRYPTO_H
+/* Define to 1 if you have the `crypt' library (-lcrypt). */
+#undef HAVE_LIBCRYPT
-/* Define if you have the <err.h> header file. */
-#undef HAVE_ERR_H
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#undef HAVE_LIBCRYPTO
-/* Define if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
+/* Define to 1 if you have the `dgc' library (-ldgc). */
+#undef HAVE_LIBDGC
+
+/* Define to 1 if you have the `kstat' library (-lkstat). */
+#undef HAVE_LIBKSTAT
+
+/* Define to 1 if you have the `ldap' library (-lldap). */
+#undef HAVE_LIBLDAP
+
+/* Define to 1 if you have the `pq' library (-lpq). */
+#undef HAVE_LIBPQ
-/* Define if you have the <libpq-fe.h> header file. */
+/* Define to 1 if you have the <libpq-fe.h> header file. */
#undef HAVE_LIBPQ_FE_H
-/* Define if you have the <mach/mach.h> header file. */
+/* Define to 1 if you have the `radiusclient' library (-lradiusclient). */
+#undef HAVE_LIBRADIUSCLIENT
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
#undef HAVE_MACH_MACH_H
-/* Define if you have the <mysql/errmsg.h> header file. */
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <mysql/errmsg.h> header file. */
#undef HAVE_MYSQL_ERRMSG_H
-/* Define if you have the <mysql/mysql.h> header file. */
+/* Define to 1 if you have the <mysql/mysql.h> header file. */
#undef HAVE_MYSQL_MYSQL_H
-/* Define if you have the <openssl/crypto.h> header file. */
+/* Define to 1 if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
+/* Define to 1 if you have the <openssl/crypto.h> header file. */
#undef HAVE_OPENSSL_CRYPTO_H
-/* Define if you have the <openssl/err.h> header file. */
+/* Define to 1 if you have the <openssl/err.h> header file. */
#undef HAVE_OPENSSL_ERR_H
-/* Define if you have the <openssl/pem.h> header file. */
+/* Define to 1 if you have the <openssl/pem.h> header file. */
#undef HAVE_OPENSSL_PEM_H
-/* Define if you have the <openssl/rsa.h> header file. */
+/* Define to 1 if you have the <openssl/rsa.h> header file. */
#undef HAVE_OPENSSL_RSA_H
-/* Define if you have the <openssl/ssl.h> header file. */
+/* Define to 1 if you have the <openssl/ssl.h> header file. */
#undef HAVE_OPENSSL_SSL_H
-/* Define if you have the <openssl/x509.h> header file. */
+/* Define to 1 if you have the <openssl/x509.h> header file. */
#undef HAVE_OPENSSL_X509_H
-/* Define if you have the <pem.h> header file. */
+/* Define to 1 if you have the <pem.h> header file. */
#undef HAVE_PEM_H
-/* Define if you have the <pgsql/libpq-fe.h> header file. */
+/* Define to 1 if you have the <pgsql/libpq-fe.h> header file. */
#undef HAVE_PGSQL_LIBPQ_FE_H
-/* Define if you have the <postgresql/libpq-fe.h> header file. */
+/* Define to 1 if you have the <postgresql/libpq-fe.h> header file. */
#undef HAVE_POSTGRESQL_LIBPQ_FE_H
-/* Define if you have the <regex.h> header file. */
+/* Define to 1 if you have the `pstat_getdynamic' function. */
+#undef HAVE_PSTAT_GETDYNAMIC
+
+/* Define to 1 if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
-/* Define if you have the <rsa.h> header file. */
+/* Define to 1 if you have the <rsa.h> header file. */
#undef HAVE_RSA_H
-/* Define if you have the <signal.h> header file. */
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
-/* Define if you have the <ssl.h> header file. */
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if you have the <ssl.h> header file. */
#undef HAVE_SSL_H
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
-/* Define if you have the <strings.h> header file. */
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
-/* Define if you have the <sys/loadavg.h> header file. */
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the `strtod' function. */
+#undef HAVE_STRTOD
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */
+#undef HAVE_STRUCT_NLIST_N_UN_N_NAME
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
#undef HAVE_SYS_LOADAVG_H
-/* Define if you have the <sys/socket.h> header file. */
+/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
-/* Define if you have the <sys/time.h> header file. */
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
-/* Define if you have the <sys/types.h> header file. */
+/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Define if you have the <syslog.h> header file. */
-#undef HAVE_SYSLOG_H
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
-/* Define if you have the <uio.h> header file. */
+/* Define to 1 if you have the <uio.h> header file. */
#undef HAVE_UIO_H
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the <x509.h> header file. */
+/* Define to 1 if you have the <x509.h> header file. */
#undef HAVE_X509_H
-/* Define if you have the crypt library (-lcrypt). */
-#undef HAVE_LIBCRYPT
+/* Define to 1 if your `struct nlist' has an `n_un' member. Obsolete, depend
+ on `HAVE_STRUCT_NLIST_N_UN_N_NAME */
+#undef NLIST_NAME_UNION
-/* Define if you have the crypto library (-lcrypto). */
-#undef HAVE_LIBCRYPTO
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
-/* Define if you have the dgc library (-ldgc). */
-#undef HAVE_LIBDGC
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
-/* Define if you have the ldap library (-lldap). */
-#undef HAVE_LIBLDAP
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
-/* Define if you have the pq library (-lpq). */
-#undef HAVE_LIBPQ
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
-/* Define if you have the radiusclient library (-lradiusclient). */
-#undef HAVE_LIBRADIUSCLIENT
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 on System V Release 4. */
+#undef SVR4
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Define to 1 for Encore UMAX. */
+#undef UMAX
+
+/* Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h> instead of
+ <sys/cpustats.h>. */
+#undef UMAX4_3
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
--- nagiosplug-1.3-beta1/plugins/snprintf.c Wed Feb 27 22:42:59 2002
+++ nagiosplug-1.3-beta1.new/plugins/snprintf.c Mon Oct 14 12:15:27 2002
@@ -34,7 +34,7 @@
/* Some changes made by bbraun@synack.net for use with xinetd */
-#if !defined(HAVE_SNPRINTF)
+#if defined(HAVE_SNPRINTF)
/* Extracted from sendmail 8.8.5 */
#ifndef lint
|