Skip to content

dizz/sentinel_syslog_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nexus to Sentinel Syslog Agent

This agent runs and listens upon a UDP port for syslog messages. Those received messages are then converted into a format suitable for consumption by Sentinel. The agent can run stand alone, however it is typically transparently inserted into an application deployment by Nexus.

How to Run

In order to run you need an existing deployment of Sentinel. There is a basic docker-compose description under test/docker-compose.yml

Once Sentinel is available you will need to create a user (e.g. syslog_agent):

curl -v -X POST http://localhost:9100/v1/api/user/ --header "Content-Type: application/json" --header "x-auth-token: somevalue" -d '{"login":"syslog_agent", "password":"really?!"}'

You will then also need a space and its corresponding kafka topic. See the Sentinel documentation on this.

Now you can create the syslog agent container instance. Using the docker python library it can be ran in the following way (on the command line it's rather the same).

import docker
dockerclient = docker.DockerClient(base_url='unix://var/run/docker.sock')
dockerclient.containers.run(image=config.syslog_agent_sentinel_image, 
        labels={'creator': 'nexus'}, network='my_net', detach=True,
        environment=[
        "SENTINEL_SYSLOG_SPACE_NAME=A_SPACE",
        "SENTINEL_SYSLOG_TOPIC_NAME=A_TOPIC",
        "SENTINEL_AVAILABLE=False",
        "SENTINEL_API=http://localhost:9100",
        "SENTINEL_KAFKA_ENDPOINT=localhost:9092",
        "SENTINEL_SYSLOG_USERNAME=syslog_agent",
        "SENTINEL_SYSLOG_USER_API_KEY=XXX-YYY-ZZZ",
        "SENTINEL_SYSLOG_BIND_ADDR=0.0.0.0",
        "SENTINEL_SYSLOG_BIND_PORT=4243",
        ]
)

To see all configuration parameters (incl. defaults) see: src/config.py.

Image is available on docker hub.

About

This agent runs and listens upon a UDP port for syslog messages. Those received messages are then converted into a format suitable for consumption by Sentinel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors