23-Mar-2023 03:58
Good morning,
I've got a usecase that I don't know how to implement it.
We would like to upload each day some CRL Files from a windows samba share to our bigip and make them available with an Ifiles. Like that we have got a virtual server which is able to send the CRL files to client with a HTTP::respond 200 content [ifile get ]
I first think doing a ssh script to the bigip, to mount a samba share on the bigip, copy the files locally into /tmp and then execute the various command ( modify /sys file ifile .... ) to update the ifile files from the /tmp
But has someone has a better solution for doing this ?
Call RestAPI to upload files and update the ifiles ?
Thanks in advance,
Adrien
Solved! Go to Solution.
04-Apr-2023 16:08 - edited 04-Apr-2023 16:09
I wouldn't recommend having the BIG-IP be the controlling agent here, but if you want to do that, the smbclient executable is on the host and can be used with a bash script like:
#!/bin/bash
SMBSRV="smbserver"
SMBSHARE="share_name"
SMBUSER="username"
SMBPASS="password"
FNAME="CRLupdates"
smbclient //$SMBSRV/$SMBSHARE -U $SMBUSER%$SMBPASS -c "get $FNAME"
if [ $? -eq 0 ]; then
echo "$FNAME retrieved"
else
echo "$FNAME not retrieved"
fi
You could then have an iCall script with a periodic handler at whatever interval you wish execute the bash script, then create an iFile from its contents.
Personally, I'd move all the control off the BIG-IP and have an externally managed process (could also be a simple script, but documented in an operational procedure) check the share for updates to that file and upload them to BIG-IP and then modify the iFile as needed.
27-Mar-2023 16:32
Hi @Adrien_Dopchie - I see nobody has answered yet, so I'm going to feature your question in today's Community Highlights article to boost visibility and try to get a better reply for you.
04-Apr-2023 16:08 - edited 04-Apr-2023 16:09
I wouldn't recommend having the BIG-IP be the controlling agent here, but if you want to do that, the smbclient executable is on the host and can be used with a bash script like:
#!/bin/bash
SMBSRV="smbserver"
SMBSHARE="share_name"
SMBUSER="username"
SMBPASS="password"
FNAME="CRLupdates"
smbclient //$SMBSRV/$SMBSHARE -U $SMBUSER%$SMBPASS -c "get $FNAME"
if [ $? -eq 0 ]; then
echo "$FNAME retrieved"
else
echo "$FNAME not retrieved"
fi
You could then have an iCall script with a periodic handler at whatever interval you wish execute the bash script, then create an iFile from its contents.
Personally, I'd move all the control off the BIG-IP and have an externally managed process (could also be a simple script, but documented in an operational procedure) check the share for updates to that file and upload them to BIG-IP and then modify the iFile as needed.
17-Apr-2023 00:16
Thanks for the answer.
Automatize it trough ansible will be the better solution 😉
17-Apr-2023 12:36
yes, ansible is far more robust a solution than standalone scripts.