0

I have two systems. One is a laptop and has rsyslog. The other is embedded system that doesn't have rsyslog. What I'd like to do is log messages from the embedded system on the laptop.

I've configured the laptop /etc/rsyslog.conf to listen on TCP port 10514:

netstat -nlp | grep 10514
tcp        0      0 0.0.0.0:10514               0.0.0.0:*                   LISTEN      30280/rsyslogd      
tcp        0      0 :::10514                    :::*                        LISTEN      30280/rsyslogd

On the embedded system I'm sending, a test message with netcat:

[172.17.0.33: ]# echo "Test Message 1" | nc -w2 -p 10514 172.17.0.16
nc: can't connect to remote host (172.17.0.16): Connection refused

Is rsyslog expecting anything special in the packet? Does it require both systems to have rsyslog? Any other reason I'd get "Connection refused"?

Daniel t.
  • 9,291
  • 1
  • 33
  • 36
user800133
  • 35
  • 6

2 Answers2

2

Did you open inbound TCP port 10514 in the rsyslog server's firewall? You have to do that if you want to receive incoming connections.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Thanks for the quick reply. Yes, I believe the firewall is completely disabled: chkconfig --list | grep iptables iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off – user800133 Feb 07 '13 at 23:24
  • chkconfig means it won't start on boot. It does not mean it's not running (although it wont be unless you accidentally started it, or disabled it after booting when it was actually enabled on boot). – Sirex Feb 07 '13 at 23:31
  • Yes, I've rebooted since then, but just as precaution I did /etc/init.d/iptables stop and am still getting "Connection refused". – user800133 Feb 07 '13 at 23:39
1

Shouldn't your nc command specify the destination port rather than the source port (-p). It seems you need to execute the command as below:

echo "Test Message 1" | nc -w2  172.17.0.16 10514
Daniel t.
  • 9,291
  • 1
  • 33
  • 36