Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

BGP Neighbor API


Hi guys,

Is there any way that I can retrieve output of this command "imish -e "show ip bgp neighbors" via API? Or if not, do you know how I can parse the output of this command from netmiko to something (for example: dictionary) that can be processed further? Thanks


Is it possible for a imish call, not tmsh call?

If it is in Linux (using imish but not entering it, like in linux when you run tmsh list /sys .. for example ) I don't see why not and testing will give you answer you seek.

Thanks a lot. I tried with Postman but it returned 400 error with message ""\"bash\" unexpected argument",". Is there anything I can do to pass this error?

Other than that you can use the Ansible module "bigip_command" to do something like:


  - name: BGP show


       commands: run util bash -c " xxxxx"

       provider "{{ provider }}"

    delegate_to: localhost



If you see issues add the commands in a bash script on the F5 and then trigger the script.

Not having right a F5 with a licensed routing module, so I am interested in your tests and if it worked 😀

Here is a working example:


curl -sku admin:xxxx https://xxxx/mgmt/tm/util/bash -X POST -H "Content-Type: application/json" -d "{\"command\":\"run\", \"utilCmdArgs\":\"-c 'ls -alt /var/log'\"}"


but better trigger a bash script file


curl -sku admin:xxxx https://xxxx/mgmt/tm/util/bash -X POST -H "Content-Type: application/json" -d "{\"command\":\"run\", \"utilCmdArgs\":\"-c 'bash /shared/'\"}"


Also as I mentioned Ansible can be added with its commands module :