oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Add extra command to execute while doing the backup

Open lodpp opened this issue 2 years ago • 2 comments

Hi !

Thanks a lot for the oxidized tool, it's saving us lots of time !

With Cisco IOSXR, oxidized is doing:

  • show inventory
  • show platform
  • show running-config

This is okay but not enough for my case as it lacks the admin configuration. (given by admin show running-config)

Eventually, even the show inventory and show platform lacks some data when compared to their admin counter-part.

ie with the platform:

RP/0/RSP0/CPU0:ro-1.csd4#admin show platform
Tue Dec 26 14:38:21.191 UTC
Node            Type                      State            Config State
-----------------------------------------------------------------------------
0/RSP0/CPU0     ASR9001-RP(Active)        IOS XR RUN       PWR,NSHUT,MON
0/FT0/SP        ASR-9001-FAN              READY
0/0/CPU0        ASR9001-LC                IOS XR RUN       PWR,NSHUT,MON
0/0/1           A9K-MPA-20X1GE            OK               PWR,NSHUT,MON
0/PS0/M0/SP     A9K-750W-AC               READY            PWR,NSHUT,MON
0/PS0/M1/SP     A9K-750W-AC               READY            PWR,NSHUT,MON

VS

RP/0/RSP0/CPU0:ro-1.csd4#show platform
Tue Dec 26 14:38:24.146 UTC
Node            Type                      State            Config State
-----------------------------------------------------------------------------
0/RSP0/CPU0     ASR9001-RP(Active)        IOS XR RUN       PWR,NSHUT,MON
0/0/CPU0        ASR9001-LC                IOS XR RUN       PWR,NSHUT,MON
0/0/1           A9K-MPA-20X1GE            OK               PWR,NSHUT,MON

So here is my question: Is it possible to easily ask the backup tool to execute extra commands for all the ioxr family ? or eventually redefine the set of commands to exec on a devive for backup ?

I could duplicate/modify the lib/oxidized/model/iosxr.rb but I don't feel that it's the best way to do this...

Thanks a lot !

lodpp avatar Dec 26 '23 14:12 lodpp

So here is my question: Is it possible to easily ask the backup tool to execute extra commands for all the ioxr family ? or eventually redefine the set of commands to exec on a devive for backup ?

See https://github.com/ytti/oxidized/blob/master/docs/Creating-Models.md#extending-an-existing-model-with-a-new-command

Something like ~/.config/oxidized/model/iosxr.rb

require 'oxidized/model/iosxr.rb'

class IOSXR
  using Refinements

  cmd 'admin show running-config' do |cfg|
    comment cfg
  end
  cmd 'admin show platform' do |cfg|
    comment cfg
  end

end

systeembeheerder avatar Feb 19 '24 14:02 systeembeheerder

Hi @systeembeheerder

That should do it in fact, I missed that point in the documentation, I will test it this week. thanks !

lodpp avatar Feb 19 '24 15:02 lodpp