Introduction

This is a sample python multicast program that is very simple and can be adapted for any task that requires forwarding lines of text to one or more parties.

Usage

To forward system log via multicast to group 239.31.33.7 at port 31337:

tail -f /var/log/messages | logcaster 239.31.33.7 31337

On the client side, to receive the above log file:

logrecv 239.31.33.7 31337 > /var/log/remote_messages

Caveats

It assumes that the default network device is 'eth0'. This will not be true for other systems (eg. BSD) or even your own Linux machine. Edit logcaster.py to reflect the right device name.

If the machine you run on doesn't resolve to a proper IP address for it's hostname, then this script will fail.

Download

logcaster-0.1.tar.gz (07 May 2005) Initial Release


You can reply to me about this on Twitter: