-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(anta): Added the test case to verify SNMP Logging Configuration #849
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #849 will not alter performanceComparing Summary
|
anta/tests/snmp.py
Outdated
failures += f"SNMP host '{hostname }' is not configured.\n" | ||
continue | ||
if actual_vrf != vrf: | ||
failures += f"SNMP host '{hostname }' is not correctly configured in specified vrf '{vrf}'.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should give the failure message like For SNMP host '{hostname }' expected vrf is blah
but found blah11
instead.
anta/tests/snmp.py
Outdated
class SNMPHost(BaseModel): | ||
"""Model for a SNMP Host.""" | ||
|
||
hostname: IPv4Address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is only option of ipv4 address then better to use host instead of hostname. If we can use and name then update input restriction
"hosts": { | ||
"192.168.1.100": {"port": 162, "vrf": ""}, | ||
"192.168.1.101": {"port": 162, "vrf": "MGMT"}, | ||
"snmp-server-01": {"port": 162, "vrf": "MGMT"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you share the json output from device for hostname
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaf1-dc1#show snmp | json
{
"chassis": {
"chassisId": "C2BB56D511CAB40E40B2DCD1E9D3A9C9"
},
"contact": {
"contact": "\"Network Admin\""
},
"location": {
"location": "\"Data Center A\""
},
"counters": {
"serviceEnabled": true,
"inPkts": 0,
"inVersionErrs": 0,
"inBadCommunityNames": 0,
"inBadCommunityUses": 0,
"inParseErrs": 0,
"inRequestVars": 0,
"inSetVars": 0,
"inGetPdus": 0,
"inGetNextPdus": 0,
"inSetPdus": 0,
"outPkts": 5,
"outTooBigErrs": 0,
"outNoSuchNameErrs": 0,
"outBadValueErrs": 0,
"outGeneralErrs": 0,
"outGetResponsePdus": 0,
"outTrapPdus": 5,
"outTrapDrops": 0,
"groupLength": 3,
"numberOfGroups": 9,
"numberOfViews": 0
},
"logging": {
"loggingEnabled": true,
"hosts": {
"192.168.1.100": {
"port": 162,
"vrf": ""
},
"leaf1-dc1": {
"port": 162,
"vrf": ""
},
"spine": {
"port": 162,
"vrf": ""
},
"spine1-dc1.fun.aristanetworks.com": {
"port": 162,
"vrf": ""
}
}
},
"vrfs": {
"snmpVrfs": [
"default"
]
},
"srcIntf": {
"sourceInterfaces": {
"default": "Management0",
"MGMT": "Ethernet1"
}
},
"misc": {
"transmitMsgMaxSize": 65536
},
"enabled": true,
}
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
47a8646
to
6449e97
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Quality Gate passedIssues Measures |
Description
Verifies whether the SNMP logging is enabled and SNMP manager(host) details in a specified VRF.
Fixes #821
Checklist:
pre-commit run
)tox -e testenv
)