Created
June 7, 2020 15:17
-
-
Save matsubo/f77b80162ec4ee9f5c07a711c974d78c to your computer and use it in GitHub Desktop.
Get current stat via telnet on RTX830
This file contains 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 | |
HOST=$1 | |
COMMAND="show arp" | |
$(dirname $0)/rtx_command.sh $HOST "${COMMAND}" | grep "Count" | awk '{print $2}' |
This file contains 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 | |
HOST=$1 | |
COMMAND="show arp" | |
$(dirname $0)/rtx_command.sh $HOST "${COMMAND}"| grep "Count" | awk '{print $2}' |
This file contains 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 | |
HOST=$1 | |
COMMAND="show nat descriptor masquerade session summary" | |
$(dirname $0)/rtx_command.sh $HOST "${COMMAND}" | grep 'PP' | awk '{ print $4}' | awk -F '/' '{print $1}' | |
This file contains 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
#!/usr/bin/expect | |
# ./rtx_command.sh <host> <command> | |
# replace `YOURPASSWORD` | |
spawn telnet [lindex $argv 0] | |
expect "Password:" | |
send "YOURPASSWORD\r" | |
expect ">" | |
send "[lindex $argv 1]\r" | |
expect ">" | |
send "exit\r" | |
close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment