summaryrefslogtreecommitdiffstats
path: root/web/attachments/50746-perf.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/50746-perf.patch')
-rw-r--r--web/attachments/50746-perf.patch386
1 files changed, 386 insertions, 0 deletions
diff --git a/web/attachments/50746-perf.patch b/web/attachments/50746-perf.patch
new file mode 100644
index 0000000..72f1aad
--- /dev/null
+++ b/web/attachments/50746-perf.patch
@@ -0,0 +1,386 @@
1Only in nagios-plugins-1.3.0/plugins: Makefile
2Only in nagios-plugins-1.3.0/plugins: check_by_ssh
3Only in nagios-plugins-1.3.0/plugins: check_by_ssh.o
4Only in nagios-plugins-1.3.0/plugins: check_dig
5Only in nagios-plugins-1.3.0/plugins: check_dig.o
6Only in nagios-plugins-1.3.0/plugins: check_disk
7diff -u nagios-plugins-1.3.0-orig/plugins/check_disk.c nagios-plugins-1.3.0/plugins/check_disk.c
8--- nagios-plugins-1.3.0-orig/plugins/check_disk.c 2003-02-15 13:48:44.000000000 +0100
9+++ nagios-plugins-1.3.0/plugins/check_disk.c 2003-05-20 12:51:58.000000000 +0200
10@@ -28,6 +28,8 @@
11 * initailize usp to -1, eliminate 'found' variable
12 * accept any filename/filesystem
13 * use sscanf, drop while loop
14+ * - Modification by www.datux.nl 2003-01-24
15+ * added performance data output
16 *
17 *****************************************************************************/
18
19@@ -64,6 +66,9 @@
20 int total_disk = -1;
21 int used_disk = -1;
22 int free_disk = -1;
23+ int perf_total_disk = 0;
24+ int perf_free_disk = 0;
25+ int perf_used_disk = 0;
26 int result = STATE_UNKNOWN;
27 int disk_result = STATE_UNKNOWN;
28 char *command_line = "";
29@@ -96,6 +101,7 @@
30 if (!index (input_buffer, '/'))
31 continue;
32
33+ /* did we get some usefull output from the 'df' process? */
34 if (sscanf (input_buffer, "%s %d %d %d %d%% %s", file_system,
35 &total_disk, &used_disk, &free_disk, &usp, mntp) == 6 ||
36 sscanf (input_buffer, "%s %*s %d %d %d %d%% %s", file_system,
37@@ -118,6 +124,9 @@
38 free_disk, 100 - usp, display_mntp ? mntp : file_system);
39
40 result = max_state (result, disk_result);
41+ perf_total_disk+=total_disk;
42+ perf_free_disk+=free_disk;
43+ perf_used_disk+=used_disk;
44 }
45
46 else {
47@@ -147,8 +156,14 @@
48 else if (result == STATE_UNKNOWN)
49 printf ("Unable to read output\n%s\n%s\n", command_line, input_buffer);
50 else
51- printf ("DISK %s%s\n", state_text (result), output);
52-
53+ printf ("DISK %s%s|total=%d,used=%d,free=%d,used_perc=%f,free_perc=%f\n",
54+ state_text (result),
55+ output,
56+ perf_total_disk,
57+ perf_used_disk,
58+ perf_free_disk,
59+ 100-((float)perf_free_disk*100/(float)perf_total_disk),
60+ ((float)perf_free_disk*100/(float)perf_total_disk));
61 return result;
62 }
63
64Only in nagios-plugins-1.3.0/plugins: check_disk.o
65Only in nagios-plugins-1.3.0/plugins: check_dns
66Only in nagios-plugins-1.3.0/plugins: check_dns.o
67Only in nagios-plugins-1.3.0/plugins: check_dummy
68Only in nagios-plugins-1.3.0/plugins: check_dummy.o
69Only in nagios-plugins-1.3.0/plugins: check_ftp
70Only in nagios-plugins-1.3.0/plugins: check_http
71diff -u nagios-plugins-1.3.0-orig/plugins/check_http.c nagios-plugins-1.3.0/plugins/check_http.c
72--- nagios-plugins-1.3.0-orig/plugins/check_http.c 2003-02-22 08:22:02.000000000 +0100
73+++ nagios-plugins-1.3.0/plugins/check_http.c 2003-05-20 12:51:58.000000000 +0200
74@@ -21,6 +21,9 @@
75 *
76 * $Id: check_http.c,v 1.24 2003/02/21 21:59:17 tonvoon Exp $
77 *
78+ * Sun Feb 9 17:11:53 CET 2003 Modified by Edwin Eefting (edwin@datux.nl)
79+ * fixed performance data: no spaces please :)
80+ *
81 *****************************************************************************/
82
83 const char *progname = "check_http";
84@@ -795,7 +798,7 @@
85 else if (onredirect == STATE_CRITICAL)
86 printf ("HTTP CRITICAL");
87 elapsed_time = delta_time (tv);
88- asprintf (&msg, ": %s - %7.3f second response time %s%s|time=%7.3f\n",
89+ asprintf (&msg, ": %s - %7.3f second response time %s%s|time=%f\n",
90 status_line, elapsed_time, timestamp,
91 (display_html ? "</A>" : ""), elapsed_time);
92 terminate (onredirect, msg);
93@@ -807,7 +810,7 @@
94
95 /* check elapsed time */
96 elapsed_time = delta_time (tv);
97- asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n",
98+ asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%f\n",
99 status_line, elapsed_time, timestamp,
100 (display_html ? "</A>" : ""), elapsed_time);
101 if (check_critical_time == TRUE && elapsed_time > critical_time)
102@@ -835,14 +838,14 @@
103 if (strlen (regexp)) {
104 errcode = regexec (&preg, page, REGS, pmatch, 0);
105 if (errcode == 0) {
106- printf ("HTTP ok: %s - %7.3f second response time %s%s|time=%7.3f\n",
107+ printf ("HTTP ok: %s - %7.3f second response time %s%s|time=%f\n",
108 status_line, elapsed_time,
109 timestamp, (display_html ? "</A>" : ""), elapsed_time);
110 exit (STATE_OK);
111 }
112 else {
113 if (errcode == REG_NOMATCH) {
114- printf ("HTTP CRITICAL: pattern not found%s|time=%7.3f\n",
115+ printf ("HTTP CRITICAL: pattern not found%s|time=%f\n",
116 (display_html ? "</A>" : ""), elapsed_time);
117 exit (STATE_CRITICAL);
118 }
119@@ -856,7 +859,7 @@
120 #endif
121
122 /* We only get here if all tests have been passed */
123- asprintf (&msg, "HTTP ok: %s - %7.3f second response time %s%s|time=%7.3f\n",
124+ asprintf (&msg, "HTTP ok: %s - %7.3f second response time %s%s|time=%f\n",
125 status_line, (float)elapsed_time,
126 timestamp, (display_html ? "</A>" : ""), elapsed_time);
127 terminate (STATE_OK, msg);
128Only in nagios-plugins-1.3.0/plugins: check_http.c.rej
129Only in nagios-plugins-1.3.0/plugins: check_http.c~
130Only in nagios-plugins-1.3.0/plugins: check_http.o
131Only in nagios-plugins-1.3.0/plugins: check_imap
132Only in nagios-plugins-1.3.0/plugins: check_load
133diff -u nagios-plugins-1.3.0-orig/plugins/check_load.c nagios-plugins-1.3.0/plugins/check_load.c
134--- nagios-plugins-1.3.0-orig/plugins/check_load.c 2003-02-18 23:16:06.000000000 +0100
135+++ nagios-plugins-1.3.0/plugins/check_load.c 2003-05-20 12:51:58.000000000 +0200
136@@ -19,6 +19,9 @@
137 * mods by Ethan Galstad (nagios@nagios.org)
138 * 08/18/1999 - Integrated some code with common plugin utilities
139 * mods by Ethan Galstad (nagios@nagios.org)
140+ * 20/01/2003 - Now returns performance data
141+ * mods by Edwin Eefting (www.DatuX.nl)
142+ *
143 * $Date: 2003/02/18 22:10:55 $
144 * Note: The load format is the same used by "uptime" and "w"
145 *
146@@ -139,6 +142,10 @@
147 }
148 if ((la1 >= wload1) || (la5 >= wload5) || (la15 >= wload15)) {
149 printf ("WARNING - %s\n", status_line);
150+
151+ /* performance data */
152+ printf ("|load1=%.2f,load5=%.2f,load15=%.2f", la1, la5, la15);
153+
154 return STATE_WARNING;
155 }
156 printf ("OK - %s\n", status_line);
157Only in nagios-plugins-1.3.0/plugins: check_load.o
158Only in nagios-plugins-1.3.0/plugins: check_mrtg
159Only in nagios-plugins-1.3.0/plugins: check_mrtg.o
160Only in nagios-plugins-1.3.0/plugins: check_mrtgtraf
161Only in nagios-plugins-1.3.0/plugins: check_mrtgtraf.o
162Only in nagios-plugins-1.3.0/plugins: check_mysql
163Only in nagios-plugins-1.3.0/plugins: check_mysql.o
164Only in nagios-plugins-1.3.0/plugins: check_nagios
165Only in nagios-plugins-1.3.0/plugins: check_nagios.o
166Only in nagios-plugins-1.3.0/plugins: check_nntp
167Only in nagios-plugins-1.3.0/plugins: check_nt
168Only in nagios-plugins-1.3.0/plugins: check_nt.o
169Only in nagios-plugins-1.3.0/plugins: check_nwstat
170Only in nagios-plugins-1.3.0/plugins: check_nwstat.o
171Only in nagios-plugins-1.3.0/plugins: check_overcr
172Only in nagios-plugins-1.3.0/plugins: check_overcr.o
173Only in nagios-plugins-1.3.0/plugins: check_ping
174diff -u nagios-plugins-1.3.0-orig/plugins/check_ping.c nagios-plugins-1.3.0/plugins/check_ping.c
175--- nagios-plugins-1.3.0-orig/plugins/check_ping.c 2003-02-15 13:48:45.000000000 +0100
176+++ nagios-plugins-1.3.0/plugins/check_ping.c 2003-05-20 12:51:58.000000000 +0200
177@@ -8,6 +8,10 @@
178 *
179 * $Id: check_ping.c,v 1.11 2003/01/13 12:15:16 kdebisschop Exp $
180 *
181+* updated Mon Jan 20 19:03:57 CET 2003 by Edwin Eefting (DatuX.nl)
182+* -minor bugfixes
183+* -now returns performance data
184+*
185 *****************************************************************************/
186
187 const char *progname = "check_ping";
188@@ -18,7 +22,7 @@
189 #define SUMMARY "Use ping to check connection statistics for a remote host.\n"
190
191 #define OPTIONS "\
192--H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n\
193+-H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%\n\
194 [-p packets] [-t timeout] [-L]\n"
195
196 #define LONGOPTIONS "\
197@@ -135,14 +139,19 @@
198 state_text (result), warn_text, pl, rta);
199 if (display_html == TRUE)
200 printf ("</A>");
201- printf ("\n");
202+
203+ /* print performance data */
204+ printf("|loss=%d",pl);
205+ if (pl != 100)
206+ printf(",rta=%f",rta);
207+ printf("\n");
208
209 if (verbose)
210 printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl);
211
212 return result;
213 }
214-
215+
216
217 /* process command-line arguments */
218 int
219@@ -340,7 +349,7 @@
220 if (max_packets == -1)
221 max_packets = DEFAULT_MAX_PACKETS;
222
223- max_seconds = crta / 1000.0 * max_packets + max_packets;
224+ max_seconds = crta / 1000.0 * max_packets + max_packets + 10;
225 if (max_seconds > timeout_interval)
226 timeout_interval = (int)max_seconds;
227
228Only in nagios-plugins-1.3.0/plugins: check_ping.o
229Only in nagios-plugins-1.3.0/plugins: check_pop
230Only in nagios-plugins-1.3.0/plugins: check_procs
231diff -u nagios-plugins-1.3.0-orig/plugins/check_procs.c nagios-plugins-1.3.0/plugins/check_procs.c
232--- nagios-plugins-1.3.0-orig/plugins/check_procs.c 2003-02-15 13:48:45.000000000 +0100
233+++ nagios-plugins-1.3.0/plugins/check_procs.c 2003-05-20 12:51:58.000000000 +0200
234@@ -32,6 +32,9 @@
235 * along with this program; if not, write to the Free Software
236 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
237 *
238+* feb-9-2003 modified by Edwin Eefting (www.DatuX.nl) edwin@datux.nl
239+* returns performance data
240+*
241 ******************************************************************************/
242
243 const char *progname = "check_procs";
244@@ -197,6 +200,9 @@
245 return result;
246 }
247
248+ //add performance data to "format string"
249+ asprintf(&fmt,"%s|procs=%d\n",fmt,procs);
250+
251 if (verbose && (options & STAT))
252 printf ("%s ", statopts);
253 if (verbose && (options & PROG))
254@@ -427,6 +433,7 @@
255 options |= STAT;
256 }
257
258+
259 return validate_arguments ();
260 }
261
262@@ -457,10 +464,10 @@
263
264 if (options == 0) {
265 options = 1;
266- asprintf (&fmt, "%%s - %%d processes running\n");
267+ asprintf (&fmt, "%%s - %%d processes running");
268 }
269 else {
270- asprintf (&fmt, "%%s - %%d processes running with %s\n", fmt);
271+ asprintf (&fmt, "%%s - %%d processes running with %s", fmt);
272 }
273
274 return options;
275Only in nagios-plugins-1.3.0/plugins: check_procs.o
276Only in nagios-plugins-1.3.0/plugins: check_real
277Only in nagios-plugins-1.3.0/plugins: check_real.o
278Only in nagios-plugins-1.3.0/plugins: check_smtp
279Only in nagios-plugins-1.3.0/plugins: check_smtp.o
280Only in nagios-plugins-1.3.0/plugins: check_ssh
281Only in nagios-plugins-1.3.0/plugins: check_ssh.o
282Only in nagios-plugins-1.3.0/plugins: check_swap
283diff -u nagios-plugins-1.3.0-orig/plugins/check_swap.c nagios-plugins-1.3.0/plugins/check_swap.c
284--- nagios-plugins-1.3.0-orig/plugins/check_swap.c 2003-02-18 06:35:52.000000000 +0100
285+++ nagios-plugins-1.3.0/plugins/check_swap.c 2003-05-20 14:02:11.000000000 +0200
286@@ -23,6 +23,9 @@
287 *
288 * $Id: check_swap.c,v 1.9 2003/02/18 03:46:15 sghosh Exp $
289 *
290+ * feb 9 2003 - Modified by Edwin Eefting (www.DatuX.nl) edwin@datux.nl
291+ * Returns performance data
292+ *
293 *****************************************************************************/
294
295 #include "common.h"
296@@ -51,7 +54,7 @@
297 int
298 main (int argc, char **argv)
299 {
300- int percent_used, percent;
301+ float percent_used, percent;
302 long unsigned int total_swap = 0, used_swap = 0, free_swap = 0;
303 long unsigned int total, used, free;
304 int result = STATE_OK;
305@@ -93,8 +96,8 @@
306 result = max_state (STATE_CRITICAL, result);
307 else if (percent_used >= warn_percent || free_swap <= warn_size)
308 result = max_state (STATE_WARNING, result);
309- asprintf (&status, "%s %2d%% (%lu out of %lu)", status, percent_used,
310- used_swap, total_swap);
311+ asprintf (&status, "%s %2.0f%% (%lu out of %lu)|user_perc=%f,user=%d,total=%d", status, percent_used,
312+ used_swap, total_swap, percent_used, used_swap, total_swap);
313 fclose (fp);
314 #else
315 #ifdef HAVE_SWAP
316@@ -146,8 +149,8 @@
317 result = max_state (STATE_CRITICAL, result);
318 else if (percent_used >= warn_percent || free_swap <= warn_size)
319 result = max_state (STATE_WARNING, result);
320- asprintf (&status, "%s %2d%% (%lu out of %lu)",
321- status, percent_used, used_swap, total_swap);
322+ asprintf (&status, "%s %2.0f%% (%lu out of %lu)|used_perc=%f,user=%d,total=%d",
323+ status, percent_used, used_swap, total_swap, percent_used, used_swap, total_swap);
324
325 /* If we get anything on STDERR, at least set warning */
326 while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr))
327Only in nagios-plugins-1.3.0/plugins: check_swap.c.rej
328Only in nagios-plugins-1.3.0/plugins: check_swap.c~
329Only in nagios-plugins-1.3.0/plugins: check_swap.o
330Only in nagios-plugins-1.3.0/plugins: check_tcp
331Only in nagios-plugins-1.3.0/plugins: check_tcp.o
332Only in nagios-plugins-1.3.0/plugins: check_time
333Only in nagios-plugins-1.3.0/plugins: check_time.o
334Only in nagios-plugins-1.3.0/plugins: check_udp
335Only in nagios-plugins-1.3.0/plugins: check_udp.o
336Only in nagios-plugins-1.3.0/plugins: check_ups
337Only in nagios-plugins-1.3.0/plugins: check_ups.o
338Only in nagios-plugins-1.3.0/plugins: check_users
339diff -u nagios-plugins-1.3.0-orig/plugins/check_users.c nagios-plugins-1.3.0/plugins/check_users.c
340--- nagios-plugins-1.3.0-orig/plugins/check_users.c 2003-02-15 13:48:46.000000000 +0100
341+++ nagios-plugins-1.3.0/plugins/check_users.c 2003-05-20 12:51:58.000000000 +0200
342@@ -42,6 +42,9 @@
343 * along with this program; if not, write to the Free Software
344 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
345 *
346+ * feb-9-2003 modified by Edwin Eefting (www.DatuX.nl) edwin@datux.nl
347+ * returns performance data
348+ *
349 *****************************************************************************/
350
351 #include "common.h"
352@@ -120,8 +123,8 @@
353 if (result == STATE_UNKNOWN)
354 printf ("Unable to read output\n");
355 else
356- printf ("USERS %s - %d users currently logged in\n", state_text (result),
357- users);
358+ printf ("USERS %s - %d users currently logged in|users=%d\n", state_text (result),
359+ users,users);
360
361 return result;
362 }
363Only in nagios-plugins-1.3.0/plugins: check_users.o
364Only in nagios-plugins-1.3.0/plugins: check_vsz
365Only in nagios-plugins-1.3.0/plugins: check_vsz.o
366Only in nagios-plugins-1.3.0/plugins: common.h
367Only in nagios-plugins-1.3.0/plugins: config.h
368Only in nagios-plugins-1.3.0/plugins: negate
369Only in nagios-plugins-1.3.0/plugins: negate.o
370Only in nagios-plugins-1.3.0/plugins: netutils.h
371Only in nagios-plugins-1.3.0/plugins: netutils.o
372Only in nagios-plugins-1.3.0/plugins: perf.patch
373Only in nagios-plugins-1.3.0/plugins: popen.h
374Only in nagios-plugins-1.3.0/plugins: popen.o
375Only in nagios-plugins-1.3.0/plugins: stamp-h1
376Only in nagios-plugins-1.3.0/plugins: stamp-h2
377Only in nagios-plugins-1.3.0/plugins: stamp-h3
378Only in nagios-plugins-1.3.0/plugins: stamp-h4
379Only in nagios-plugins-1.3.0/plugins: stamp-h5
380Only in nagios-plugins-1.3.0/plugins: stamp-h6
381Common subdirectories: nagios-plugins-1.3.0-orig/plugins/t and nagios-plugins-1.3.0/plugins/t
382Only in nagios-plugins-1.3.0/plugins: urlize
383Only in nagios-plugins-1.3.0/plugins: urlize.o
384Only in nagios-plugins-1.3.0/plugins: utils.h
385Only in nagios-plugins-1.3.0/plugins: utils.o
386Only in nagios-plugins-1.3.0/plugins: version.h