summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_breeze.pl3
-rw-r--r--plugins-scripts/check_disk_smb.pl3
-rwxr-xr-xplugins-scripts/check_ircd.pl4
-rwxr-xr-xplugins-scripts/check_wave.pl15
-rw-r--r--plugins-scripts/utils.pm.in1
5 files changed, 14 insertions, 12 deletions
diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl
index 05b99203..531625c4 100755
--- a/plugins-scripts/check_breeze.pl
+++ b/plugins-scripts/check_breeze.pl
@@ -14,8 +14,9 @@ sub print_help ();
14sub print_usage (); 14sub print_usage ();
15 15
16$ENV{'PATH'}='@TRUSTED_PATH@'; 16$ENV{'PATH'}='@TRUSTED_PATH@';
17$ENV{'BASH_ENV'}=''; 17$ENV{'BASH_ENV'}='';
18$ENV{'ENV'}=''; 18$ENV{'ENV'}='';
19$ENV{'CDPATH'}='';
19 20
20Getopt::Long::Configure('bundling'); 21Getopt::Long::Configure('bundling');
21GetOptions 22GetOptions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index f4d33a7b..eda8dd48 100644
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -226,7 +226,8 @@ if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
226 my ($total_bytes) = $1 * $2; 226 my ($total_bytes) = $1 * $2;
227 my ($occupied_bytes) = $1 * $2 - $avail_bytes; 227 my ($occupied_bytes) = $1 * $2 - $avail_bytes;
228 my ($avail) = $avail_bytes/1024; 228 my ($avail) = $avail_bytes/1024;
229 my ($capper) = int(($3/$1)*100); 229 my ($capper);
230 if ($1!=0) { $capper = int(($3/$1)*100) } else { $capper=100 };
230 my ($mountpt) = "\\\\$host\\$share"; 231 my ($mountpt) = "\\\\$host\\$share";
231 232
232 # TODO : why is the kB the standard unit for args ? 233 # TODO : why is the kB the standard unit for args ?
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
index 84f20229..4822fe68 100755
--- a/plugins-scripts/check_ircd.pl
+++ b/plugins-scripts/check_ircd.pl
@@ -146,7 +146,6 @@ sub bindRemote ($$)
146{ 146{
147 my ($in_remotehost, $in_remoteport) = @_; 147 my ($in_remotehost, $in_remoteport) = @_;
148 my $proto = getprotobyname('tcp'); 148 my $proto = getprotobyname('tcp');
149 my $sockaddr;
150 my $that; 149 my $that;
151 my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost); 150 my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost);
152 151
@@ -154,8 +153,7 @@ sub bindRemote ($$)
154 print "IRCD UNKNOWN: Could not start socket ($!)\n"; 153 print "IRCD UNKNOWN: Could not start socket ($!)\n";
155 exit $ERRORS{"UNKNOWN"}; 154 exit $ERRORS{"UNKNOWN"};
156 } 155 }
157 $sockaddr = 'S n a4 x8'; 156 $that = pack_sockaddr_in ($in_remoteport, $thataddr);
158 $that = pack($sockaddr, AF_INET, $in_remoteport, $thataddr);
159 if (!connect(ClientSocket, $that)) { 157 if (!connect(ClientSocket, $that)) {
160 print "IRCD UNKNOWN: Could not connect socket ($!)\n"; 158 print "IRCD UNKNOWN: Could not connect socket ($!)\n";
161 exit $ERRORS{"UNKNOWN"}; 159 exit $ERRORS{"UNKNOWN"};
diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl
index 41e15f50..c24015c0 100755
--- a/plugins-scripts/check_wave.pl
+++ b/plugins-scripts/check_wave.pl
@@ -19,6 +19,7 @@ sub print_usage ();
19$ENV{'PATH'}='@TRUSTED_PATH@'; 19$ENV{'PATH'}='@TRUSTED_PATH@';
20$ENV{'BASH_ENV'}=''; 20$ENV{'BASH_ENV'}='';
21$ENV{'ENV'}=''; 21$ENV{'ENV'}='';
22$ENV{'CDPATH'}='';
22 23
23Getopt::Long::Configure('bundling'); 24Getopt::Long::Configure('bundling');
24GetOptions 25GetOptions
@@ -50,34 +51,34 @@ my $critical = $1 if ($opt_c =~ /([0-9]+)/);
50($opt_w) || ($opt_w = shift) || ($opt_w = 60); 51($opt_w) || ($opt_w = shift) || ($opt_w = 60);
51my $warning = $1 if ($opt_w =~ /([0-9]+)/); 52my $warning = $1 if ($opt_w =~ /([0-9]+)/);
52 53
53$low1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; 54$low1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
54@test = split(/ /,$low1); 55@test = split(/ /,$low1);
55$low1 = $test[2]; 56$low1 = $test[2];
56 57
57$med1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; 58$med1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
58@test = split(/ /,$med1); 59@test = split(/ /,$med1);
59$med1 = $test[2]; 60$med1 = $test[2];
60 61
61$high1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; 62$high1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
62@test = split(/ /,$high1); 63@test = split(/ /,$high1);
63$high1 = $test[2]; 64$high1 = $test[2];
64 65
65sleep(2); 66sleep(2);
66 67
67$snr = `snmpget $host public .1.3.6.1.4.1.762.2.5.2.1.17.1`; 68$snr = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.762.2.5.2.1.17.1`;
68@test = split(/ /,$snr); 69@test = split(/ /,$snr);
69$snr = $test[2]; 70$snr = $test[2];
70$snr = int($snr*25); 71$snr = int($snr*25);
71 72
72$low2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; 73$low2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
73@test = split(/ /,$low2); 74@test = split(/ /,$low2);
74$low2 = $test[2]; 75$low2 = $test[2];
75 76
76$med2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; 77$med2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
77@test = split(/ /,$med2); 78@test = split(/ /,$med2);
78$med2 = $test[2]; 79$med2 = $test[2];
79 80
80$high2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; 81$high2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
81@test = split(/ /,$high2); 82@test = split(/ /,$high2);
82$high2 = $test[2]; 83$high2 = $test[2];
83 84
diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in
index 386831eb..c84769fb 100644
--- a/plugins-scripts/utils.pm.in
+++ b/plugins-scripts/utils.pm.in
@@ -23,6 +23,7 @@ $PATH_TO_LMSTAT = "@PATH_TO_LMSTAT@" ;
23$PATH_TO_SMBCLIENT = "@PATH_TO_SMBCLIENT@" ; 23$PATH_TO_SMBCLIENT = "@PATH_TO_SMBCLIENT@" ;
24$PATH_TO_MAILQ = "@PATH_TO_MAILQ@"; 24$PATH_TO_MAILQ = "@PATH_TO_MAILQ@";
25$PATH_TO_QMAIL_QSTAT = "@PATH_TO_QMAIL_QSTAT@"; 25$PATH_TO_QMAIL_QSTAT = "@PATH_TO_QMAIL_QSTAT@";
26$PATH_TO_SNMPGET = "@PATH_TO_SNMPGET@";
26 27
27## common variables 28## common variables
28$TIMEOUT = 15; 29$TIMEOUT = 15;