For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Jeff_41411's avatar
Jeff_41411
Icon for Altocumulus rankAltocumulus
Aug 15, 2016

Call TMSH script with a curl command?

I am trying to allow some users access to a simple TMSH script on our GTM's. I've looked through various documents and I can't find exactly what I need. Has anyone done this, and if so can you provide an example? Or point me to the right documentation. I would need to call the script, and pass it 2 or 3 parameters.

 

Thanks in advance. Jeff

 

5 Replies

  • It's a custom TMSH script that I would like to execute. I'm really looking for the general procedure to call any script in that manner.

     

    Thanks, Jeff

     

  • You can't, but there's a good chance the commands can be executed via REST calls. That's why I was curious what command(s) you were wanting to run, I could potentially offer up the REST call.

     

  • I'm open to any suggestions on how this could be done. The developers asked about using curl, but they would be open to other alternatives. Can you demonstrate what that might look like using a REST call?

     

    Thanks

     

  • R_Marc's avatar
    R_Marc
    Icon for Nimbostratus rankNimbostratus

    I think you need a 11.6 or better, but here's an example:

    curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://localhost/mgmt/tm/util/bash -d "{\"command\":\"run\",\"utilCmdArgs\":\"-c 'tmsh list sys crypto csr test.csr'\"}" | python -m json.tool