Forum Discussion
SMB monitor on 11.4
Wanted to post some info as i've been working on this for the past few weeks with F5. It appears they have added the SMB tools back into 11.4 and i was able to get the external monitor working that Aaron provided here https://devcentral.f5.com/wiki/AdvD...-CIFS.ashx
I did have to make a couple modifications to the script as well as its placement for it to work. I am currently going thru my config and documenting the changes. Once i have those i'll post them.
6 Replies
- marco_octavian_
Nimbostratus
Keep us informed. This is definitely useful. - Ariel_Santa_Cr1Historic F5 AccountHi Birddog, I need to make this script to work in 11.4. I would like to learn from experience to avoid hitting the same issues. Could you post the script you are using? Thanks!
- Ariel_Santa_Cr1Historic F5 Account
Well, I made both, the internal monitor and the script provided by Aaron, work in my lab.
To make the internal monitor to work you need to create the /var/run/monitors directory, apparently the destination of the file is hardcoded to that dir and in version 11.4 is no longer available, so you have to do it manually.
The script provided by Aaron (Windows File Share Monitor SMB CIFS) worked just fine, the difference in 11.4 is that you have to upload the file instead of placing it in a specific directory. To upload the script in the GUI you need to go to System --> File Management --> External Monitor Program File List
Once uploaded you can modify the content in the GUI.
When creating the External Monitor you can reference to the previously uploaded Program File.
good luck!
- Birddog_17215
Nimbostratus
Apologize for the delayed response but here is the script. I used Aaron's script as ARO did above and modified it to add the use of the AD domain with a service account specifically set to this monitor. This allows me to test AAA as well as reading a string inside a file to test all the way to shared storage.
I did have to create an smb directory and conf file to fix a problem i was having with access denied messages in 11.4. Not sure if its fixed in later versions: mkdir /root/.smb/ touch /root/.smb/smb.conf
when i created the external monitor i used the following variables:
default settings and tweaked interval
monitor script uploaded thru File Managementdefaults-from external destination *:* interval 10 time-until-up 0 timeout 31
turn debug off '0' or on '1'run /Common/smb-monitor
example file thru Samba to SAN storageuser-defined DEBUG 0
password of AD service accountuser-defined FILE /share/smb.hc
string inside smb.hc file that monitor looks for (in this case the word 'working')user-defined PASSWORD mypassword
username of AD service accountuser-defined SEARCH_STRING working
Domain name of AD domainuser-defined USERNAME jdoe
Below is the domain portion i added into Aaron's script: Check if a variable named WORKGROUP exists from the monitor definition This can be set using a monitor variable WORKGROUP=MYDOMAINuser-defined WORKGROUP MYDOMAINif [ -n "$WORKGROUP" ] then if [ $DEBUG -eq 1 ]; then logger -p local0.debug "EAV
(PID $$): Workgroup: $WORKGROUP"; fi Set the password flag WORKGROUP="-w $WORKGROUP" else if [ $DEBUG -eq 1 ]; then logger -p local0.debug "EAVbasename $0
(PID $$): No workgroup specified"; fi WORKGROUP='' fi Send the request and check the response. If we have a string to search for, use grep to look for it. Check if a variable named SEARCH_STRING exists from the monitor definition This can be set using a monitor variable SEARCH_STRING=my_stringbasename $0if [ -n "$SEARCH_STRING" ] then SUCCESS_STATUS=0 if [ $DEBUG -eq 1 ]; then logger -p local0.debug "EAV
(PID $$): Checking ${IP}${FILE} for "$SEARCH_STRING" with status of $SUCCESS_STATUS using\ smbget $USERNAME $PASSWORD $WORKGROUP $GUEST_FLAG --nonprompt --quiet --stdout smb://${IP}${FILE} | grep \"$SEARCH_STRING\" "; fi smbget $USERNAME $PASSWORD $WORKGROUP $GUEST_FLAG --nonprompt --quiet --stdout smb://${IP}${FILE} | grep $SEARCH_STRING 2>&1 > /dev/null else SUCCESS_STATUS=1 if [ $DEBUG -eq 1 ]; then logger -p local0.debug "EAVbasename $0
(PID $$): Checking ${IP}${FILE} with status of $SUCCESS_STATUS using\ smbget $USERNAME $PASSWORD $WORKGROUP $GUEST_FLAG --nonprompt --quiet --stdout smb://${IP}${FILE} "; fi smbget $USERNAME $PASSWORD $WORKGROUP $GUEST_FLAG --nonprompt --quiet --stdout smb://${IP}${FILE} fibasename $0- Birddog_17215
Nimbostratus
I also have this working in 11.5.1 as well
- ejknight_293275
Nimbostratus
does this work in 13.1.0.4? I am looking to monitor for the existence of a single file on a server and if its not there then take it out of the rotation and mark it down.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com