[cricket-users] cricket for innd news

From: Jost Krieger (Jost.Krieger+onelist@ruhr-uni-bochum.de)
Date: Wed May 26 1999 - 08:15:37 PDT


From: Jost Krieger <Jost.Krieger+onelist@ruhr-uni-bochum.de>

In case you are running one (or more) news servers with INND and cleanfeed,
you could use the attached configuration.

Here's cricket-config/news-server/Defaults:

target --default--
        # you'll probably want to change this... unless you
        # have Cricket in ~/cricket and your config tree in ~/config
        util-dir = %auto-base%/../cricket/util
        remexec = "/usr/local/net/bin/ssh -l %user% %server%"
        target-type = news-server

datasource pass
        ds-source = "exec:0:%remexec% bin/ctlinnd mode | %util-dir%/newsstats"
        desc = "Number of articles that passed the filter."
        rrd-ds-type = COUNTER

datasource reject
        ds-source = "exec:1:%remexec% bin/ctlinnd mode | %util-dir%/newsstats"
        desc = "Number of articles rejected by the filter."
        rrd-ds-type = COUNTER

datasource refuse
        ds-source = "exec:2:%remexec% bin/ctlinnd mode | %util-dir%/newsstats"
        desc = "Number of articles refused."
        rrd-ds-type = COUNTER

targetType news-server
        ds = "pass, reject, refuse"

graph --default--
        y-axis = "# of articles"
        units = art.
        # cut off spikes above 5 seconds
        y-max = 30

graph pass
        legend = "Passed"
        draw-as = AREA

graph reject
        legend = "Reject"
        draw-as = LINE1

graph refuse
        legend = "Refuse"
        draw-as = LINE1

Here's cricket-config/news-server/news:

target news
        server = news
        user = news

and here's cricket/util/newsstats:

#!/usr/local/bin/perl

##
# Get simple stats from INND with cleanfeed
# expects output crom "ctlinnd mode" on STDIN
#
# Author: Jost Krieger <Jost.Krieger@ruhr-uni-bochum.de>
# Revision: $Revision: 1.1 $
##

use strict;

my ($passed, $reject, $refuse);

while (<>)
{
# print STDERR $_;
        if (/Perl filter stats/) {
                /Pass: (\d+)/ and $passed=$1;
                /Reject: (\d+)/ and $reject=$1;
                /Refuse: (\d+)/ and $refuse=$1;
        }
}

print "$passed\n$reject\n$refuse\n";

-- 
| Jost.Krieger@ruhr-uni-bochum.de      Please help stamp out spam! |
| Postmaster, JAPH, resident answer machine          am RZ der RUB |
| non sunt multiplicanda entia praeter necessitatem                |
|                                 William of Ockham (1285-1347/49) |

------------------------------------------------------------------------ Looking to expand your world? http://www.onelist.com ONElist has over 150,000 e-mail communities from which to chose!



This archive was generated by hypermail 2b29 : Mon Mar 06 2000 - 19:00:51 PST