Is it necessary to have internet connectivity to install SDK because my LAB VM is not connected to internet.
Is this command need to be run in F5 VM itself, right (I'm not sure that's why asking)?
First, if you don't have previous experience, I recommend you to start with a graphical IDE (PyCharm in my case) and internet connection.
F5 SDK is composed by several modules and each of them have their own dependencies, so you would need to satisfy these requirements before having your enviroment ready to work.
If you access F5 Github repository you will see some of the modules provided by F5 SDK and their requirements.
You can check what your current installed modules are in your enviroment with this:
# python Python 2.6.6 (r266:84292, Aug 2 2019, 14:05:33) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> help("modules") Please wait a moment while I gather a list of all available modules... [...output omitted] >>> exit()
To install modules with internet:
To install modules without internet:
Thanks for sharing above documents and URLs. I had installed the f5-SDK however while accessing the device getting below error:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='ashi2.com', port=443): Max retries exceeded with url: /mgmt/tm/sys/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f078c5b66a0>: Failed to establish a new connection: [Errno -2] Name or service not known',))
This is surely related to self-signed SSL cert. Can you please help me how I can disable cert checking on the F5 ltm or any other way around you can suggest.
Can i do ssh to my box instead of accessing it via HTTPS:
No. This error comes from your 'requests' library and means that you cannot reach your device or resource.
Max retries exceeded with url: /mgmt/tm/sys/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f078c5b66a0>: Failed to establish a new connection: [Errno -2] Name or service not known',))
Insecure warnings looks like this:
InsecureRequestWarning: Unverified HTTPS request is being made to host '<BIG-IP Device>'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
But these warnings should be disabled by default.
So check your destination IP, user privileges and so on.
BTW, if these answers were helpful don't forget to mark the answer as 'the best' or give some upvotes.
I am able to ssh my F5 LTM from CentOS8 on which I had installed f5-sdk :
[root@localhost ~]# ssh email@example.com
[root@ASHI:Active:Disconnected] config #
Device hostname is ASHI.com
I have only one user on my f5 i.e. admin which is having Administrator provildges and advanced sheel access also.
If you can help me out what else needs to be checked on both CentOS and F5 LTM.
Please have a look at below error:
2020-04-12 13:30:11,960 - f5sdk.utils.http_utils - WARNING: SSL Insecure request, recommend adding a valid certificate to the device
this clearly show issue with SSL cer. Don't know how to suppress this cert error. Let me know if you have any suggestion to suppress this.
Below are the steps which I followed:
1. Executed this command on Centos8 pip install f5-sdk
Got message successfully installed.
2. Excuted Python3 command and tried executed below commands:
>>> import requests
>>> from f5.bigip import ManagementRoot -----------------> after executing this command getting error which I has shared.
>>> # Basic Authentication
>>> b = ManagementRoot('ltm3.test.local', 'admin', 'admin')
>>> # Token Authentication
>>> b = ManagementRoot('ltm3.test.local', 'admin', 'admin', token=True)
3. I am able to ssh my F5 LTM from CentOS ----> ssh firstname.lastname@example.org ----> successfully logged in into the LTM
4. when I execute print(requests.get('https://ashi.com')) getting error related to SSL cert.
5. I have one user for LTM i.e. admin/admin which is having Administrator priviledges and access to advanced shell also.
6. LTM is connected to internet also.
https://devcentral.f5.com/s/articles/getting-started-with-the-f5-common-python-sdk-27438 ----> followed this article and in this it is mentioned:
"I disable the certificate security warnings on my test boxes, but the first two lines in the sample code below are not necessary if you are using valid certificates"
Let me know if I am missing anythin here.
The mentioned command ("from f5.bigip import ManagementRoot") only loads the libraries, it doesn't send anyting to anywhere.
F5 SDK has several dependencies like for example 'f5-icontrol-rest-python', so my suspect is you need to satisfy these other dependencies before getting your box working properly.
Use 'pip search' to search for other f5 packets and try to download them all.
Check also with "help('modules')" to see what F5 modules you have installed...
Below are the requirements that are fullfilled:
## required production packages
## required dev packages
pylint==2.3.1 ; python_version > '3.0'
# unittest.mock built in to python 3.3+
mock==2.0.0 ; python_version < '3.3'
## required doc packages
sphinx==2.0.1 ; python_version > '3.0'
f5-sphinx-theme==2.0.5 ; python_version > '3.0'
## required build packages
twine==3.* ; python_version >= '3.0'
twine==1.* ; python_version <= '3.0'
root@ubuntu:~# pip3 search f5-sdk-python/
f5-sdk-python (0.9.2) - F5 SDK
INSTALLED: 0.9.2 (latest)
f5-sdk (3.0.21) - F5 Networks Python SDK
INSTALLED: 3.0.21 (latest)
f5 (0.0.4) - Use F5 to build more powerful Tornado apps
INSTALLED: 0.0.4 (latest)
f5-cli (0.9.2) - F5 CLI
INSTALLED: 0.9.2 (latest)
f5-teem (1.0.2) - F5 TEEM Library
INSTALLED: 1.0.2 (latest)
f5-sphinx-theme (2.0.5) - Sphinx theme for F5 Networks
INSTALLED: 2.0.5 (latest)
f5-openstack-agent (10.1.0) - F5 Networks Agent for OpenStack services
httpie-f5-auth (0.0.6) - F5 BIG-IQ Auth plugin for HTTPie.
INSTALLED: 0.0.6 (latest)
f5-icontrol-rest (1.3.13) - F5 BIG-IP iControl REST API client
INSTALLED: 1.3.13 (latest)
Still struggling how to get this thiing working.
Cloned f5-sdk from github and ran this requirement.txt to fullfill all the python related dependencies.
Attached is the file of Python modules
Trying searching for videos but no luck if you have any video source how to insatll f5-sdk that would be very helpful.