Created
April 12, 2011 07:25
-
-
Save dynax60/915105 to your computer and use it in GitHub Desktop.
Configuration backup from ES3528
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/sh | |
# ES3528 | |
TFTP_SERVER=${TFTP_SERVER:-"10.X.X.X"} | |
RW_COMMUNITY=${RW_COMMUNITY:-"private"} | |
PATH=/bin:/usr/bin:/usr/local/bin | |
[ -s $1 ] || { echo "No such file or file is empty: $1" >&2; exit 1; } | |
for h in `cat $1` | |
do | |
echo -n "$h " | |
filename="backup/${h}.cfg" | |
snmpset -v2c -c $RW_COMMUNITY $h \ | |
1.3.6.1.4.1.259.6.10.94.1.24.1.1.0 i 2 \ | |
1.3.6.1.4.1.259.6.10.94.1.24.1.3.0 i 4 \ | |
1.3.6.1.4.1.259.6.10.94.1.24.1.4.0 s $filename \ | |
1.3.6.1.4.1.259.6.10.94.1.24.1.6.0 a $TFTP_SERVER \ | |
1.3.6.1.4.1.259.6.10.94.1.24.1.8.0 i 2 >/dev/null 2>&1 | |
if [ $? -eq 0 ]; then echo "OK"; else echo "FAIL"; fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment