cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5585
Views
30
Helpful
10
Replies

Automated backup of VCS, Expressway, Conductor, MCU, Telepresence Server, MSE, CMS, CMM configuration

This script in python saves config from devices and creates log file. You can create a batch file and schedule it.

Remove .txt extension. The file should be getconf.py

Tested on
VCS, VCS Expressway, Expressway-E, Expressway-C, TelePresence Conductor, MCU4205, MCU5320, MCU4515, MSE8510, Telepresence Server 8710, Supervisor MSE 8050, CMS, CMM 2.5.1

The CMM should be 2.5.1

The Login/Password of CMM should be with LOCAL authentication

The python version is 3.7.2

#####################################You should install additional components
#
# pip install requests
# pip install beautifulsoup4
# pip install paramiko
# python -m pip install --upgrade pip
# pip install cryptography==2.4.2
#
#
#
# This file saves config from Cisco CMS, Cisco CMM, Cisco VCS, Cisco Expressway,
# Cisco Conductor, Cisco MCU, Cisco MSE Supervisor, Cisco Telepresense Server
#
# The Command line should be
# python.exe getconf.py type host login password pathtosaveconf crypto
#
# The type should be: cms, cmm, vcs, mcu
# The last argument is crypto. This is optional argument for vcs,expressway,conductor and required argument for CMM
# By default 'path to log" is 'pathtosaveconf'
#
# Examples
# Save unencrypted config from vcs,expressway or conductor
# python.exe getconf.py vcs 1.1.1.1 admin mypass c:\11\saveconf\myexpw\
#
# Save encrypted config from vcs,expressway or conductor
# python.exe getconf.py vcs 1.1.1.1 admin mypass c:\11\saveconf\vcs\ Aa123
#
# Save encrypted config from CMM
# python.exe getconf.py cmm 2.2.2.2 admin mypass c:\11\saveconf\mycmm\ Aa123

# Save config from CMS
# python.exe getconf.py cms 3.3.3.3 admin mypass c:\11\saveconf\cms\
#
# Save config from MCU, MSE or TP Server
# python.exe getconf.py mcu 4.4.4.4 admin mypass c:\11\saveconf\mcu\
#

3 Accepted Solutions

Accepted Solutions

Could you please provide the fixed script?

I am fairly new to this and would like to try your script to automate backups on our expressway E and C servers.

 

Thanks in advance,

Balaji

View solution in original post

This script works well with Expressway Edge and Core servers. 

View solution in original post

Yuri A
Level 1
Level 1

Hi! Can you tell me how to use this script for CMM 3.2?

View solution in original post

10 Replies 10

Evgeni Fedotov
Cisco Employee
Cisco Employee

Hi Konstantin,

Be careful with running that script on a CMS server.

1. Your script does not check if the login has an expired password! Executing commands, in this case, might set new 'unwanted' password for login and in case if you have only one admin account on CMS you will completely lose CMS system because there is no password recovery procedure on CMS.  Please add that check to your script.

 

Good idea. Script Fixed.

Hello,

 

Would your script working with expressway 12.5.x?

 

I am asking because of backup encryption.

 

Following...

we also have 12.5

Yes, 12.5.7 works fine. Encryption password of config must be exist.

Example.

python.exe getconf.py vcs 1.1.1.1 admin mypass c:\11\saveconf\vcs\ Aa123

 

Hi, I am trying to run script "python getconf.py vcs x.x.x.x admin mypass /home/scripter/vict/" this error appears;

 

Authenticated. Get config...
This is Expressway
Traceback (most recent call last):
File "getconf.py", line 435, in <module>
savelog ((datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+" host:"+h+" "+VCS(h,l,p,pt,cry)+"\n"),ptl)
File "getconf.py", line 316, in VCS
with open(pt+filename, 'wb') as local_file:
TypeError: must be str, not NoneType

 

Can you tell me what is the error?

 

 

Could you please provide the fixed script?

I am fairly new to this and would like to try your script to automate backups on our expressway E and C servers.

 

Thanks in advance,

Balaji

Hi,


the script allow you to select type equipment, I´ve been resolved the issue as follows;

I´ve create a script .sh(vcs_and_cms_sh) into with the script getconf.py;

 

script@ubuntu]$ cat vcs_and_cms_sh
/opt/rh/rh-python36/root/usr/bin/python3 /home/victor/getconf.py vcs 192.168.x.x user password /home/victor/backup_vcs/backup_EXPW/ Aa123
/opt/rh/rh-python36/root/usr/bin/python3 /home/victor/getconf.py cms 192.168.x.x user password /home/victor/backup_vcs/backup_CMS/ Aa123

 

it I´ve automated with crontab so that everyday can be executed

 

script@ubuntu]$ crontab -l

0 4 * * * /home/victor/vcs_and_cms_sh

 

Regards!

This script works well with Expressway Edge and Core servers. 

Yuri A
Level 1
Level 1

Hi! Can you tell me how to use this script for CMM 3.2?