07-16-2018 01:49 AM - edited 03-01-2019 03:25 PM
Hello
We are trying to build some tools that keep track of the state of the ASR9000 in our network (e.g. linecards installed, interface description). Normally we would periodically login in the routers, run a set of commands and retrieve the necessary information.
We would like to find a way to run these commands only when it is necessary (only if changes were made since last time the commands where executed)
So instead of logging into the routers and repetitively run same commands to get current configuration and hardware status, it would be nice if we could:
- Login in the router and check the date of last XR config changes
- Login in the router and check the date of last hardware / platform changes
If any of these timestamps defers from what we have gotten from previous logins, proceed and retrieve the data again from the router (e.g. execute show platform, show interfaces etc)
Else we know that we have an up todate picture of the router and do nothing
Does the ASR9k keep a time stamp of the last time the config and the hardware were changed?
07-16-2018 07:48 AM
Configuration is easy, show config commit list will list the last changes with timestamp, and then you can use show config commit changes to see the changes of a particular change ID.
For hardware changes you would need to monitor syslog, the easiest being to look for 'shelfmgr' messages as when a hardware component changes state shelfmgr is responsible for that state change.
Sam
07-16-2018 01:53 PM
Something else you can do, is monitor the uptime of the card via admin show logging onboard uptime loc <lc>
Sam
07-17-2018 01:30 PM
Thnx for your suggestions Sam
The "show configuration history commit last 1" will get me exactly what I needed
For hardware changes will retrieve uptime for each slot (the "show operational Platform" also
seem to give the uptime of each linecard in a nice - easy to parse - format )
Vikas
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