Forum Discussion

Kuldip_Mitra's avatar
7 years ago

Generating daily report for Config Diff of Network devices

Hi LM Support team,

We want to generate daily report for the diff config of the Network devices. Currently through standard report we are not able to generate the reports..

 

Regards

Kuldip

 

  • I solved this with the REST API -- I have a script that pulls all the config instances, then commits them into a git repo (one per device group in my case).  I use GitLab with an email push trigger, so I get reports on updates more or less as they occur, but obviously that could be handled other ways.  I find this beneficial for many reasons, including:

    * keep a separate copy out of LM so some errant action in LM does not destroy config data and history
    * enable searching for configuration elements across multiple files (impossible within the UI)
    * build tools to validate configs against baseline templates or other sorts of analysis
    * generate way better diff results (the current UI diff viewer REALLY needs a rewrite)
    * I get to find out all the times LMConfig flakes out, like when it zeroes out config instances if NVRAM is temporarily unavailable

    I would like to post those here, but you can't post text files it seems.  Will see if I can get those into github....

  • Hi Mnagel,

    Thanks for the reply. Can you please share us the script/GIT Repo URL to pull the config instances so that I can implement in my environment and check it.

     

    Regards

    Kuldip

     

  • I solved this with the REST API -- I have a script that pulls all the config instances, then commits them into a git repo (one per device group in my case).  I use GitLab with an email push trigger, so I get reports on updates more or less as they occur, but obviously that could be handled other ways.  I find this beneficial for many reasons, including:

    * keep a separate copy out of LM so some errant action in LM does not destroy config data and history
    * enable searching for configuration elements across multiple files (impossible within the UI)
    * build tools to validate configs against baseline templates or other sorts of analysis
    * generate way better diff results (the current UI diff viewer REALLY needs a rewrite)
    * I get to find out all the times LMConfig flakes out, like when it zeroes out config instances if NVRAM is temporarily unavailable

    I would like to post those here, but you can't post text files it seems.  Will see if I can get those into github....

    On 5/30/2018 at 3:32 AM, Kuldip Mitra said:

    Hi Mnagel,

    Thanks for the reply. Can you please share us the script/GIT Repo URL to pull the config instances so that I can implement in my environment and check it.

     

    Regards

    Kuldip

     

    @Kuldip Mitra I was trying to find a way to easily sync just part of my repo without manual maintenance, but for now I did the manual method.  The better way can wait a bit. 

    Please see https://github.com/willingminds/lmapi-scripts for the scripts.  Hopefully will work for you without too much pain, but definitely no training wheels attached :).

  • On 6/1/2018 at 3:30 PM, mnagel said:

    I solved this with the REST API -- I have a script that pulls all the config instances, then commits them into a git repo (one per device group in my case).  I use GitLab with an email push trigger, so I get reports on updates more or less as they occur, but obviously that could be handled other ways.  I find this beneficial for many reasons, including:

    * keep a separate copy out of LM so some errant action in LM does not destroy config data and history
    * enable searching for configuration elements across multiple files (impossible within the UI)
    * build tools to validate configs against baseline templates or other sorts of analysis
    * generate way better diff results (the current UI diff viewer REALLY needs a rewrite)
    * I get to find out all the times LMConfig flakes out, like when it zeroes out config instances if NVRAM is temporarily unavailable

    I would like to post those here, but you can't post text files it seems.  Will see if I can get those into github....

    @Kuldip Mitra I was trying to find a way to easily sync just part of my repo without manual maintenance, but for now I did the manual method.  The better way can wait a bit. 

    Please see https://github.com/willingminds/lmapi-scripts for the scripts.  Hopefully will work for you without too much pain, but definitely no training wheels attached :).

     

    I just posted some updates to the above repo after some time battling limitations in the underlying ConfigSource code.  Unfortunately, I have had very little success getting fixes implemented, and I am loathe to take over full local support of the ConfigSource code until merge/library support is ready, so I implemented workarounds to avoid frequent false checkins within my git sync tool.