Forum Discussion

Roberto_GB_2613's avatar
Roberto_GB_2613
Icon for Altostratus rankAltostratus
May 10, 2017

list data-group using tmsh script

Hi all, I'm developing some scripts in order to make easier certain operation with data-groups. I figured out how to add, modify and delete elements this way but when it comes to show the data-group... No way. I duplicated the same command but with different syntax to see if something worked:

cli script VPN_users_SHOW {
proc script::run {} {
    set cmd "tmsh::list /ltm data-group internal auth_users_access"
    tmsh::log "Executing the command: $cmd"
    eval $cmd
    list ltm data-group internal auth_users_access
    }
}

To run the script I simply execute it: "run cli script VPN_tmp_user_access_SHOW"

I expected to list the data-group but it does not show any data. Any suggestion of what is missing?

1 Reply

  • Hello,

    This is a tcl, so, to print you can do this way:
    proc script::run {} {
        set li [tmsh::list ltm data-group internal auth_users_access]
        puts $li
    }
    

    Regards