Shadowdirectory IS NATIVELY AVAILABLE in PI 3.1.3 (look for Background Task 'Device Config Backup-External')
Sometimes functionality that is missing from the GUI still is available through the API as a workaround. A good example is the Shadow Directory, which was available in Cisco Prime LMS and is not yet available in Prime Infrastructure. However still through the API configurations can get pulled and stored in a directory to mimic this. This functionality is often requested by customers hence I putted together this short example.
Zip File contains 2 folders 'prime' & 'clitools'. The folder 'prime' contains the files 'PrimeBasicTools', 'PrimeShadowDirectory' and 'UserTrackingUtility'. In 'clitools' you will find 'PrimeShadowDirectoryRunner' and 'UserTrackingUtilityRunner'.
Disclaimer: Use at your own risk / no support offered
Thank you very much for such important topic.
But can you please share step by step guide to upload those codes on the prime infrastructure, as I am not familiar with python programming.
Thanks in advance.
actually it is not meant to run this directly on PI. Basically you can run this on any PC/Workstation/Server you like. You would only need to have IP connectivity from this station to PI and install Python 3 on it. After that, you can then execute those commands above manually or also schedule a cron job to do it regularly to back up your configs.
Hope that helps, if anything unclear, just let me know.
first, I would like to thank you for your work. It has elimented a real problem for me in recent years.
Since yesterday I did an inline update to Prime Infrastructure 3.5 and unfortunatly your tool is not working anymore.
Maybe you can help me:
C:\Tools>"C:\Program Files\Python\Python37\python.exe" "C:\Program Files\Python\clitools\PrimeShadowDirectoryRunner.py" -d D:\ConfigBackup\PrimeConfigExport -u <user> -p <password> <servername>
ERROR:root:Error: <class 'UnicodeEncodeError'> Details: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined> StackTrace: Traceback (most recent call last):
File "C:\Program Files\Python\clitools\prime\PrimeShadowDirectory.py", line 247, in writeLatestConfigOfAllDevices
File "C:\Program Files\Python\Python37\lib\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>
...something went wrong!
with kind regards,
unfortunately it seems that the API now returns the data not in 'string' format but in a different one, which leads to problems when writing it into a file.
Example from my PI3.5
I have to check if I can get this solved. In the meantime I would recommend to use the build in function under Administration > Job Dashboard > System Jobs > Infrastructure > Device Config Backup-External
Click the checkmark on the left side of the Job, and select the Pencil at the top, that allows you to configure the Destination and schedule.