ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.76k stars 917 forks source link

IOSXR - "Admin mode has been deprecated" #3166

Closed packettoobig closed 2 months ago

packettoobig commented 4 months ago

https://github.com/ytti/oxidized/blob/89f10f76630c3afd99381c2b1acdb3b4b8f0767d/lib/oxidized/model/iosxr.rb#L19

On IOS-XR 7.9, this is what you get :

RP/0/RP0/CPU0:ios#admin show inventory
Thu May 16 11:24:41.344 UTC
WARNING: Admin mode has been deprecated. Please consult the Command Line Interface Guide.

While show inventory outputs the expected data.

I think https://github.com/ytti/oxidized/pull/2915 should be reverted.

robertcheramy commented 4 months ago

Would show inventory all or show inventory raw provide the information needed bei @maugli13 ?

(I've got no IOS-XR to test myself, just reading the documentation) If these commands provide to much data, I'm also fine with reverting to show inventory and @maugli13 can use a custom model if he needs admin show inventory.

ytti commented 4 months ago

It would be also possible in the model to detect if we are running on cXR (32b QNX) or eXR (64b Linux), storate that in class instance variable, and later based on that variable behave differently in what commands to run or how to parse them.

The admin mode exists in cXR, not in eXR, but there are other differences too. And further, eXR has two very different versions, the calvados version ran on ASR9k and then the lite version ran on C8k.

packettoobig commented 3 months ago

In addition to the above c8k running 7.9.2, I have access to some NCS-5501-SE running an older XR 7.3.2. But not to ASR9ks.

On both the NCS and c8k, the output of show inventory is exactly the same as the output of show inventory all. Regarding show inventory raw, it's about 1000 lines long (in my case) and has a lot of not-so-useful information, like every single current/voltage/power sensor and empty transceiver cage.

If you need an output I can provide it, but it's very time-consuming to anonymize all of them.

On the NCS, there is a lot more details in show inventory than in admin show inventory, which is why I suggested simply revertying the change in my original post. Output below:

RP/0/RP0/CPU0:ncs#admin show inventory
Mon Jun  3 08:55:27.813 UTC

 Name: Rack 0                Descr: NCS5501 1RU Chassis                                         
 PID: NCS-5501-SE            VID: V01                   SN: <redacted>

 Name: 0/RP0                 Descr: NC5501 Route Processor Card                                 
 PID: NCS-5501-SE            VID: V01                   SN: <redacted>

 Name: 0/FT0                 Descr: NC5501 Fan Tray Reverse Flow                                
 PID: NCS-1RU-FAN-RV         VID: V01                   SN: N/A         

 Name: 0/FT1                 Descr: NC5501 Fan Tray Reverse Flow                                
 PID: NCS-1RU-FAN-RV         VID: V01                   SN: N/A         

 Name: 0/PM0                 Descr: NCS 5500 AC 1100W Power Supply Port-S Exhaust/Back-to-Front 
 PID: NCS-1100W-ACRV         VID: V01                   SN: <redacted>

 Name: 0/PM1                 Descr: NCS 5500 AC 1100W Power Supply Port-S Exhaust/Back-to-Front 
 PID: NCS-1100W-ACRV         VID: V01                   SN: <redacted>
RP/0/RP0/CPU0:ncs#show inventory      
Mon Jun  3 08:56:39.430 UTC
NAME: "0/RP0", DESCR: "NC5501 Route Processor Card"
PID: NCS-5501-SE       , VID: V01, SN: <redacted>

NAME: "TenGigE0/0/0/0", DESCR: "Cisco SFP+ 10G CU3M Pluggable Optics Module"
PID: SFP-H10GB-CU3M    , VID: V03, SN: <redacted>

NAME: "TenGigE0/0/0/1", DESCR: "Cisco SFP+ 10G CU3M Pluggable Optics Module"
PID: SFP-H10GB-CU3M    , VID: V03, SN: <redacted>

NAME: "TenGigE0/0/0/2", DESCR: "Non-Cisco SFP+ 10G LR Pluggable Optics Module"
PID: P.1396.10         , VID: A  , SN: <redacted>

NAME: "HundredGigE0/0/1/0", DESCR: "Cisco QSFP28 100G SM SR Pluggable Optics Module"
PID: QSFP-100G-SM-SR   , VID: V02, SN: <redacted>

NAME: "HundredGigE0/0/1/1", DESCR: "Cisco QSFP28 100G SM SR Pluggable Optics Module"
PID: QSFP-100G-SM-SR   , VID: V02, SN: <redacted>

NAME: "Rack 0", DESCR: "NCS5501 1RU Chassis"
PID: NCS-5501-SE       , VID: V01, SN: <redacted>

NAME: "0/FT0", DESCR: "NC5501 Fan Tray Reverse Flow"
PID: NCS-1RU-FAN-RV    , VID: V01, SN: N/A

NAME: "0/FT1", DESCR: "NC5501 Fan Tray Reverse Flow"
PID: NCS-1RU-FAN-RV    , VID: V01, SN: N/A

NAME: "0/PM0", DESCR: "NCS 5500 AC 1100W Power Supply Port-S Exhaust/Back-to-Front"
PID: NCS-1100W-ACRV    , VID: V01, SN: <redacted>

NAME: "0/PM1", DESCR: "NCS 5500 AC 1100W Power Supply Port-S Exhaust/Back-to-Front"
PID: NCS-1100W-ACRV    , VID: V01, SN: <redacted>
maugli13 commented 3 months ago

@robertcheramy I'm sorry. I missed the email in which I was mentioned. The main difference between "show inventory all" and "admin show inventory" on my IOS-XR is that the admin cli displays chassis and PSU serial numbers. I couldn't find any other way to collect this information.

zagosch commented 3 months ago

Using the default read-only-tg group for oxidized does result in failure for command admin show inventory. In my used version 7.9.21 (latest tac adviced), show inventory all also shows Powersupply serialnumbers.

I also like to revert back to "show inventory all, due to the need to extend permissions to execute admin show inventory. It is not needed to give this permission since show inventory all also gives SN for the PSU. No different output with the admin command. Only unneeded extended permissions for the oxidized user.

RP/0/RSP0/CPU0:xxxxxx#show inventory all         
Wed Jun 19 09:57:19.242 CEST
NAME: "0/RSP0", DESCR: "ASR 9901 Route processor"
PID: ASR-9901-RP       , VID: V03, SN: FOCxxxxx

NAME: "0/0", DESCR: "ASR 9901 Line card"
PID: ASR-9901-LC       , VID: V03, SN: FOCxxxxx

NAME: "Rack 0", DESCR: "ASR 9901 Chassis"
PID: ASR-9901          , VID: V03, SN: FOCxxxxx

NAME: "0/FT0", DESCR: "ASR 9901 Fan Tray"
PID: ASR-9901-FAN      , VID: V01, SN: FOCxxxxx

NAME: "0/FT1", DESCR: "ASR 9901 Fan Tray"
PID: ASR-9901-FAN      , VID: V01, SN: FOCxxxxx

NAME: "0/FT2", DESCR: "ASR 9901 Fan Tray"
PID: ASR-9901-FAN      , VID: V01, SN: FOCxxxxx

NAME: "0/PT0", DESCR: "Simulated Power Tray IDPROM"
PID: A9K-AC-PEM        , VID: V03, SN: FOTxxxxxx

NAME: "0/PT0-PM0", DESCR: "1600W AC Power Module"
PID: A9K-1600W-AC      , VID: V01, SN: POGxxxxxx

NAME: "0/PT0-PM1", DESCR: "1600W AC Power Module"
PID: A9K-1600W-AC      , VID: V01, SN: POGxxxxxx