Telegraf: Error running agent: listen udp4 :6343: bind: address already in use

Hello,
I am using
telegraf -version
Telegraf 1.14.3 (git: HEAD 1b35d6c2)
I have enabled

[[inputs.sflow]]

Address to listen for sFlow packets.

example: service_address = “udp://:6343”

service_address = “udp4://:6343”

service_address = “udp6://:6343”

service_address = “udp4://:6343”

[root]#telegraf

2020-06-06T09:07:14Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“telegraf”, Flush Interval:10s
2020-06-06T09:07:14Z E! [agent] Service for [inputs.sflow] failed to start: listen udp4 :6343: bind: address already in use
2020-06-06T09:07:14Z E! [telegraf] Error running agent: listen udp4 :6343: bind: address already in use

There is only one service running and port is used by telegraf
tcp6 0 0 :::80 :::* LISTEN 679/httpd
tcp6 0 0 :::8086 :::* LISTEN 961/influxd
tcp6 0 0 :::22 :::* LISTEN 678/sshd
tcp6 0 0 :::8888 :::* LISTEN 680/chronograf
tcp6 0 0 :::3000 :::* LISTEN 681/grafana-server
udp 0 0 0.0.0.0:6343 0.0.0.0:* 14140/telegraf

[root]# ps aux | grep telegraf
telegraf 14140 2.1 0.5 603728 30204 ? Ssl 11:04 0:00 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d
root 14170 0.0 0.0 9092 672 pts/0 S+ 11:04 0:00 grep --color=auto telegraf

When I try to start it gives error. Any idea?

Hello @magicman999,
That is weird. Are you able to use other telegraf plugins successfully?

Yes other plugin works fine when I disable inputs.sflow.
There is no other program using the port and I am not able to understand how come port used by telegraf is giving error.

I’m not an expert of sflow and Linux systems, but to me the error just looks like an occupied port, so there should be another program using it.

Just have a look about how to list all the used ports on your system and see what is using it.
You can then change your settings accordingly (which program should use that port?)

If you see
udp 0 0 0.0.0.0:6343 0.0.0.0:* 14140/telegraf
Port is already in use by Telegraf :smiley::partying_face: