Go to file
2023-11-23 12:42:44 +03:00
.gitignore changed repo settings 2023-11-23 12:03:28 +03:00
cisco-port-failover.py added "nothing to do" log message 2023-11-23 12:42:44 +03:00
LICENSE Initial commit 2023-11-13 19:02:45 +03:00
README.md added cisco-port-failover.py 2023-11-23 12:04:03 +03:00

cisco-management

Wireguard management and monitoring utils.


cisco-port-failover.py

Description:

Cisco ports switching if the target is unreachable.

Dependencies:

PARAMETERS DESCRIPTION DEFAULT
[--host] cisco host address REQUIRED
[--port] cisco ssh port 22
[--user] cisco ssh username cisco
[--pass] cisco ssh password cisco
[--p_en] cisco enable mode password the same ssh password
[--check] ping target host None
[--iface] cisco target interface None
[--wait] delay in seconds between commands 0.05
[--log_root] path to log directory the same script path
[--log_level] DEBUG, INFO, WARNING, ERROR, CRITICAL INFO

Example usage with cron:

# install dependencies
sudo pip install paramiko
# download
sudo wget https://git.hmp.today/pavel.muhortov/cisco-management/raw/branch/master/cisco-port-failover.py -O /usr/local/bin/cisco-port-failover.py
sudo chmod +x /usr/local/bin/cisco-port-failover.py
# sudo crontab -e
*/2 * *  *  * /usr/bin/python3 /usr/local/bin/cisco-port-failover.py --host 10.0.0.1 --user USER --pass PASS --check 10.0.1.1 --check 10.0.1.2 --check 10.0.1.3 --iface Gi1/0/1 --iface Gi1/0/2 --log_root /var/log
# watching
tail -f /var/log/cisco-port-failover.log