[syslog-ng] slngctl: syslog-ng debug, trace and statistics utility

ILLES, Marton illes.marton at balabit.hu
Wed Jan 6 20:09:42 CET 2010


Hi,

PZolee wrote a quite lengthy blog post on troubleshooting and debuging
syslog-ng [1] 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 at octane:$ slngctl
Possible 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 at octane:$ slngctl stats
destination;d_out;;a;processed;0
global;payload_reallocs;;a;processed;0
source;s_tcp;;a;processed;0
global;msg_clones;;a;processed;0
global;sdata_updates;;a;processed;0
center;;received;a;processed;0
center;;queued;a;processed;0


Getting current verbose settings:

marci at octane:$ slngctl verbose
VERBOSE=1


Enabling trace run-time:

marci at octane:$ slngctl trace
TRACE=0
marci at octane:$ slngctl trace -s 1
marci at octane:$ slngctl trace
TRACE=1


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

best,

Marton

PS: I know slngctl might not be the best name, so I offer a bier to
anyone suggesting a better name when visiting us in Budapest,
Hungary. :)


[1]
http://pzolee.blogs.balabit.com/2009/12/troubleshooting-and-debugging-syslog-ng.html
-- 
Key fingerprint = F78C 25CA 5F88 6FAF EA21 779D 3279 9F9E 1155 670D



More information about the syslog-ng mailing list