GUARDING YOUR BUSINESS

slngctl: syslog-ng debug, trace and statistics utility

Wednesday, January 6, 2010 @ 07:01 PM Author: Márton Illés

PZolee wrote a quite lengthy blog post on troubleshooting and debuging syslog-ng back in December 2009. It popped into my mind that running syslog-ng with debug/trace/verbose option enabled is very handy, but sometimes you do not want to stop syslog-ng just to restart it in a more verbose mode. My idea was to enable syslog-ng to real-time modify these verbosity settings through the control socket which is currently only used for exporting statistical information.

I extended the control socket communication to have the ability of modify these logging settings. To make life easier I have created a small utility called slngctl which can be used to communicate with the running syslog-ng process. Using slngctl it also easy to query the statistics collected by syslog-ng. Also on longer term I think other useful small features could be added the slngctl.

slngctl commands:

marci@octane:$ slngctlPossible commands are:    stats        Dump syslog-ng statistics    verbose      Enable/query verbose messages    debug        Enable/query debug messages    trace        Enable/query trace messages

Querying statistics:

marci@octane:$ slngctl statsdestination;d_out;;a;processed;0global;payload_reallocs;;a;processed;0source;s_tcp;;a;processed;0global;msg_clones;;a;processed;0global;sdata_updates;;a;processed;0center;;received;a;processed;0center;;queued;a;processed;0

Getting current verbose settings:

marci@octane:$ slngctl verboseVERBOSE=1

Enabling trace run-time:

marci@octane:$ slngctl traceTRACE=0marci@octane:$ slngctl trace -s 1marci@octane:$ slngctl traceTRACE=1

As always you can find the source code in my 3.1 git repository and all feedbacks are very welcome.

2 Responses to “slngctl: syslog-ng debug, trace and statistics utility”

  1. Marton Illes says:

    Sure, actually Bazsi integrated the patch and called it syslog-ng-ctl…

  2. Would it be possible to call it syslog-ng-ctl, or something more intuitive? Just to make life a bit easier :)


Leave a Reply

You must be logged in to post a comment.