summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-08-20 14:50:52 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-08-20 14:50:52 (GMT)
commit4eab02cdaf01e1c44707586e3781a09c44b6aabe (patch)
tree127fafe7ecb170d8942bac63bb461c597d1058ce
parentf9ae9294d63a757a636da1df90adfef1e0543872 (diff)
parentfebe7b707524c0bb84271599e94d4effd3c23053 (diff)
downloadmonitoring-plugins-4eab02cdaf01e1c44707586e3781a09c44b6aabe.tar.gz
Merge branch 'master' of https://github.com/rafaeldriutti/nagios-plugins
* 'master' of https://github.com/rafaeldriutti/nagios-plugins: Changed the smbclient command used to fetch the free space available on the samba shares. Using du instead of ls, since it's much faster, specially with shares that have a lot of files. Closes #63.
-rwxr-xr-xplugins-scripts/check_disk_smb.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 43841c3..b547615 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -176,7 +176,7 @@ $SIG{'ALRM'} = sub {
176}; 176};
177alarm($TIMEOUT); 177alarm($TIMEOUT);
178 178
179# Execute an "ls" on the share using smbclient program 179# Execute a "du" on the share using smbclient program
180# get the results into $res 180# get the results into $res
181my @cmd = ( 181my @cmd = (
182 $smbclient, 182 $smbclient,
@@ -185,7 +185,7 @@ my @cmd = (
185 defined($workgroup) ? ("-W", $workgroup) : (), 185 defined($workgroup) ? ("-W", $workgroup) : (),
186 defined($address) ? ("-I", $address) : (), 186 defined($address) ? ("-I", $address) : (),
187 defined($opt_P) ? ("-p", $opt_P) : (), 187 defined($opt_P) ? ("-p", $opt_P) : (),
188 "-c", "ls" 188 "-c", "du"
189); 189);
190 190
191print join(" ", @cmd) . "\n" if ($verbose); 191print join(" ", @cmd) . "\n" if ($verbose);
@@ -198,7 +198,7 @@ alarm(0);
198@lines = split /\n/, $res; 198@lines = split /\n/, $res;
199 199
200#Get the last line into $_ 200#Get the last line into $_
201$_ = $lines[$#lines]; 201$_ = $lines[$#lines-1];
202#print "$_\n"; 202#print "$_\n";
203 203
204#Process the last line to get free space. 204#Process the last line to get free space.