nornir-automation / nornir

Pluggable multi-threaded framework with inventory management to help operate collections of devices
https://nornir.readthedocs.io/
Apache License 2.0
1.38k stars 234 forks source link

Can't get device state from Nornir #838

Closed Oussema-99 closed 1 year ago

Oussema-99 commented 1 year ago

Hello,

I'm using Netbox inventory plugin with Nornir and trying to filter on device state (active/planned...). I can't see status anywhere, is there something I'm missing or maybe better a better way of displaying all options?

ipdb> dir(nr.inventory.hosts["NX9300-1"])
['__bool__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '_get_connection_options_recursively', '_has_parent_group_by_name', '_has_parent_group_by_object', 'close_connection', 'close_connections', 'connection_options', 'connections', 'data', 'defaults', 'dict', 'extended_data', 'extended_groups', 'get', 'get_connection', 'get_connection_parameters', 'groups', 'has_parent_group', 'hostname', 'items', 'keys', 'name', 'open_connection', 'password', 'platform', 'port', 'schema', 'username', 'values']
ipdb> 
ktbyers commented 1 year ago

@Oussema-99 Did you look in the data field?

Oussema-99 commented 1 year ago

I did, this is what it shows:

ipdb> nr.inventory.hosts["NX9300-1"].data
{'serial': '', 'vendor': 'Cisco', 'asset_tag': None, 'site': 'test', 'role': 'border_leaf', 'model': 'nexus_9336'}
ipdb> 

Device in Netbox is configured to be in Active state, I tried data, state, status and many others, none of it worked.

ktbyers commented 1 year ago

@Oussema-99 You should probably ask your quest in the nornir-netbox community. I am going to close this as I don't think it is a Nornir specific issue.

Oussema-99 commented 1 year ago

Got it, I didn't realize nornir-netbox plugin was a separate community. Thank you for your help!

itheodoridis commented 1 year ago

You should probably check under netbox.

@.***

Ιωάννης Θεοδωρίδης | Αν. Προϊστάμενος Μηχανικός Δικτύων και Συστημάτων

ΤΜΗΜΑ ΔΙΚΤΥΩΝ

ΔΙΕΥΘΥΝΣΗ ΠΛΗΡΟΦΟΡΙΚΗΣ

Λ. Μεσογείων 341|Τ.Κ. 152 31|Χαλάνδρι

Τ. (+30) 210 679 9557

Email: @.**@.>

From: Oussema-99 @.> Sent: Monday, March 13, 2023 10:14 AM To: nornir-automation/nornir @.> Cc: Subscribed @.***> Subject: Re: [nornir-automation/nornir] Can't get device state from Nornir (Issue #838)

Got it, I didn't realize nornir-netbox plugin was a separate community. Thank you for your help!

— Reply to this email directly, view it on GitHubhttps://mail.bankofgreece.gr/fmlurlsvc/?fewReq=:B:JV07MDQ5Oyd3PDMvMSdoZTwxMDsxMCdyaGZvYHV0c2Q8N2AyYzk0Mmc3YjE4ZzdiNjYzMmI4NjExYjZkYGVjNzM4NWBkZTUxMyd1PDA3Njk3ODQzNzUncGhlPDIzRTlESmhAMTE5OTI4LDIzRTlESmhCMTE5OTI4J3NicXU8aHVpZG5lbnNoZWhyQWNgb2puZ2ZzZGRiZC9mcydiPDQzJ2llbTwx&url=https%3a%2f%2fgithub.com%2fnornir-automation%2fnornir%2fissues%2f838%23issuecomment-1465689095, or unsubscribehttps://mail.bankofgreece.gr/fmlurlsvc/?fewReq=:B:JV07MDQ5Oyd3PDMvMSdoZTwxMDsxMCdyaGZvYHV0c2Q8OGc3Z2U3OWdlNWBkMmdjYDhnM2Q2NjUxZDY2MzJjNGNnZzllMmBiYCd1PDA3Njk3ODQzNzUncGhlPDIzRTlESmhAMTE5OTI4LDIzRTlESmhCMTE5OTI4J3NicXU8aHVpZG5lbnNoZWhyQWNgb2puZ2ZzZGRiZC9mcydiPDQzJ2llbTwx&url=https%3a%2f%2fgithub.com%2fnotifications%2funsubscribe-auth%2fADVIRDLXPKQGXIB57LQIRCLW33JNVANCNFSM6AAAAAAVWUZN7E. You are receiving this because you are subscribed to this thread .Message ID: @.**@.>>

Με την επιφύλαξη παντός νομίμου δικαιώματός μας, κάθε μήνυμα ηλεκτρονικού ταχυδρομείου από την Τράπεζα της Ελλάδος (ΤτΕ) αποστέλλεται καλόπιστα αλλά δεν τη δεσμεύει ούτε ερμηνεύεται ως να συνιστούσε ή επηρέαζε συμβατική ή άλλη δέσμευση της ΤτΕ. Το μήνυμα ηλεκτρονικού ταχυδρομείου προορίζεται προς αποκλειστική χρήση του προσώπου, του οποίου η διεύθυνση αναγράφεται στην επικεφαλίδα του μηνύματος. Ο αποστολέας και η ΤτΕ δεν αναλαμβάνουν καμμία ευθύνη για ανακριβειες, παραβίαση της ακεραιότητας, απώλεια ή καθυστερημένη διαβίβαση του μηνύματος, για αστοχία, διακοπή ή υποβάθμιση της υπηρεσίας ή του μηνύματος καθώς και για κάθε εξ αυτού του λόγου απώλεια ή ζημία καθόλη την υπό του νόμου προβλεπόμενη έκταση. Εάν λάβατε κατά λάθος το παρόν μήνυμα ηλεκτρονικού ταχυδρομείου, παρακαλούμε να ειδοποιήσετε αμέσως μέσω ηλεκτρονικού ταχυδρομείου τον αποστολέα και να διαγράψετε το μήνυμα. Οποιαδήποτε ανακοίνωση, διάδοση ή χρήση μέρους ή ολόκληρου του μηνύματος χωρίς άδεια απαγορεύεται αυστηρά και μπορεί να επιφέρει ποινική και αστική ευθύνη. Η ΤτΕ επεξεργάζεται δεδομένα προσωπικού χαρακτήρα σύμφωνα με το Γενικό Κανονισμό Προστασίας Δεδομένων (Κανονισμός (ΕΕ) 2016/679) και το Νόμο 4624/2019, «μέτρα εφαρμογής του Κανονισμού (ΕΕ) 2016/679 για την προστασία των φυσικών προσώπων έναντι της επεξεργασίας δεδομένων προσωπικού χαρακτήρα», όπως ισχύει. Για περισσότερες πληροφορίες μπορείτε να συμβουλευτείτε την Πολιτική Προστασίας Προσωπικών Δεδομένων της ΤτΕ στην ιστοσελίδα της ΤτΕ. Για τυχόν διευκρινίσεις μπορείτε να επικοινωνήσετε με τον Υπεύθυνο Προστασίας Δεδομένων της ΤτΕ @.) @. ). Μπορείτε επίσης να επικοινωνήσετε με την Αρχή Προστασίας Δεδομένων Προσωπικού Χαρακτήρα.Any e-mail message from the Bank of Greece (BoG) is sent in good faith but shall neither be binding nor construed as constituting or affecting a contractual arrangement or other commitment by the BoG. The e-mail is intended for the exclusive use of the person whose e-mail address appears in caption as recipient. The sender and the BoG decline liability for inaccuracy, breach of integrity, loss or delayed delivery of the message, for any failure in, interruption to or degradation of either the service or the message, as well as for any loss or damage sustained thereof to the fullest extent provided by law. If this e-mail was not intended for you, please notify the sender immediately via e-mail and delete it at once. Any unauthorized disclosure, dissemination or use, either in whole or in part is strictly prohibited and may give rise to both criminal and civil liability. The BoG processes personal data in accordance with the General Data Protection Regulation (Regulation (EU) 2016/679) and Law 4264/2019 on the implementation of the General Data Protection Regulation, as in force. For additional information you may consult BoG’s Personal Data Protection Policy on BoG’s website. Should you need any clarification, please contact BoG’s Data Protection Officer @.) @. ). You may also contact the Hellenic Data Protection Authority.All rights reserved. ===============================================================================================