Hi,

it is quite easy, all that syslog-ng-ctl does is that it writes "STATS\n" into the syslog-ng control socket and displays the result. I'm not familiar with ruby, but I assume that basic Unix domain socket read/write is not that hard to do with it. With the use of netcat you can check that

root@lyra:~# nc -U /var/lib/syslog-ng/syslog-ng.ctl
STATS
SourceName;SourceId;SourceInstance;State;Type;Number
center;;received;a;processed;0
destination;d_messages;;a;processed;751
src.internal;s_src#2;;a;processed;9
src.internal;s_src#2;;a;stamp;1357639178
destination;d_console_all;;a;processed;553
center;;queued;a;processed;0
destination;d_console;;a;processed;56
destination;d_xconsole;;a;processed;553
global;payload_reallocs;;a;processed;424
global;sdata_updates;;a;processed;0
global;msg_clones;;a;processed;0
source;s_src;;a;processed;7666
.
^C

Balint

Hello there,
we are plotting and monitoring lot of data and for this I'm using a little bash script which does sum up the output of syslog-ng-ctl. But this is kind of slow with 17k lines to parse :P
Is there a way to get the stats directly without syslog-ng-ctl? My goal is to write a ruby script which only parse the stats i'm needing. 

I'm no developer so please answer admin friendly :)


______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq