Get rsyslog forwarding messages after remote server restart

gmsharky

I have syslog successfully forwarding logs to an upstream server like so:

$MainMsgQueyeType LinkedList
$MainMsgQueueSize 10000
$MainMsgQueusDiscardMark 8000
$MainMsgQueueDiscardSeverity 1
$MainMsgQueueSaveOnShutdown off
$MainMsgQueueTimeoutEnqueue 0

$ActionQueueType LinkedList    # in memory queue
$ActionQueueFileName fwdRule1  # unique name prefix for spool files
$ActionQueueSize 10000         # Only allow 10000 elements in the queue
$ActionQueueDiscardMark 8000   # Only allow 8000 elements in the queue before dropping msgs
$ActionQueueDiscardSeverity 1  # Discard Alert,Critical,Error,Warning,Notice,Info,Debug, NOT Emergency
$ActionQueueSaveOnShutdown off # save messages to disk on shutdown
$ActionQueueTimeoutEnqueue 0
$ActionResumeRetryCount -1     # infinite retries if host is down

$RepeatedMsgReduction off

*.* @@remoteserver.mynetwork.com:5544

On the remoteserver I have something that talks syslog and listens on that port. To test, I have a simple log client that logs 100 messages a second to syslog.

This all works fine, and I have configured the queues above so that in the event that the remoteserver is unavailable, the queues start filling up, and then eventually messages get discarded, thus safeguarding syslog from blocking its logging clients.

When I stop the remote log sink on remoteserver:5544, syslog is still stable (queues filling up / full up), but when I restart the remote log sink a while later, rsyslog detects the server again, reestablishes a TCP connection

HOWEVER - syslog only forwards 1 message to it, despite the queue having many thousands of messages in it, and the logging client continuing to log 100 messages a second

How can I make syslog start forwarding messages again once it has detected the remoteserver is back up? (Without restarting syslog).

Am using rsyslog 4.6.2-2

I am using, and want to use TCP

gmsharky

The problem in case anybody comes across this was that workdirectory was set to:

$WorkDirectory /var/spool/rsyslog  

And the above config, does this:

$ActionQueueFileName fwdRule1

Even though its supposed to be an in-memory queue. Because of this, when the queue reached 800 (bizarrely, not 8000), disk-assisted mode was activated, and syslog attempted to write messages to /var/spool/rsyslog. This directory didn't exist . Randomly, (hence a race condition must exist and a bug in rsyslog), after continually trying to open a queue file on the disk in that directory, rsyslog got into a twisted state and gave up and continued queueing messages, until it hit the high 10,000 mark. Restarting the downstream logserver failed to make it recover.

Taking out all references to ActionQueueFileName and making WorkDirectory exist fixed this issue.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to retain blockdev changes after server restart?

From Java

Minecraft Server restart after action

From Dev

HttpSession remains after server restart

From Dev

Vagrant forwarding ssh from remote server

From Dev

Get rsyslog forwarding messages after remote server restart

From Dev

MSMQ messages disappear when they get to remote server

From Dev

Akka.Remote - cannot send messages to remote actor after dissassociation

From Dev

Can iBeacon communicate with a remote server for publishing messages

From Dev

rsyslog filtering and forwarding

From Dev

Rsyslog not forwarding specific log file to remote server

From Dev

Rsyslog not forwarding specific log file to remote server

From Dev

rsyslog server template consideration for multiple remote hosts

From Dev

Suppress duplicate messages in rsyslog?

From Dev

Chef recipe to restart rsyslog

From Dev

Using ssh key forwarding from a Vagrant box to a remote server

From Dev

Why is syslogd not reporting messages to remote server during and just after the boot?

From Dev

rsyslog not forwarding messages to remote rsyslog server

From Dev

Syslog forwarding to Rsyslog

From Dev

ejabberd - persistent MUC messages on server restart

From Dev

Remote port forwarding through a jump server

From Dev

rsyslog conditional forwarding for remote logs

From Dev

rsyslog conditional forwarding for remote logs de-formatting the date and time in the log file

From Dev

rsyslog drops messages excessively

From Dev

Port forwarding - How to connect to remote postgresql server - No public IP

From Dev

configure rsyslog server to log incomming messages with time of the rsyslog server

From Dev

SSRS-2016 get HTTP Error 503 after server restart

From Dev

How to replace timestamp of messages received on an rsyslog server with a local timestamp?

From Dev

Forwarding Data From rsyslog

From Dev

Better way to dispatch messages to remote server

Related Related

  1. 1

    How to retain blockdev changes after server restart?

  2. 2

    Minecraft Server restart after action

  3. 3

    HttpSession remains after server restart

  4. 4

    Vagrant forwarding ssh from remote server

  5. 5

    Get rsyslog forwarding messages after remote server restart

  6. 6

    MSMQ messages disappear when they get to remote server

  7. 7

    Akka.Remote - cannot send messages to remote actor after dissassociation

  8. 8

    Can iBeacon communicate with a remote server for publishing messages

  9. 9

    rsyslog filtering and forwarding

  10. 10

    Rsyslog not forwarding specific log file to remote server

  11. 11

    Rsyslog not forwarding specific log file to remote server

  12. 12

    rsyslog server template consideration for multiple remote hosts

  13. 13

    Suppress duplicate messages in rsyslog?

  14. 14

    Chef recipe to restart rsyslog

  15. 15

    Using ssh key forwarding from a Vagrant box to a remote server

  16. 16

    Why is syslogd not reporting messages to remote server during and just after the boot?

  17. 17

    rsyslog not forwarding messages to remote rsyslog server

  18. 18

    Syslog forwarding to Rsyslog

  19. 19

    ejabberd - persistent MUC messages on server restart

  20. 20

    Remote port forwarding through a jump server

  21. 21

    rsyslog conditional forwarding for remote logs

  22. 22

    rsyslog conditional forwarding for remote logs de-formatting the date and time in the log file

  23. 23

    rsyslog drops messages excessively

  24. 24

    Port forwarding - How to connect to remote postgresql server - No public IP

  25. 25

    configure rsyslog server to log incomming messages with time of the rsyslog server

  26. 26

    SSRS-2016 get HTTP Error 503 after server restart

  27. 27

    How to replace timestamp of messages received on an rsyslog server with a local timestamp?

  28. 28

    Forwarding Data From rsyslog

  29. 29

    Better way to dispatch messages to remote server

HotTag

Archive