Created
August 7, 2019 05:10
-
-
Save crazyboycjr/02a05f941445ee13343b353108ececea to your computer and use it in GitHub Desktop.
demonstrate how to execute on mellanox os remotely
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -r -d '' data << EOF | |
{ | |
"execution_type": "sync", | |
"commands": [ | |
"show lldp remote", | |
"show running-config" | |
] | |
} | |
EOF | |
echo "$data" | |
# get login session | |
curl -X POST -c /tmp/cookie -d 'f_user_id=xmladmin&f_password=xmladmin' 'http://mellanox.maas/admin/launch?script=rh&template=login&action=login' 2>&1 >/dev/null | |
# post real request | |
curl -X POST -b /tmp/cookie -d "$data" 'http://mellanox.maas/admin/launch?script=json' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment