diff options
Diffstat (limited to 'web/attachments/98403-check_ifoperstatus-admin.diff')
-rw-r--r-- | web/attachments/98403-check_ifoperstatus-admin.diff | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/web/attachments/98403-check_ifoperstatus-admin.diff b/web/attachments/98403-check_ifoperstatus-admin.diff new file mode 100644 index 0000000..8127684 --- /dev/null +++ b/web/attachments/98403-check_ifoperstatus-admin.diff | |||
@@ -0,0 +1,85 @@ | |||
1 | *** nagios-plugins-1.3.1/plugins-scripts/check_ifoperstatus.pl Wed Feb 12 05:32:20 2003 | ||
2 | --- check_ifoperstatus.pl Thu Aug 19 15:34:22 2004 | ||
3 | *************** | ||
4 | *** 78,83 **** | ||
5 | --- 78,84 ---- | ||
6 | my $key; | ||
7 | my $lastc; | ||
8 | my $dormantWarn; | ||
9 | + my $adminWarn; | ||
10 | my $name; | ||
11 | |||
12 | |||
13 | *************** | ||
14 | *** 104,110 **** | ||
15 | "H=s" => \$hostname, "hostname=s" => \$hostname, | ||
16 | "I" => \$ifXTable, "ifmib" => \$ifXTable, | ||
17 | "n=s" => \$ifName, "name=s" => \$ifName, | ||
18 | ! "w=s" => \$dormantWarn, "warn=s" => \$dormantWarn ); | ||
19 | |||
20 | |||
21 | |||
22 | --- 105,112 ---- | ||
23 | "H=s" => \$hostname, "hostname=s" => \$hostname, | ||
24 | "I" => \$ifXTable, "ifmib" => \$ifXTable, | ||
25 | "n=s" => \$ifName, "name=s" => \$ifName, | ||
26 | ! "w=s" => \$dormantWarn, "warn=s" => \$dormantWarn, | ||
27 | ! "a=s" => \$adminWarn, "admin-down=s" => \$adminWarn ); | ||
28 | |||
29 | |||
30 | |||
31 | *************** | ||
32 | *** 235,243 **** | ||
33 | ## if AdminStatus is down - some one made a consious effort to change config | ||
34 | ## | ||
35 | if ( not ($response->{$snmpIfAdminStatus} == 1) ) { | ||
36 | ! $state = 'WARNING'; | ||
37 | ! $answer = "Interface $name (index $snmpkey) is administratively down."; | ||
38 | ! | ||
39 | } | ||
40 | ## Check operational status | ||
41 | elsif ( $response->{$snmpIfOperStatus} == 2 ) { | ||
42 | --- 237,252 ---- | ||
43 | ## if AdminStatus is down - some one made a consious effort to change config | ||
44 | ## | ||
45 | if ( not ($response->{$snmpIfAdminStatus} == 1) ) { | ||
46 | ! $answer = "Interface $name (index $snmpkey) is administratively down."; | ||
47 | ! if ( not defined $adminWarn or $adminWarn eq "w" ) { | ||
48 | ! $state = 'WARNING'; | ||
49 | ! } elsif ( $adminWarn eq "i" ) { | ||
50 | ! $state = 'OK'; | ||
51 | ! } elsif ( $adminWarn eq "c" ) { | ||
52 | ! $state = 'CRITICAL'; | ||
53 | ! } else { # If wrong value for -a, say warning | ||
54 | ! $state = 'WARNING'; | ||
55 | ! } | ||
56 | } | ||
57 | ## Check operational status | ||
58 | elsif ( $response->{$snmpIfOperStatus} == 2 ) { | ||
59 | *************** | ||
60 | *** 246,252 **** | ||
61 | } elsif ( $response->{$snmpIfOperStatus} == 5 ) { | ||
62 | if (defined $dormantWarn ) { | ||
63 | if ($dormantWarn eq "w") { | ||
64 | ! $state = 'WARNNG'; | ||
65 | $answer = "Interface $name (index $snmpkey) is dormant."; | ||
66 | }elsif($dormantWarn eq "c") { | ||
67 | $state = 'CRITICAL'; | ||
68 | --- 255,261 ---- | ||
69 | } elsif ( $response->{$snmpIfOperStatus} == 5 ) { | ||
70 | if (defined $dormantWarn ) { | ||
71 | if ($dormantWarn eq "w") { | ||
72 | ! $state = 'WARNING'; | ||
73 | $answer = "Interface $name (index $snmpkey) is dormant."; | ||
74 | }elsif($dormantWarn eq "c") { | ||
75 | $state = 'CRITICAL'; | ||
76 | *************** | ||
77 | *** 343,348 **** | ||
78 | --- 352,358 ---- | ||
79 | printf " -n (--name) the value should match the returned ifName\n"; | ||
80 | printf " (Implies the use of -I)\n"; | ||
81 | printf " -w (--warn =i|w|c) ignore|warn|crit if the interface is dormant (default critical)\n"; | ||
82 | + printf " -a (--admin-down =i|w|c) same for administratively down interfaces (default warning)\n"; | ||
83 | printf " -V (--version) Plugin version\n"; | ||
84 | printf " -h (--help) usage help \n\n"; | ||
85 | printf " -k or -d must be specified\n\n"; | ||