LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-06-2016, 05:49 AM   #1
taoufik109
LQ Newbie
 
Registered: Apr 2016
Posts: 6

Rep: Reputation: Disabled
Issue with snmp service


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]#
Code:
[root@FEACS log]# tail snmpd.conf 
rocommunity mycommunity
[root@FEACS log]#


Code:
[root@FEACS log]# journalctl -xe
avril 06 11:20:01 FEACS CROND[53559]: (root) CMD (/usr/lib64/sa/sa1 1 1)
avril 06 11:22:53 FEACS klnagent[2524]: EventsProcessorProxy: #1255 (0) Transport level error while connecting to http://192.168.30.22:13000: general error
avril 06 11:27:48 FEACS polkitd[49537]: Registered Authentication Agent for unix-process:53694:1572035947 (system bus name :1.63721 [/usr/bin/pkttyagent --
avril 06 11:27:48 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 06 11:27:48 FEACS snmpd[53709]: Error opening specified endpoint ""
avril 06 11:27:48 FEACS snmpd[53709]: Server Exiting with code 1
avril 06 11:27:48 FEACS systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
avril 06 11:27:48 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 06 11:27:48 FEACS systemd[1]: Unit snmpd.service entered failed state.
avril 06 11:27:48 FEACS systemd[1]: snmpd.service failed.
avril 06 11:27:48 FEACS polkitd[49537]: Unregistered Authentication Agent for unix-process:53694:1572035947 (system bus name :1.63721, object path /org/fre
avril 06 11:30:01 FEACS systemd[1]: Started Session 31026 of user root.
-- Subject: L'unité (unit) session-31026.scope a terminé son démarrage
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- L'unité (unit) session-31026.scope a terminé son démarrage, avec le résultat done.
avril 06 11:30:01 FEACS systemd[1]: Starting Session 31026 of user root.
-- Subject: L'unité (unit) session-31026.scope a commencé à démarrer
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- L'unité (unit) session-31026.scope a commencé à démarrer.
avril 06 11:30:01 FEACS CROND[53826]: (root) CMD (/usr/lib64/sa/sa1 1 1)
lines 3166-3199/3199 (END)


[root@FEACS log]# 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 mer. 2016-04-06 11:27:48 WEST; 7min ago
  Process: 53709 ExecStart=/usr/sbin/snmpd $OPTIONS -f (code=exited, status=1/FAILURE)
 Main PID: 53709 (code=exited, status=1/FAILURE)

avril 06 11:27:48 FEACS systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
avril 06 11:27:48 FEACS snmpd[53709]: Error opening specified endpoint ""
avril 06 11:27:48 FEACS snmpd[53709]: Server Exiting with code 1
avril 06 11:27:48 FEACS systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
avril 06 11:27:48 FEACS systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Daemon..
avril 06 11:27:48 FEACS systemd[1]: Unit snmpd.service entered failed state.
avril 06 11:27:48 FEACS systemd[1]: snmpd.service failed.
[root@FEACS log]#

Code:
[root@FEACS log]# rpm -q net-snmp
net-snmp-5.7.2-24.el7.x86_64
[root@FEACS log]#

Code:
[root@FEACS log]# systemctl is-active snmpd
failed
[root@FEACS log]#

Code:
[root@FEACS ~]# systemctl is-enabled snmpd
enabled
[root@FEACS ~]#
Can you please help.
 
Old 04-07-2016, 05:35 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
This line provides the vital clue:
Quote:
Error opening specified endpoint ""
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.
 
Old 04-07-2016, 11:22 AM   #3
taoufik109
LQ Newbie
 
Registered: Apr 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-07-2016, 06:19 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
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:
Code:
/usr/sbin/snmpd -c /etc/snmp/snmpd.conf
 
Old 04-08-2016, 02:37 AM   #5
taoufik109
LQ Newbie
 
Registered: Apr 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
I changed thisthe snmpd.conf as you said, and this is the result

[code][root@FEACS ~]# /usr/sbin/snmpd -c /etc/snmp/snmpd.conf
[root@FEACS ~]# service snmpd status
Redirecting to /bin/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 ven. 2016-04-08 08:32:56 WEST; 1min 4s ago
Process: 38185 ExecStart=/usr/sbin/snmpd $OPTIONS -f (code=exited, status=1/FAILURE)
Main PID: 38185 (code=exited, status=1/FAILURE)

avril 08 08:32:56 FEACS systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
avril 08 08:32:56 FEACS snmpd[38185]: /etc/snmp/snmpd.conf: line 2: Warning: Unknown token: 192.168.30.10.
avril 08 08:32:56 FEACS snmpd[38185]: Error opening specified endpoint ""
avril 08 08:32:56 FEACS snmpd[38185]: Server Exiting with code 1
avril 08 08:32:56 FEACS systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
avril 08 08:32:56 FEACS systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Daemon..
avril 08 08:32:56 FEACS systemd[1]: Unit snmpd.service entered failed state.
avril 08 08:32:56 FEACS systemd[1]: snmpd.service failed.
[root@FEACS ~]# [code]

[code][root@FEACS ~]# netstat -lupn | grep :161
udp 0 0 0.0.0.0:161 0.0.0.0:* 51703/../sbin/snmpd
[root@FEACS ~]#
[code]
 
Old 04-08-2016, 02:38 AM   #6
taoufik109
LQ Newbie
 
Registered: Apr 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
I changed thisthe snmpd.conf as you said, and this is the result

Code:
[root@FEACS ~]# /usr/sbin/snmpd -c /etc/snmp/snmpd.conf
[root@FEACS ~]# service snmpd status
Redirecting to /bin/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 ven. 2016-04-08 08:32:56 WEST; 1min 4s ago
  Process: 38185 ExecStart=/usr/sbin/snmpd $OPTIONS -f (code=exited, status=1/FAILURE)
 Main PID: 38185 (code=exited, status=1/FAILURE)

avril 08 08:32:56 FEACS systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
avril 08 08:32:56 FEACS snmpd[38185]: /etc/snmp/snmpd.conf: line 2: Warning: Unknown token: 192.168.30.10.
avril 08 08:32:56 FEACS snmpd[38185]: Error opening specified endpoint ""
avril 08 08:32:56 FEACS snmpd[38185]: Server Exiting with code 1
avril 08 08:32:56 FEACS systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
avril 08 08:32:56 FEACS systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Daemon..
avril 08 08:32:56 FEACS systemd[1]: Unit snmpd.service entered failed state.
avril 08 08:32:56 FEACS systemd[1]: snmpd.service failed.
[root@FEACS ~]#
Code:
[root@FEACS ~]# netstat -lupn | grep :161
udp        0      0 0.0.0.0:161             0.0.0.0:*                           51703/../sbin/snmpd 
[root@FEACS ~]#
 
Old 04-08-2016, 03:00 PM   #7
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by taoufik109;5528043[CODE
[root@FEACS ~]# netstat -lupn | grep :161
udp 0 0 0.0.0.0:161 0.0.0.0:* 51703/../sbin/snmpd
[root@FEACS ~]# [/CODE]
In other words, snmpd is already running and is bound to 0.0.0.0/UDP/161.

Seems the service is defined twice on your system, and you're actually trying to start the second instance which, of course, fails.
 
Old 04-11-2016, 08:01 AM   #8
taoufik109
LQ Newbie
 
Registered: Apr 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi,

So how can I start snmp correctly

Code:
[root@FEACS ~]# service snmpd status
Redirecting to /bin/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 lun. 2016-04-11 12:35:04 WEST; 4min 59s ago
  Process: 51556 ExecStart=/usr/sbin/snmpd $OPTIONS -f (code=exited, status=1/FAILURE)
 Main PID: 51556 (code=exited, status=1/FAILURE)

avril 11 12:35:04 FEACS systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
avril 11 12:35:04 FEACS snmpd[51556]: /etc/snmp/snmpd.conf: line 2: Warning: Unknown token: 192.168.30.10.
avril 11 12:35:04 FEACS snmpd[51556]: Error opening specified endpoint ""
avril 11 12:35:04 FEACS snmpd[51556]: Server Exiting with code 1
avril 11 12:35:04 FEACS systemd[1]: snmpd.service: main process exited, code=exited, status=1/FAILURE
avril 11 12:35:04 FEACS systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Daemon..
avril 11 12:35:04 FEACS systemd[1]: Unit snmpd.service entered failed state.
avril 11 12:35:04 FEACS systemd[1]: snmpd.service failed.
[root@FEACS ~]#
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
snmp service not start jaychoksi2003 Linux - General 6 11-06-2009 03:01 AM
How to disable snmp service on T3. UltraSoul Solaris / OpenSolaris 4 03-19-2007 02:48 AM
SNMP Service jmmo1981 Linux - Networking 2 02-19-2007 04:26 AM
SNMP Trap Broker service in Linux siddegok Linux - Software 3 04-06-2006 09:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration