Skip to content

Commit 5f75ad8

Browse files
authored
snmp: T7180: Fixed verification of engineid in snmpv3 (#4366)
* snmp: T7180: Fixed verification of engineid in snmpv3 EngineID must be configured if snmpv3 user is configured. Fixed engineid help string.
1 parent 9468dbf commit 5f75ad8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

interface-definitions/service_snmp.xml.in

-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@
304304
</constraint>
305305
<constraintErrorMessage>ID must contain an even number (from 2 to 36) of hex digits</constraintErrorMessage>
306306
</properties>
307-
<defaultValue></defaultValue>
308307
</leafNode>
309308
<tagNode name="group">
310309
<properties>

src/conf_mode/service_snmp.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright (C) 2018-2024 VyOS maintainers and contributors
3+
# Copyright (C) 2018-2025 VyOS maintainers and contributors
44
#
55
# This program is free software; you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License version 2 or later as
@@ -147,6 +147,9 @@ def verify(snmp):
147147
return None
148148

149149
if 'user' in snmp['v3']:
150+
if 'engineid' not in snmp['v3']:
151+
raise ConfigError(f'EngineID must be configured for SNMPv3!')
152+
150153
for user, user_config in snmp['v3']['user'].items():
151154
if 'group' not in user_config:
152155
raise ConfigError(f'Group membership required for user "{user}"!')

0 commit comments

Comments
 (0)