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

Network map to excel

Anju
Altostratus
Altostratus

Hi Folks,

 

How can we get network map info - VIPs, Pool, nodes etc. in a spreadsheet? I need to make a spreadsheet for complete configuration of the device, any quicker way to do it?

7 REPLIES 7

Daniel_Wolf
Nacreous
Nacreous

Hi Anju,

 

I think  has you covered - Export Virtual Server Configuration in CSV - tmsh cli script

 

KR

Daniel

Hi Daniel,

 

Thank you for your response. I did run the script, but it dint work out for me. Please take a look at the below output i got.-

 

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ # tmsh list cli script virtual-details

01020036:3: The requested shell script (/Common/virtual-details) was not found.

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ # cli script virtual-details {

bash: cli: command not found

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ # proc script::run {} {

bash: proc: command not found

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #  puts "Virtual Server,Destination,Pool-Name,Profiles,Rules"

bash: puts: command not found

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #  foreach { obj } [tmsh::get_config ltm virtual all-properties] {

bash: foreach: command not found

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #    set profiles [tmsh::get_field_value $obj "profiles"]

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #    set remprof [regsub -all {\n} [regsub -all " context" [join $profiles "\n"] "context"] " "]

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #    set profilelist [regsub -all "profiles " $remprof ""]

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #    puts "[tmsh::get_name $obj],[tmsh::get_field_value $obj "destination"],[tmsh::get_field_value $obj "pool"],$profilelist,[tmsh::get_field_value $obj "rules"]"

bash: puts: command not found

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #  }

bash: syntax error near unexpected token `}'

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ # }

bash: syntax error near unexpected token `}'

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #  total-signing-status not-all-signed

bash: total-signing-status: command not found

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ # }

bash: syntax error near unexpected token `}'

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #

[XXX@UNIT-01:Peer Time Out of Sync:Changes Pending] ~ #

 

Looking for an output from a particular partition in bash. Not sure, how can I achieve this. Let me know if you can help on this. Thanks.

Tried the one in the article - https://support.f5.com/csp/article/K44010967, its giving below output (used 'grep' instead of 'awk' since grep is only supported on these units) its giving the blank csv file. extracted from winscp, nothing was found.

 

Daniel_Wolf
Nacreous
Nacreous

Hi Anju,

 

I think you missed part of the instructions. First you run

tmsh create cli script virtual-details

in order to create the script. Then you paste from line 52 to the end of the code snippet.

Next you run

tmsh list cli script virtual-details

to verify the script was created successfully.

And then you run.

tmsh run cli script virtual-details > /var/tmp/virtual-details.csv

This will write the results to the CSV.

 

As for your question regarding K44010967... as far as my memory reaches back, 'grep' and 'awk' are always available. I cannot recall a BIG-IP version that would not have 'awk' in bash. Also you cannot replace them with the another. The 'grep' command searches for lines matching a regex pattern while 'awk' is for string, arithmetic, and time manipulation.

Hi Daniel,

 

Tried the script as suggested, its giving the error - command not found. The below was found when tried on common partition -

01020036:3: The requested shell script (/Common/virtual-details) was not found.

when tried in bash, found the below error-

bash: cli: command not found

virtual-details: script failed to complete:

script "virtual-details" does not contain a "script::run" procedure

script did not successfully complete, status:1

 

Need to know what am i doing wrong here?

Apologies, maybe I was not 100% clear. With this snippet you create the script.

 

tmsh create cli script virtual-details

 

Next switch to tmsh and run:

 

root@(awaf)(cfg-sync Standalone)(Active)(/Common)(tmos)# edit cli script virtual-details

 

Here is a screenshot:

0691T00000BVBkfQAH.pngNow a vi-style editor will open you must paste from line 52 to line 88 the end of the code snippet. Verify that copy&paste worked. In my test, the proc from line 52 was not pasted, I had to type it manually.

Also exit this editor in vi-style with :wq. You will additionally be prompted whether you want to save the script.

Now run this command to verify your changes were saved.

 

tmsh list cli script virtual-details

 

If everything looks good, run the script. Here is a screenshot from a successful run:

0691T00000BVBldQAH.png 

 

One more thing... this is how the script editor looks in my environment after I pasted the script. I tested on 15.1.2.

0691T00000BVBs0QAH.png