Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I'm trying to install snmp on my server (redhat Linux FEACS 3.10.0-229.el7.x86_64), but I have an issue when I try to start snmp, the error is:
[root@FEACS log]# service snmpd start
Redirecting to /bin/systemctl start snmpd.service
Job for snmpd.service failed because the control process exited with error code. See "systemctl status snmpd.service" and "journalctl -xe" for details.
commands results:
Code:
[root@FEACS log]# tail /var/log/snmpd.log
Error opening specified endpoint ""
Server Exiting with code 1
[root@FEACS log]#
This is a binding error; the SNMP process is unable to bind to a socket. There can be several reasons for this.
I would have expected there to be an IP address and a port number between the quotes. If the process is really trying to bind to an empty string, failure should be expected.
However, I suspect the lack of a socket identifier simply means you haven't specified a socket/port in /etc/snmpd.conf, which should result in the process trying to bind to 0.0.0.0/UDP/161 (the defaults for snmpd). You could try specifying "agentaddress udp:161" in /etc/snmpd.conf and see if that makes any difference.
It could also be that snmpd is unable to bind to the port due to insufficient privileges, since 161 is in the "well-known" range (<1024) and you need root privileges to bind to such ports. If that is the case, specifying "agentaddress udp:1161" (or any unused port in the 1024-65535 range) should allow the process to start.
If indeed the issue turns out to be a lack of privileges, then systemd is trying to start a system service as the wrong user, which means it's either misconfigured (probably) or contains a weird bug.
Thank you for your response, I tried to change snmpd.conf by adding "192.168.30.10 udp:161" or "192.168.30.10 udp:1161" , but it doesn't resolve the problem:
Code:
[root@FEACS ~]# service snmpd start
Redirecting to /bin/systemctl start snmpd.service
Job for snmpd.service failed because the control process exited with error code. See "systemctl status snmpd.service" and "journalctl -xe" for details.
[root@FEACS ~]#
Code:
[root@FEACS ~]# vi /etc/snmp/snmpd.conf
rocommunity s2mCommunity
"192.168.30.10 udp:1161"
[root@FEACS ~]#
Code:
[root@FEACS ~]# systemctl status snmpd.service
● snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
Loaded: loaded (/usr/lib/systemd/system/snmpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since jeu. 2016-04-07 16:23:58 WEST; 30s ago
Process: 21617 ExecStart=/usr/sbin/snmpd $OPTIONS -f (code=exited, status=1/FAILURE)
Main PID: 21617 (code=exited, status=1/FAILURE)
avril 07 16:23:58 FEACS snmpd[21617]: /etc/snmp/snmpd.conf: line 2: Error: Blank line following 192.168.30.10...oken.
avril 07 16:23:58 FEACS snmpd[21617]: net-snmp: 1 error(s) in config file(s)
avril 07 16:23:58 FEACS snmpd[21617]: /etc/snmp/snmpd.conf: line 2: Error: Blank line following 192.168.30.10...oken.
avril 07 16:23:58 FEACS snmpd[21617]: net-snmp: 1 error(s) in config file(s)
avril 07 16:23:58 FEACS snmpd[21617]: Error opening specified endpoint ""
avril 07 16:23:58 FEACS snmpd[21617]: Server Exiting with code 1
avril 07 16:23:58 FEACS systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
avril 07 16:23:58 FEACS systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Daemon..
avril 07 16:23:58 FEACS systemd[1]: Unit snmpd.service entered failed state.
avril 07 16:23:58 FEACS systemd[1]: snmpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@FEACS ~]#
Code:
[root@FEACS ~]# journalctl -xe
avril 07 16:23:37 FEACS systemd[1]: Unit snmpd.service cannot be reloaded because it is inactive.
avril 07 16:23:37 FEACS polkitd[49537]: Unregistered Authentication Agent for unix-process:21460:1582450876 (system b
avril 07 16:23:47 FEACS polkitd[49537]: Registered Authentication Agent for unix-process:21535:1582451910 (system bus
avril 07 16:23:47 FEACS systemd[1]: Stopped Simple Network Management Protocol (SNMP) Daemon..
-- Subject: L'unité (unit) snmpd.service a terminé son arrêt
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unité (unit) snmpd.service a terminé son arrêt.
avril 07 16:23:48 FEACS polkitd[49537]: Unregistered Authentication Agent for unix-process:21535:1582451910 (system b
avril 07 16:23:58 FEACS polkitd[49537]: Registered Authentication Agent for unix-process:21602:1582452931 (system bus
avril 07 16:23:58 FEACS systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
-- Subject: L'unité (unit) snmpd.service a commencé à démarrer
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unité (unit) snmpd.service a commencé à démarrer.
avril 07 16:23:58 FEACS snmpd[21617]: /etc/snmp/snmpd.conf: line 2: Error: Blank line following 192.168.30.10 udp:161
avril 07 16:23:58 FEACS snmpd[21617]: net-snmp: 1 error(s) in config file(s)
avril 07 16:23:58 FEACS snmpd[21617]: /etc/snmp/snmpd.conf: line 2: Error: Blank line following 192.168.30.10 udp:161
avril 07 16:23:58 FEACS snmpd[21617]: net-snmp: 1 error(s) in config file(s)
avril 07 16:23:58 FEACS snmpd[21617]: Error opening specified endpoint ""
avril 07 16:23:58 FEACS snmpd[21617]: Server Exiting with code 1
avril 07 16:23:58 FEACS systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
avril 07 16:23:58 FEACS systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Daemon..
-- Subject: L'unité (unit) snmpd.service a échoué
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unité (unit) snmpd.service a échoué, avec le résultat failed.
avril 07 16:23:58 FEACS systemd[1]: Unit snmpd.service entered failed state.
avril 07 16:23:58 FEACS systemd[1]: snmpd.service failed.
avril 07 16:23:58 FEACS polkitd[49537]: Unregistered Authentication Agent for unix-process:21602:1582452931 (system b
lines 3242-3274/3274 (END)
I'm working with root, so I don't think this is a privilege prob.
The configuration directive you should add to /etc/snmp/snmpd.conf is:
Code:
agentaddress udp:161
But as I said, I'm not convinced that's the problem. It could be a permissions issue (you may be root, but that does not mean the service command will use your account to start snmpd), or the socket may be busy.
What does netstat say about UDP port 161? This will show you if the socket is in use:
Code:
netstat -lupn | grep :161
And what happens if you try to start snmpd manually with:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.