Sysop:Munin

Aus immerda
Zur Navigation springen Zur Suche springen

Links

Apropos Compilation

error in 1.2.4

you have to apply the following patch:

plugins

selinux_enforced

#!/bin/sh
# -*- sh -*-
#
# Plugin to get the state of /selinux/enforced
#

if [ "$1" = "autoconf" ]; then
        echo yes
        exit 0
fi

if [ "$1" = "config" ]; then
        echo 'graph_title enforced amount'
        echo 'graph_args --upper-limit 1 -l 0 '
        echo 'graph_vlabel Is the system selinux enforced?'
        echo 'graph_scale no\n';
        echo 'graph_category selinux'
                echo 'enforced.label IsEnforced'
        #echo 'enforced.draw AREA'
                echo 'enforced.draw LINE2'

        exit 0
fi

echo -n "enforced.value " && cat /selinux/enforce

tinydns

#!/usr/bin/perl -wT

#
# tinydns-munin-plugin
# Copyright (C) 2007 admin at immerda.ch
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# with the HELP of
# tinygraph -- a RRDtool frontend for tinydns statistics
# Copyright (C) 2005    Ulrich Zehl <ulrich@topfen.net>

#use strict;  # to activate ....

$A = 0;
$NS = 0;
$CNAME = 0;
$SOA = 0;
$PTR = 0;
$HINFO = 0;
$MX = 0;
$TXT = 0;
$RP = 0;
$SIG = 0;
$KEY = 0;
$AAAA = 0;
$A6 = 0;
$IXFR = 0;
$AXFR = 0;
$ANY = 0;

$logfile = $ENV{logdir} || "/var/tinydns/log/main/current";

if ( $ARGV[0] and $ARGV[0] eq "config" )
{
    print "host_name $ENV{FQDN}\n";
    print "graph_title tinydns\n";
    print "graph_args --base 1000 -l 0\n";
    print "graph_category DNS\n";
    exit 0;
}

my %querytypes = (
        '0001' => 'A',
        '0002' => 'NS',
        '0005' => 'CNAME',
        '0006' => 'SOA',
        '000c' => 'PTR',
        '000d' => 'HINFO',
        '000f' => 'MX',
        '0010' => 'TXT',
        '0011' => 'RP',
        '0018' => 'SIG',
        '0019' => 'KEY',
        '001c' => 'AAAA',
        '0026' => 'A6',
        '00fb' => 'IXFR',
        '00fc' => 'AXFR',
        '00ff' => 'ANY',
);

sub process_line($)
{
        my $line = shift;
        if ($line =~ /^(@[a-f0-9]{24}) ([a-f0-9]{8}):[a-f0-9]{4}:[a-f0-9]{4} ([\+\-IC\/]) ([a-f0-9]{4}) (.+)$/)
        {
                #my $time    = tai2unix($1);
                my $ip      = join(".", unpack("C*", pack("H8", $2)));
                my $rtype   = $3;
                my $qtype   = $querytypes{$4};
                #my $qstring = $5; # currently unused

                if ($rtype eq '+')
                {
                         if ($qtype eq 'A'){$A++;};
                         if ($qtype eq 'NS'){$NS++;};
                         if ($qtype eq 'CNAME'){$CNAME++;};
                         if ($qtype eq 'SOA'){$SOA++;};
                         if ($qtype eq 'PTR'){$PTR++;};
                         if ($qtype eq 'HINFO'){$HINFO++;};
                         if ($qtype eq 'MX'){$MX++;};
                         if ($qtype eq 'TXT'){$TXT++;};
                         if ($qtype eq 'RP'){$RP++;};
                         if ($qtype eq 'SIG'){$SIG++;};
                         if ($qtype eq 'KEY'){$KEY++;};
                         if ($qtype eq 'AAAA'){$AAAA++;};
                         if ($qtype eq 'A6'){$A6++;};
                         if ($qtype eq 'IXFR'){$IXFR++;};
                         if ($qtype eq 'AXFR'){$AXFR++;};
                         if ($qtype eq 'ANY'){$ANY++;};
                }
        }
}

open(LOG, "<$logfile") or die "Error opening $logfile: $!";

while (<LOG>)
{
                        process_line($_);
}

print "A.value $A\n";
print "NS.value $NS\n";
print "CNAME.value $CNAME\n";
print "SOA.value $SOA\n";
print "PTR.value $PTR\n";
print "MX.value $MX\n";
print "AAAA.value $AAAA\n";
print "ANY.value $ANY\n";
print "HINFO.value $HINFO\n";
print "TXT.value $TXT\n";
print "RP.value $RP\n";
print "SIG.value $SIG\n";
print "KEY.value $KEY\n";
print "A6.value $A6\n";
print "IXFR.value $IXFR\n";
print "AXFR.value $AXFR\n";