Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_facts #13

Open
abdulrahmanAbduatif opened this issue Oct 20, 2020 · 6 comments
Open

get_facts #13

abdulrahmanAbduatif opened this issue Oct 20, 2020 · 6 comments

Comments

@abdulrahmanAbduatif
Copy link

Hi ixs,
Thank you for this amazing work. How difficult to add the status of the modules (show modules) within get _facts function?

I really appreciate any help you can provide.

@ixs
Copy link
Owner

ixs commented Oct 20, 2020

Hi Abdulrahman,

I do not know.
Programatically this is easy. A few more lines of code and done.

But I am not sure if the output of get_facts() is the right place to store module information.

Show modules here is empty:

HP-E2910al-48G-PoE# show modules

 Status and Counters - Module Information

  Chassis: E2910al-48G-PoE  J9148A        Serial Number:   KT45Z13FG


                                                                      Core  Mod
  Slot Module Description                     Serial Number  Status   Dump  Ver
  ---- -------------------------------------- -------------- -------- ----- ---


HP-E2910al-48G-PoE#

Can you give me some sample output please what show modules looks like on your machine?

@abdulrahmanAbduatif
Copy link
Author

Hi there, Thanks for the quick response, Much appreciated

Status and Counters - Module Information

Chassis: XXXXXXXXXX         Serial Number:   XXXXXXXXXX

Allow V2 Modules:   Yes

                                                                      Core  Mod
Slot  Module Description                     Serial Number  Status   Dump  Ver
----- -------------------------------------- -------------- -------- ----- ---
MM1   HP J9827A Management Module 5400Rzl2   XXXXXXXXXX     Standby  YES   1
MM2   HP J9827A Management Module 5400Rzl2   XXXXXXXXXX     Active   YES   1


A     HP J9990A 20p PoE+ / 4p SFP+ v3 zl2... XXXXXXXXXX     Up       YES   3
B     HP J9990A 20p PoE+ / 4p SFP+ v3 zl2... XXXXXXXXXX     Up       YES   3
C     HP J9986A 24p 10/100/1000BASE-T PoE... XXXXXXXXXX     Up       YES   3
D     HP J9986A 24p 10/100/1000BASE-T PoE... XXXXXXXXXX     Up       YES   3
E     HP J9986A 24p 10/100/1000BASE-T PoE... XXXXXXXXXX     Up       YES   3

Also when I run get_environment() on version KB.16.08, power and fans return an empty dictionary, I know that the output on this version for power is different than the older versions, they have added a serial number column. However, I think your getting the data using MIB walk to retrieve the data, so I'm not sure why.

Cheers

@ixs
Copy link
Owner

ixs commented Oct 20, 2020

Hmm.

Thank you for the output.
Censoring the Serial number is fine. But I'd need the Chassis Identifier uncensored so that I can understand what this is...
But as strings are again terminated, it looks like going for a bit more walkMib() might be the right approach.

Do you have an example forthe power and fan output you get?

@abdulrahmanAbduatif
Copy link
Author

Thank you ixs. let me provide you with what I can.
two types of chassis, the one working fine is as below:

chassis: 8212z1 J9091A
napalm output:

{'cpu': {0: {'%usage': 1.0}},
'fans': {'Fan Sensor': {'status': True}},
'memory': {'available_ram': 44190000, 'used_ram': 76932752},
'power': {'External Power Supply 1 Sensor': {'capacity': -1.0,
                                              'output': -1.0,
                                              'status': True},
           'External Power Supply 2 Sensor': {'capacity': -1.0,
                                              'output': -1.0,
                                              'status': True},
           'Power Supply 1 Sensor': {'capacity': -1.0,
                                     'output': -1.0,
                                     'status': True},
           'Power Supply 2 Sensor': {'capacity': -1.0,
                                     'output': -1.0,
                                     'status': True},
           'Power Supply 3 Sensor': {'capacity': -1.0,
                                     'output': -1.0,
                                     'status': True},
           'Power Supply 4 Sensor': {'capacity': -1.0,
                                     'output': -1.0,
                                     'status': True},
           'RPS Power Supply Sensor': {'capacity': -1.0,
                                       'output': -1.0,
                                       'status': False}},
'temperature': {'Over-temperature Sensor': {'is_alert': False,
                                             'is_critical': False,
                                             'temperature': -1.0}}}

command line: sh system power-supply

Power Supply Status:

PS#    Model       State        AC/DC  + V      Wattage
---- --------- ------------- ----------------- ---------
   1   Unknwn    Powered         AC 220V          1500
   2   Unknwn    Powered         AC 220V          1500
   3   Unknwn    Powered         AC 220V          1500
   4   Unknwn    Powered         AC 220V          1500

   4 /  4 supply bays delivering power.
   Total power: 6000 W

The one which caused problems:
chassis: 5412Rz12 J9851A
Note: this is Aruba hardware running ProCurve image they lunched before arubaOScx

napalm output:


{'cpu': {0: {'%usage': 9.0}},
'fans': {},
'memory': {'available_ram': 495398072, 'used_ram': 193858832},
'power': {},
'temperature': {'Chassis Sensor': {'is_alert': False,
                                    'is_critical': False,
                                    'temperature': -1.0}}}

command line: sh system power-supply

Power Supply Status:

PS#    Model      Serial          State         AC/DC  + V    Wattage
---- --------- ------------ ----------------- -------------- ---------
   1   J9830B    XXXXXXXXXX   Aux Not Powered   AC 120V/240V     2750
   2   J9830B    XXXXXXXXXX   Permanent Failure  AC 120V/240V     2750

   2 /  2 supply bays delivering power.
   Total power: 5500 W

And you can notice that the output of the sh system power-supply command is different where there is one more column which is serial.

@ixs
Copy link
Owner

ixs commented Oct 22, 2020

Okay. Thank you for this data, I'm gonna build a new testcase and we can see how to handle this best.

@abdulrahmanAbduatif
Copy link
Author

Thanks mate for all of your amazing work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants