All Projects → homeworkprod → Syslog2irc

homeworkprod / Syslog2irc

Licence: mit
Receive syslog messages via UDP and show them on IRC.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Syslog2irc

Sysadmin Util
Tools for Linux/Unix sysadmins.
Stars: ✭ 761 (+4973.33%)
Mutual labels:  sysadmin
Torpedo
Pluggable, multi-network asynchronous chat bot written in Go
Stars: ✭ 19 (+26.67%)
Mutual labels:  irc
Walkoff
A flexible, easy to use, automation framework allowing users to integrate their capabilities and devices to cut through the repetitive, tedious tasks slowing them down. #nsacyber
Stars: ✭ 855 (+5600%)
Mutual labels:  sysadmin
Convos
Convos 👥 is the simplest way to use IRC in your browser
Stars: ✭ 789 (+5160%)
Mutual labels:  irc
Sopel
🤖💬 An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
Stars: ✭ 894 (+5860%)
Mutual labels:  irc
Raftman
A syslog server with integrated full text search via a JSON API and Web UI
Stars: ✭ 26 (+73.33%)
Mutual labels:  syslog
Ekanite
The Syslog server with built-in search
Stars: ✭ 729 (+4760%)
Mutual labels:  syslog
Juno
a seriously modern IRC daemon written from scratch in Perl. designed to be ridiculously extensible, painlessly reloadable, and excessively configurable
Stars: ✭ 12 (-20%)
Mutual labels:  irc
Irclogger
A Perl/PHP tool to log an IRC channel and make it searchable on the Web
Stars: ✭ 18 (+20%)
Mutual labels:  irc
Warren
🐇 Kotlin/JVM, tested, IRC v3.2 client state management and observing
Stars: ✭ 8 (-46.67%)
Mutual labels:  irc
Demo Scene
👾Scripts and samples to support Confluent Demos and Talks. ⚠️Might be rough around the edges ;-) 👉For automated tutorials and QA'd code, see https://github.com/confluentinc/examples/
Stars: ✭ 806 (+5273.33%)
Mutual labels:  syslog
Euircbot
A featureful nodejs irc bot
Stars: ✭ 16 (+6.67%)
Mutual labels:  irc
Irc Colors.js
Color and formatting for irc bots made easy. Inspired by colors.js and cli-color.
Stars: ✭ 26 (+73.33%)
Mutual labels:  irc
Webhook
webhook is a lightweight incoming webhook server to run shell commands
Stars: ✭ 7,201 (+47906.67%)
Mutual labels:  sysadmin
Inspircd
A modular C++ IRC server (ircd).
Stars: ✭ 867 (+5680%)
Mutual labels:  irc
Debops
DebOps - Your Debian-based data center in a box
Stars: ✭ 734 (+4793.33%)
Mutual labels:  sysadmin
Irackbot
Bridge between Slack and IRC channels allowing message filtering and logging while keeping communication public
Stars: ✭ 25 (+66.67%)
Mutual labels:  irc
Bash Toolkit
Este proyecto esá destinado a ayudar a los sysadmin
Stars: ✭ 13 (-13.33%)
Mutual labels:  sysadmin
Zonkeynet
RADIO Mesh Network
Stars: ✭ 12 (-20%)
Mutual labels:  irc
Charla
A IRC Server / Daemon written in Python using the circuits Application Framework.
Stars: ✭ 8 (-46.67%)
Mutual labels:  irc

syslog2IRC

Receive syslog messages via UDP and show them on IRC.

Requirements

  • Python 2.7+ or 3.3+
  • irc_
  • blinker_
  • syslogmp_

Installation

The required packages can be installed via pip_:

.. code:: sh

$ pip install -r requirements.txt

Tests

To run the tests:

.. code:: sh

$ python setup.py test

Configuration

Setup your syslog.conf or rsyslog.conf (commonly found in /etc) to send syslog messages to syslog2IRC on the default syslog port (514, UDP, as assigned by IANA_)::

*.*     @host-to-send-log-messages-to-and-this-script-runs-on

Or, when syslog2IRC listens on a non-default port (here: 11514)::

*.*     @host-to-send-log-messages-to-and-this-script-runs-on:11514

To specify which IRC channels to join and forward syslog messages to, create Channel instances and reference them in the routes mapping.

A simple routing from the default syslog port, 514, to a single IRC channel without a password looks like this:

.. code:: python

channel1 = Channel('#examplechannel1')

routes = {
    514: [channel1],
}

In a more complex setup, syslog messages could be received on two ports (514 and 55514), with those received on the first port being forwarded to two IRC channels, and those received on the letter port being forwarded exclusively to the second channel.

.. code:: python

channel1 = Channel('#examplechannel1')
channel2 = Channel('#examplechannel2', password='zePassword')

routes = {
      514: [channel1, channel2],
    55514: [channel2],
}

For convenience, for example while testing, the bot can be configured to shut down if a certain text is sent to it as a private message. Just provide a callable that accepts nickmask and text as positional arguments and returns a boolean value.

.. code:: python

def is_shutdown_requested(nickmask, text):
    """Determine if this is a valid shutdown request."""
    return text == 'shutdown!'

start_with_args(routes, shutdown_predicate=is_shutdown_requested)

Be aware that checking against nickmask and text is not very secure as they can be faked and guessed, respectively. You might not want to enable this in a production environment.

Usage

You might want to familiarize yourself with the available command line options first:

.. code:: sh

$ python start-syslog2irc.py -h

If no options are given, the IRC component will not be used. Instead, syslog messages will be written to STDOUT. This is helpful during setup of syslog message reception. Abort execution by pressing .

.. code:: sh

$ python start-syslog2irc.py

Send some messages to syslog2IRC using your system's syslog message sender tool (logger, in this example):

.. code:: sh

$ logger 'Hi there!'
$ logger -p kern.alert 'Whoa!'

Note that each message will appear twice on the console syslog2IRC was started because the handler itself will write it there anyway (so you have a log on what would be sent to IRC).

If receiving syslog messages works, connect to an IRC server:

.. code:: sh

$ python start-syslog2irc.py --irc-server irc.example.com

After a moment, you should see that syslog2IRC has connected to the server. The IRC bot should then enter the channel(s) you have configured (see Configuration_).

To use another port on the IRC server than the default (6667), specify it like this (6669 in this case):

.. code:: sh

$ python start-syslog2irc.py --irc-server irc.example.com:6669

In order to shut down syslog2IRC, send a query message with the text "shutdown!" to the IRC bot. It should then quit, and syslog2IRC should exit.

Further Reading

For more information, see RFC 3164_, "The BSD syslog Protocol".

Please note that there is RFC 5424, "The Syslog Protocol", which obsoletes RFC 3164. syslog2IRC, however, only implements the latter.

.. _irc: https://bitbucket.org/jaraco/irc .. _blinker: http://pythonhosted.org/blinker/ .. _syslogmp: http://homework.nwsnet.de/releases/76d6/#syslogmp .. _pip: http://www.pip-installer.org/ .. _IANA: http://www.iana.org/ .. _RFC 3164: http://tools.ietf.org/html/rfc3164 .. _RFC 5424: http://tools.ietf.org/html/rfc5424

:Copyright: 2007-2015 Jochen Kupperschmidt <http://homework.nwsnet.de/>_ :Date: 09-Sep-2015 :License: MIT, see LICENSE for details. :Version: 0.9.2-dev

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].