Imported Upstream version 2.0
This commit is contained in:
parent
c89ccc3c74
commit
0841b5c7c7
165 changed files with 25440 additions and 4442 deletions
|
@ -1,9 +1,9 @@
|
|||
#!/usr/local/bin/perl -w
|
||||
#!@PERL@ -w
|
||||
#
|
||||
# check_ifoperstatus.pl - nagios plugin
|
||||
# check_ifoperstatus.pl - monitoring plugin
|
||||
#
|
||||
# Copyright (C) 2000 Christoph Kron,
|
||||
# Modified 5/2002 to conform to updated Nagios Plugin Guidelines
|
||||
# Modified 5/2002 to conform to updated Monitoring Plugins Guidelines
|
||||
# Added support for named interfaces per Valdimir Ivaschenko (S. Ghosh)
|
||||
# Added SNMPv3 support (10/2003)
|
||||
#
|
||||
|
@ -19,10 +19,11 @@
|
|||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
# USA
|
||||
#
|
||||
#
|
||||
# Report bugs to: nagiosplug-help@lists.sourceforge.net
|
||||
# Report bugs to: help@monitoring-plugins.org
|
||||
#
|
||||
# 11.01.2000 Version 1.0
|
||||
#
|
||||
|
@ -34,7 +35,9 @@
|
|||
|
||||
use POSIX;
|
||||
use strict;
|
||||
use lib utils.pm ;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use lib '@libexecdir@';
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support);
|
||||
|
||||
use Net::SNMP;
|
||||
|
@ -47,6 +50,10 @@ sub usage ($);
|
|||
sub print_usage ();
|
||||
sub process_arguments ();
|
||||
|
||||
$ENV{'PATH'}='@TRUSTED_PATH@';
|
||||
$ENV{'BASH_ENV'}='';
|
||||
$ENV{'ENV'}='';
|
||||
|
||||
my $timeout;
|
||||
my $status;
|
||||
my %ifOperStatus = ('1','up',
|
||||
|
@ -97,7 +104,7 @@ my %session_opts;
|
|||
$status = process_arguments();
|
||||
|
||||
|
||||
# Just in case of problems, let's not hang Nagios
|
||||
# Just in case of problems, let's not hang the monitoring system
|
||||
$SIG{'ALRM'} = sub {
|
||||
print ("ERROR: No snmp response from $hostname (alarm)\n");
|
||||
exit $ERRORS{"UNKNOWN"};
|
||||
|
@ -288,7 +295,7 @@ sub print_usage() {
|
|||
sub print_help() {
|
||||
print_revision($PROGNAME, '@NP_VERSION@');
|
||||
print_usage();
|
||||
printf "check_ifoperstatus plugin for Nagios monitors operational \n";
|
||||
printf "check_ifoperstatus plugin for monitoring operational \n";
|
||||
printf "status of a particular network interface on the target host\n";
|
||||
printf "\nUsage:\n";
|
||||
printf " -H (--hostname) Hostname to query - (required)\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue