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

How to get a node's OBJECTS? #31

Closed
Hipska opened this issue Dec 15, 2021 · 2 comments
Closed

How to get a node's OBJECTS? #31

Hipska opened this issue Dec 15, 2021 · 2 comments

Comments

@Hipska
Copy link

Hipska commented Dec 15, 2021

I'm trying to use gosmi to parse/process all traps and their objects. But the node doesn't seem to hold this info.

linkDown NOTIFICATION-TYPE
    OBJECTS { ifIndex, ifAdminStatus, ifOperStatus }
    STATUS  current
    DESCRIPTION
            "A linkDown trap signifies that the SNMP entity, acting in
            an agent role, has detected that the ifOperStatus object for
            one of its communication links is about to enter the down
            state from some other state (but not from the notPresent
            state).  This other state is indicated by the included value
            of ifOperStatus."
    ::= { snmpTraps 3 }

Results in this json:

{
	"Access": "Unknown",
	"Decl": "NotificationType",
	"Description": "A linkDown trap signifies that the SNMP entity, acting in\nan agent role, has detected that the ifOperStatus object for\none of its communication links is about to enter the down\nstate from some other state (but not from the notPresent\nstate).  This other state is indicated by the included value\nof ifOperStatus.",
	"Kind": "Notification",
	"Name": "linkDown",
	"Oid": [1,3,6,1,6,3,1,1,5,3],
	"OidLen": 10,
	"Status": "Current",
	"Type": null,
	"SmiType": null
}

How would it be possible to get the OBJECTS?

@sleepinggenius2
Copy link
Owner

With a raw SmiNode, you would need to call the AsNotification() function on it, which will return a struct with an Objects field set, or you can call GetNotificationObjects() on the SmiNode directly.

@Hipska
Copy link
Author

Hipska commented Dec 15, 2021

Many thanks for the pointers, will look into that.

@Hipska Hipska closed this as completed Dec 15, 2021
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