On Mon, Apr 21, 2025 at 4:09 PM Ari Rabinowitz wrote:
>
> Hi,
>
> I'm trying to set up SNMP monitoring of many of our devices. Since most of 
> them support SNMPv3 I've set up the following in my /etc/snmp/snmp.conf:
> defVersion 3
> defSecurityLevel authPriv
> defAuthType SHA
> defPrivType AES
> defAuthPassphrase REDACTED
> defPrivPassphrase  REDACTED
> defSecurityName USER
>
> I'm able to override the Version 3 parameters such as defSecurityLevel, 
> defAuthType and the passphrases for the devices which support SNMPv3 in host 
> specific configuration files in /etc/snmp/hosts/, but I can't find any way to 
> specify in a host-specific configuration that the host uses version 2c or 
> version 1. Is there any way to do that, if the general default is version 3?

There's supposed to be a way - man snmp.conf says
       For example, if you wanted a particular host to use SNMPv2c  by  default
       you could create a ˜/.snmp/hosts/NAME.conf file and in it put:

              defVersion 2c

but it doesn't work for me

$ cat ~/.snmp/librarysw.conf
defVersion 2c

$ head -1 ~/.snmp/snmp.conf
defVersion 3

$ snmpwalk  librarysw system
snmpwalk: Unknown user name (Sub-id not found: (top) -> system)

$ snmpwalk -v 2c librarysw system
RFC1213-MIB::sysDescr.0 = STRING: "JetStream 24-Port Gigabit L2+
Managed Switch with 4 SFP Slots"
RFC1213-MIB::sysObjectID.0 = OID: TPLINK-MIB::tplinkProducts.122
RFC1213-MIB::sysUpTime.0 = Timeticks: (1501667371) 173 days, 19:17:53.71
RFC1213-MIB::sysContact.0 = STRING: "www.tp-link.com"
RFC1213-MIB::sysName.0 = STRING: "librarysw"
RFC1213-MIB::sysLocation.0 = STRING: "Hong Kong"
RFC1213-MIB::sysServices.0 = INTEGER: 3

hrmmm..  the man page says ˜/.snmp/hosts/NAME.conf so let's move the
librarysw.conf file to .snmp/hosts/ and try again

$ cat ~/.snmp/hosts/librarysw.conf
defVersion 2c

$ snmpwalk librarysw system
snmpwalk: Unknown user name (Sub-id not found: (top) -> system)

still no :(

Regards
Lee


_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to