diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-20 16:50:52 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-20 16:50:52 +0200 |
commit | 4eab02cdaf01e1c44707586e3781a09c44b6aabe (patch) | |
tree | 127fafe7ecb170d8942bac63bb461c597d1058ce | |
parent | f9ae9294d63a757a636da1df90adfef1e0543872 (diff) | |
parent | febe7b707524c0bb84271599e94d4effd3c23053 (diff) | |
download | monitoring-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-x | plugins-scripts/check_disk_smb.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 43841c36..b547615b 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -176,7 +176,7 @@ $SIG{'ALRM'} = sub { | |||
176 | }; | 176 | }; |
177 | alarm($TIMEOUT); | 177 | alarm($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 |
181 | my @cmd = ( | 181 | my @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 | ||
191 | print join(" ", @cmd) . "\n" if ($verbose); | 191 | print 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. |