From fc131783afa09a3542836fd4dd274263245f3d6c Mon Sep 17 00:00:00 2001 From: Julien Mathis Date: Wed, 6 Jun 2007 21:08:18 +0000 Subject: [PATCH] git-svn-id: http://svn.centreon.com/Plugins/Dev@2458 6bcd3966-0018-0410-8128-fd23d134de7e --- .../{check_oreon_ping.pl => check_oreon_ping} | 0 ...verage.pl => check_oreon_snmp_loadaverage} | 0 ...mp_process.pl => check_oreon_snmp_process} | 0 ...age.pl => check_oreon_snmp_remote_storage} | 43 ++++++++----------- ...mp_traffic.pl => check_oreon_snmp_traffic} | 0 ...n_snmp_value.pl => check_oreon_snmp_value} | 0 6 files changed, 19 insertions(+), 24 deletions(-) rename centreon-plugins/src/{check_oreon_ping.pl => check_oreon_ping} (100%) rename centreon-plugins/src/{check_oreon_snmp_loadaverage.pl => check_oreon_snmp_loadaverage} (100%) rename centreon-plugins/src/{check_oreon_snmp_process.pl => check_oreon_snmp_process} (100%) rename centreon-plugins/src/{check_oreon_snmp_remote_storage.pl => check_oreon_snmp_remote_storage} (92%) rename centreon-plugins/src/{check_oreon_snmp_traffic.pl => check_oreon_snmp_traffic} (100%) rename centreon-plugins/src/{check_oreon_snmp_value.pl => check_oreon_snmp_value} (100%) diff --git a/centreon-plugins/src/check_oreon_ping.pl b/centreon-plugins/src/check_oreon_ping similarity index 100% rename from centreon-plugins/src/check_oreon_ping.pl rename to centreon-plugins/src/check_oreon_ping diff --git a/centreon-plugins/src/check_oreon_snmp_loadaverage.pl b/centreon-plugins/src/check_oreon_snmp_loadaverage similarity index 100% rename from centreon-plugins/src/check_oreon_snmp_loadaverage.pl rename to centreon-plugins/src/check_oreon_snmp_loadaverage diff --git a/centreon-plugins/src/check_oreon_snmp_process.pl b/centreon-plugins/src/check_oreon_snmp_process similarity index 100% rename from centreon-plugins/src/check_oreon_snmp_process.pl rename to centreon-plugins/src/check_oreon_snmp_process diff --git a/centreon-plugins/src/check_oreon_snmp_remote_storage.pl b/centreon-plugins/src/check_oreon_snmp_remote_storage similarity index 92% rename from centreon-plugins/src/check_oreon_snmp_remote_storage.pl rename to centreon-plugins/src/check_oreon_snmp_remote_storage index 79bdc10f0..c9d59422f 100644 --- a/centreon-plugins/src/check_oreon_snmp_remote_storage.pl +++ b/centreon-plugins/src/check_oreon_snmp_remote_storage @@ -80,8 +80,8 @@ if ($opt_h) { exit $ERRORS{'OK'}; } if (!$opt_H) { -print_usage(); -exit $ERRORS{'OK'}; + print_usage(); + exit $ERRORS{'OK'}; } if ($opt_n && !$opt_d) { @@ -89,40 +89,35 @@ if ($opt_n && !$opt_d) { exit $ERRORS{'UNKNOWN'}; } my $snmp = "1"; -if ($opt_v && $opt_v =~ /^[0-9]$/) { -$snmp = $opt_v; -} +$snmp = $opt_v if ($opt_v && $opt_v =~ /^[0-9]$/); if ($snmp eq "3") { -if (!$opt_u) { -print "Option -u (--username) is required for snmpV3\n"; -exit $ERRORS{'OK'}; -} -if (!$opt_p && !$opt_k) { -print "Option -k (--key) or -p (--password) is required for snmpV3\n"; -exit $ERRORS{'OK'}; -}elsif ($opt_p && $opt_k) { -print "Only option -k (--key) or -p (--password) is needed for snmpV3\n"; -exit $ERRORS{'OK'}; -} + if (!$opt_u) { + print "Option -u (--username) is required for snmpV3\n"; + exit $ERRORS{'OK'}; + } + if (!$opt_p && !$opt_k) { + print "Option -k (--key) or -p (--password) is required for snmpV3\n"; + exit $ERRORS{'OK'}; + } elsif ($opt_p && $opt_k) { + print "Only option -k (--key) or -p (--password) is needed for snmpV3\n"; + exit $ERRORS{'OK'}; + } } -if (!$opt_C) { -$opt_C = "public"; -} -if (!$opt_d) { -$opt_d = 2; -} +$opt_C = "public" if (!$opt_C); +$opt_d = 2 if (!$opt_d); + ($opt_d) || ($opt_d = shift) || ($opt_d = 2); my $partition = 0; if ($opt_d =~ /([0-9]+)/ && !$opt_n){ $partition = $1; -} -elsif (!$opt_n){ +} elsif (!$opt_n){ print "Unknown -d number expected... or it doesn't exist, try another disk - number\n"; exit $ERRORS{'UNKNOWN'}; } + my $critical = 95; if ($opt_c && $opt_c =~ /^[0-9]+$/) { $critical = $opt_c; diff --git a/centreon-plugins/src/check_oreon_snmp_traffic.pl b/centreon-plugins/src/check_oreon_snmp_traffic similarity index 100% rename from centreon-plugins/src/check_oreon_snmp_traffic.pl rename to centreon-plugins/src/check_oreon_snmp_traffic diff --git a/centreon-plugins/src/check_oreon_snmp_value.pl b/centreon-plugins/src/check_oreon_snmp_value similarity index 100% rename from centreon-plugins/src/check_oreon_snmp_value.pl rename to centreon-plugins/src/check_oreon_snmp_value