diff options
Diffstat (limited to 'web/attachments/415177-check_icmp.patch')
-rw-r--r-- | web/attachments/415177-check_icmp.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/web/attachments/415177-check_icmp.patch b/web/attachments/415177-check_icmp.patch new file mode 100644 index 0000000..570e4f7 --- /dev/null +++ b/web/attachments/415177-check_icmp.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | --- check_icmp.c.orig 2011-06-12 13:05:39.000000000 +0200 | ||
2 | +++ check_icmp.c 2011-06-12 13:21:28.000000000 +0200 | ||
3 | @@ -204,7 +204,7 @@ | ||
4 | /** global variables **/ | ||
5 | static struct rta_host **table, *cursor, *list; | ||
6 | static threshold crit = {80, 500000}, warn = {40, 200000}; | ||
7 | -static int mode, protocols, sockets, debug = 0, timeout = 10; | ||
8 | +static int mode, protocols, sockets, debug = 0, timeout = 10, allperf = 1; | ||
9 | static unsigned short icmp_data_size = DEFAULT_PING_DATA_SIZE; | ||
10 | static unsigned short icmp_pkt_size = DEFAULT_PING_DATA_SIZE + ICMP_MINLEN; | ||
11 | |||
12 | @@ -456,7 +456,7 @@ | ||
13 | |||
14 | /* parse the arguments */ | ||
15 | for(i = 1; i < argc; i++) { | ||
16 | - while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) { | ||
17 | + while((arg = getopt(argc, argv, "vhVaw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) { | ||
18 | long size; | ||
19 | switch(arg) { | ||
20 | case 'v': | ||
21 | @@ -512,6 +512,9 @@ | ||
22 | case 's': /* specify source IP address */ | ||
23 | set_source_ip(optarg); | ||
24 | break; | ||
25 | + case 'a': | ||
26 | + allperf = 0; | ||
27 | + break; | ||
28 | case 'V': /* version */ | ||
29 | print_revision (progname, NP_VERSION); | ||
30 | exit (STATE_OK); | ||
31 | @@ -1002,12 +1005,16 @@ | ||
32 | host = list; | ||
33 | while(host) { | ||
34 | if(debug) puts(""); | ||
35 | - printf("%srta=%0.3fms;%0.3f;%0.3f;0; %spl=%u%%;%u;%u;; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ", | ||
36 | + if(allperf) printf("%srta=%0.3fms;%0.3f;%0.3f;0; %spl=%u%%;%u;%u;; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ", | ||
37 | (targets > 1) ? host->name : "", | ||
38 | host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000, | ||
39 | (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl, | ||
40 | (targets > 1) ? host->name : "", (float)host->rtmax / 1000, | ||
41 | (targets > 1) ? host->name : "", (host->rtmin < DBL_MAX) ? (float)host->rtmin / 1000 : (float)0); | ||
42 | + else printf("%srta=%0.3fms;%0.3f;%0.3f;0; %spl=%u%%;%u;%u;; ", | ||
43 | + (targets > 1) ? host->name : "", | ||
44 | + host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000, | ||
45 | + (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl); | ||
46 | |||
47 | host = host->next; | ||
48 | } | ||
49 | @@ -1315,6 +1322,8 @@ | ||
50 | printf (" %s\n", "-b"); | ||
51 | printf (" %s\n", _("Number of icmp data bytes to send")); | ||
52 | printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN); | ||
53 | + printf (" %s\n", "-a"); | ||
54 | + printf (" %s\n",_("no rtmin/rtmax performance data")); | ||
55 | printf (" %s\n", "-v"); | ||
56 | printf (" %s\n", _("verbose")); | ||
57 | |||