10-19-2021 02:38 AM
Simple question:
I have a ZTP setup that is finally up and running.
When setup has completed I would like to receive an email or a file on my server.
This should provide some intelligence to the procedure.
TFTP option:
How can I create a file on the flash: that can be opened from the script and filled with device information?
I thought with :
def confirminstallation(): device_facts = get_facts() filename = "%s-%s.cfg" %(n,device_facts["Vlan990_ip"]) try: cli.executep("mkdir flash:ztp") finally: with open("/bootflash/ztp/%s" %(filename), "w+") as file: file.write("=====================================================") file.write("This is an Auto generated ZeroTouchInstallation file:") file.write("Date:" + n) file.write("=====================================================") file.write(str(device_facts)) file.close() return
Email option:
I can generate an email with some self-made JSON information in the body of the html email.
However, this only works when Guestshell has correct networking information.
Can this be done during the initial ZTP setup.
Any pushes in the right direction?
Thank you
Solved! Go to Solution.
12-20-2021 05:53 AM
Found a solution.
You can use the python script to write to a folder on the flash: this folder is called - shared-folder.
Or something else. But it does exist. Then I was able to 'code' copy from to tftp/http to upload the 'end' status of the device after provisioning it.
11-02-2021 08:45 AM
Hello @_|brt.drml|_,
Please refer to this document: Configuring Zero Touch Provisioning
Pay attention to these two sections: ZTP Bootscript, ZTP Utilities
Although this may not be exactly what you're looking for, it can point you in the right direction.
Best regards
12-20-2021 05:53 AM
Found a solution.
You can use the python script to write to a folder on the flash: this folder is called - shared-folder.
Or something else. But it does exist. Then I was able to 'code' copy from to tftp/http to upload the 'end' status of the device after provisioning it.
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