Network Management

 View Only
  • 1.  Custom Script after Backup

    Posted Sep 10, 2020 08:31 AM

    I want to run a custom script/application after a successfull backup of a configfile. Is it possible?

    I need to get the checksum from the configfilebackup. So I want to run after each backup a script that calculates the checksum from the recieved file. 



  • 2.  RE: Custom Script after Backup

    Posted Sep 10, 2020 09:29 AM

    Hello,

    I'd say it's possible, but probably easier to achieve within your custom script/application itself.

    iMC has the Service > Intelligent Policy Center, which allows you to configure automated Actions, triggered based on either Events (eg. a specific Alarm being triggered by a Syslog/Trap/Polling) or on a scheduled basis. There's no alarm for "configuration backed up", but I suppose you could instead configure Syslog on your devices pointing to iMC, then configure the Syslog Message which indicates that the configuration was successfully transferred to iMC's IP address to trigger an Alarm, and then configure the Policy Center to run an Action based on that Alarm (Event) when it is received. Intelligent Policy Center could then be configured to run a command on the server (or a restful action, or a jython script, etc..) which runs your custom script/application that calculates the checksum.

    That's a fairly lengthy process, and while it should be achievable in iMC, if I was writing a custom script/application, I'd simply code it (or a separate script) to run on a schedule. It would run shortly after the Auto Backup Plan in iMC finishes backing up the configurations on a regular basis, look into the directory where the actual configuration files are saved by iMC (iMC\server\data\cfgbak by default), and then do the checksum calculation on any new files as needed.

    Keep in mind iMC will only save a new startup/running configuration file from a device if the configuration has changed since the last backup. This is done to prevent the disk space from filling up, particularly on large installations with thousands of devices being backed up daily.