03-05-2019 11:28 PM - edited 03-10-2019 03:38 PM
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\
#
Solved! Go to Solution.
09-09-2020 11:09 AM - edited 03-10-2021 06:21 AM
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
09-16-2020 04:20 AM - edited 03-10-2021 06:20 AM
This script works well with Expressway Edge and Core servers.
07-23-2021 01:04 AM
Hi! Can you tell me how to use this script for CMM 3.2?
03-06-2019 02:28 AM - edited 03-06-2019 02:38 AM
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.
03-07-2019 01:01 AM
05-12-2020 09:41 AM
Hello,
Would your script working with expressway 12.5.x?
I am asking because of backup encryption.
05-13-2020 06:23 AM
Following...
we also have 12.5
05-13-2020 09:41 AM
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
07-23-2020 03:02 PM
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?
09-09-2020 11:09 AM - edited 03-10-2021 06:21 AM
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
09-10-2020 05:59 AM
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!
09-16-2020 04:20 AM - edited 03-10-2021 06:20 AM
This script works well with Expressway Edge and Core servers.
07-23-2021 01:04 AM
Hi! Can you tell me how to use this script for CMM 3.2?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide