Export GTM/DNS Configuration in CSV - tmsh cli script
Thank you for the reply. Im getting similar error after making the edits
root@(rggslbintl01cdc)(cfg-sync Standalone)(/S1-green-P::Active)(/Common)(tmos)# run cli script gtm-config-parser > /var/tmp/gtm-config-parser-output.csv
WIP,LB-MODE,WIP-STATUS,WIP-STATE,POOL-NAME,POOL-LB,POOL-MEMBERS,POOL-FB,LASTRESORT-POOL
gtm-config-parser: script failed to complete:
can't eval proc: "script::run"
"aais-dev-dev-scp-pool" unexpected argument
while executing
"tmsh::get_config /gtm pool $pool_name all-properties"
(procedure "script::run" line 10)
invoked from within
"script::run" line:1
script did not successfully complete, status:1
==============================Modified Script==============================
cli script gtm-config-parser {
proc script::run {} {
puts "WIP,LB-MODE,WIP-STATUS,WIP-STATE,POOL-NAME,POOL-LB,POOL-MEMBERS,POOL-FB,LASTRESORT-POOL"
foreach { obj } [tmsh::get_config gtm wideip all-properties] {
set wipname [tmsh::get_name $obj]
set wippools [tmsh::get_field_value $obj pools]
set lbmode [tmsh::get_field_value $obj "pool-lb-mode"]
set lastresort [tmsh::get_field_value $obj "last-resort-pool"]
foreach wippool $wippools {
set pool_name [tmsh::get_name $wippool]
set pool_configs [tmsh::get_config /gtm pool $pool_name all-properties]
foreach pool_config $pool_configs {
set pool_lb [tmsh::get_field_value $pool_config "load-balancing-mode"]
set pool_fb [tmsh::get_field_value $pool_config "fallback-mode"]
if { [catch { set member_name [tmsh::get_field_value $pool_config "members" ]} err] } {
set pool_member $err
} else {
set pool_member ""
set member_name [tmsh::get_field_value $pool_config "members"]
foreach member $member_name {
append pool_member "[lindex $member 1] "
}
}
puts "$wipname,$lbmode,$pool_name,$pool_lb,$pool_member,$pool_fb,$lastresort"
}
}
}
}
total-signing-status not-all-signed
}
root@(rggslbintl01cdc)(cfg-sync Standalone)(/S1-green-P::Active)(/Common)(tmos)# show sys ver
Sys::Version
Main Package
Product BIG-IP
Version 13.1.3.1
Build 0.27.4