SNMPD Not showing same data

General support questions
Post Reply
lslamp
Posts: 2
Joined: 2023/01/02 15:16:59

SNMPD Not showing same data

Post by lslamp » 2023/01/02 22:45:51

I am a little confused, I am new to Centos 7.
I have two machines that seem to be behaving differently.
#
## server #1
# cat /etc/*release
CentOS Linux release 7.9.2009 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.9.2009 (Core)
CentOS Linux release 7.9.2009 (Core)

#
## Server #2
# cat /etc/*release
CentOS Linux release 7.9.2009 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.9.2009 (Core)
CentOS Linux release 7.9.2009 (Core)

Everything seems to be the same.
I carried out the installation of net-snmp on both servers
yum -y install net-snmp net-snmp-utils

The issue that I am facing is that I cannot use the same snmpd.conf file on both servers.

Server #1 smnp.conf - this starts the snmpd service without a hassle, but if I try the same config on server #2, does not deliver the same results.
####
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact systemview none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
#agentAddress tcp:localhost:161
#rocommunity public 0.0.0.0/0

Server #2 smnp.conf - this starts the snmpd service without a hassle.
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact systemview none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
#agentAddress tcp:localhost:161
#rocommunity public 0.0.0.0/0

#
## Server #1 SNMPWALK results
#
snmpwalk -v1 -c public localhost
SNMPv2-MIB::sysDescr.0 = STRING: Linux mail4.enem.nl 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2370976) 6:35:09.76
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0 = STRING: mail4.enem.nl
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (edit /etc/snmp/snmpd.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORID.1 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.2 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.9 = OID: SNMP-NOTIFICATION-MIB::snmpNotifyFullCompliance
SNMPv2-MIB::sysORID.10 = OID: NOTIFICATION-LOG-MIB::notificationLogMIB
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.2 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.3 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB modules for managing SNMP Notification, plus filtering.
SNMPv2-MIB::sysORDescr.10 = STRING: The MIB module for logging SNMP Notifications.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.9 = Timeticks: (5) 0:00:00.05
SNMPv2-MIB::sysORUpTime.10 = Timeticks: (5) 0:00:00.05
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (3645117869) 421 days, 21:19:38.69
End of MIB

#
## Server #2 SNMPWALK results -- VERY limited output
#
nmpwalk -v1 -c public localhost
End of MIB

The SNMP version on both servers are the same.

Server #1: snmpd -V
NET-SNMP version: 5.7.2

Server #2: snmpd -V
NET-SNMP version: 5.7.2

I hope that someone can help advise me

Thanks
Lawrence

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SNMPD Not showing same data

Post by TrevorH » 2023/01/03 00:29:13

Server #1: snmpd -V
NET-SNMP version: 5.7.2

Server #2: snmpd -V
NET-SNMP version: 5.7.2
That's not an adequate check. All snmp versions on CentOS 7 will have reported that since 2014 and will do until it goes EOL in 2024. Try rpm -q net-snmp for a better check.

Did you restart the snmpd daemon after changing the config?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

lslamp
Posts: 2
Joined: 2023/01/02 15:16:59

Re: SNMPD Not showing same data

Post by lslamp » 2023/01/03 11:38:59

@TrevorH
Thanks for your reply.

Yes I have restarted the snmpd deamon each time I update the snmpd.conf file.

Below is the package used, it isthe same on both machines.
rpm -q net-snmp
net-snmp-5.7.2-49.el7_9.2.x86_64

I have been trying various things now and am still in the same situation. The two snmpd.conf files are somewhat different now, if I make them exactly the same then the deamon on server #1 will start but the deamon on server two will not.

server #1 snmpd.conf
com2sec notConfigUser default xxxx
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact systemview none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
#agentAddress tcp:localhost:161
#rocommunity xxxxxx 0.0.0.0/0

With the snmpd.conf the same below is the error that appears on server #2
Jan 03 12:27:53 server1.enem.nl systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
Jan 03 12:27:53 server1.enem.nl snmpd[8691]: Error opening specified endpoint ""
Jan 03 12:27:53 server1.enem.nl snmpd[8691]: Server Exiting with code 1
Jan 03 12:27:53 server1.enem.nl systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
Jan 03 12:27:53 server1.enem.nl systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Daemon..

With the below config server #2 deamon starts without hassles but gives NO info back when I run an snmpwalk on the localhost.
server #2 snmpd.conf
com2sec notConfigUser default xxxxx
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
#access notConfigGroup "" any noauth exact systemview none none
#syslocation Unknown (edit /etc/snmp/snmpd.conf)
#syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
#dontLogTCPWrappersConnects yes
agentAddress tcp:localhost:161
rocommunity xxxxxxx 0.0.0.0/0

This is very confusing.

Thanks
Lawrence

Post Reply