diff options
author | Matthias Eble <psychotrahe@users.sourceforge.net> | 2008-07-28 20:15:52 +0000 |
---|---|---|
committer | Matthias Eble <psychotrahe@users.sourceforge.net> | 2008-07-28 20:15:52 +0000 |
commit | 3c38fc752e6015541416b7aa9e5b7a740a8357fe (patch) | |
tree | c4f6e20d53b0db10d55d9c8b954c09c4b60c9e34 /plugins-root | |
parent | c64070fd3f924b02a517117bba2dfe702d020a9b (diff) | |
download | monitoring-plugins-3c38fc752e6015541416b7aa9e5b7a740a8357fe.tar.gz |
-b option now specifies ICMP data bytes instead of packet size
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2027 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-root')
-rw-r--r-- | plugins-root/check_icmp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 5fb9c364..fe1f9eef 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -463,13 +463,13 @@ main(int argc, char **argv) case 'b': size = strtol(optarg,NULL,0); if (size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) && - size <= MAX_PING_DATA + ICMP_MINLEN) { - icmp_pkt_size = size; - icmp_data_size = icmp_pkt_size - ICMP_MINLEN; + size < MAX_PING_DATA) { + icmp_data_size = size; + icmp_pkt_size = size + ICMP_MINLEN; } else - usage_va("ICMP packet size must be between: %d and %d", + usage_va("ICMP data length must be between: %d and %d", sizeof(struct icmp) + sizeof(struct icmp_ping_data), - MAX_PING_DATA + ICMP_MINLEN); + MAX_PING_DATA - 1); break; case 'i': @@ -1301,8 +1301,8 @@ print_help(void) printf (" %s",_("timeout value (seconds, currently ")); printf ("%u)\n", timeout); printf (" %s\n", "-b"); - printf (" %s", _("icmp packet size (bytes, currently ")); - printf ("%u)\n", icmp_pkt_size); + printf (" %s\n", _("Number of icmp data bytes to send")); + printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN); printf (" %s\n", "-v"); printf (" %s\n", _("verbose")); |