Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
cenovusjim
Thanks for the great script. Made the following updates to deal with files in subdirectories:
$ diff check_smb_file check_smb_file-orig
18c18
$PROGNAME -H -W -s -f -u -p -S -E
57,59d56
";;
82c79
onErrorMessage="ERROR: File \"//"$host""$sharePathToTest"$fileToTest\" does not exists."
89c86
smbclient //"$host""$sharePathToTest" -U "$user"%"$password" -W "$workgroup" -c "get '$fileToTest' /tmp/"$fileToTest""
92c89
rm -f /tmp/"$fileToTest"
$ diff check_smb_file check_smb_file-orig
18c18
$PROGNAME -H -W -s -f -u -p -S -E
57,59d56
";;
82c79
onErrorMessage="ERROR: File \"//"$host""$sharePathToTest"$fileToTest\" does not exists."
89c86
smbclient //"$host""$sharePathToTest" -U "$user"%"$password" -W "$workgroup" -c "get '$fileToTest' /tmp/"$fileToTest""
92c89
rm -f /tmp/"$fileToTest"
bycenovusjim, October 19, 2015
Love the script! Had and issues with accessing files in subdirectories so made the following changes to the script:
1. sub-directories in the share
2. added full path to commands used
$ diff check_smb_file check_smb_file-orig
18c18
$PROGNAME -H -W -s -f -u -p -S -E
57,59d56
";;
82c79
onErrorMessage="ERROR: File \"//"$host""$sharePathToTest"$fileToTest\" does not exists."
89c86
smbclient //"$host""$sharePathToTest" -U "$user"%"$password" -W "$workgroup" -c "get '$fileToTest' /tmp/"$fileToTest""
92c89
rm -f /tmp/"$fileToTest"
1. sub-directories in the share
2. added full path to commands used
$ diff check_smb_file check_smb_file-orig
18c18
$PROGNAME -H -W -s -f -u -p -S -E
57,59d56
";;
82c79
onErrorMessage="ERROR: File \"//"$host""$sharePathToTest"$fileToTest\" does not exists."
89c86
smbclient //"$host""$sharePathToTest" -U "$user"%"$password" -W "$workgroup" -c "get '$fileToTest' /tmp/"$fileToTest""
92c89
rm -f /tmp/"$fileToTest"