Forum Discussion
tmsh command to read external data group file
I need help with tmsh commands to read external data group file . Due to security issues, we cannot give the user access to shell . The user uses a discovery tool to discover F5 and properties and tries to read the external data group file, so that it can map the applications to right IPs based on the contents of the file. The user has "guest with tmsh" role on F5.
F5 Version - BIG-IP 11.6.0 Build 6.0.442 Hotfix HF6
Any help or hint is appreciated . Thanks
- kunjanNimbostratus
tmsh list ltm data-group external
- Navd_298927Nimbostratus
thanks Kunjan,
That only lists the data groups. But we are trying read the contents of the data group. We can do it by shell command like 'cat file.txt' , but that would require us to give the user shell access to F5 server. So, we're trying to get an alternate way using tmsh command.
- kunjan_118660Cumulonimbus
tmsh list ltm data-group external
- Navd_298927Nimbostratus
thanks Kunjan,
That only lists the data groups. But we are trying read the contents of the data group. We can do it by shell command like 'cat file.txt' , but that would require us to give the user shell access to F5 server. So, we're trying to get an alternate way using tmsh command.
- kunjan_118660Cumulonimbus
May be can write a script and call it from tmsh, if you know the full path to the data-group.
cli script test { proc script::run {} { set fp [open "/config/filestore/files_d/Common_d/data_group_d/:Common:dg1_46552_3" r] while { [gets $fp data] >= 0 } { puts $data } } } (/Common)(tmos) run cli script test
- brad_11480Nimbostratus
oh gosh, this is terrible. this means you have to know where it is storing these files. it would be far better if the tmsh command provided a way for it to list the content like it will for the GUI.. if it does it for the GUI, it should provide the same via TMSH.
- kunjanNimbostratus
May be can write a script and call it from tmsh, if you know the full path to the data-group.
cli script test { proc script::run {} { set fp [open "/config/filestore/files_d/Common_d/data_group_d/:Common:dg1_46552_3" r] while { [gets $fp data] >= 0 } { puts $data } } } (/Common)(tmos) run cli script test
- brad_11480Nimbostratus
oh gosh, this is terrible. this means you have to know where it is storing these files. it would be far better if the tmsh command provided a way for it to list the content like it will for the GUI.. if it does it for the GUI, it should provide the same via TMSH.
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