View | Details | Raw Unified | Return to bug 195689
Collapse All | Expand All

(-)plugins/node.d/bind9_rndc.in (-16 / +10 lines)
Lines 63-68 Link Here
63
my $rndc = defined($ENV{rndc}) ? $ENV{rndc} : '/usr/sbin/rndc';
63
my $rndc = defined($ENV{rndc}) ? $ENV{rndc} : '/usr/sbin/rndc';
64
my $querystats = $ENV{querystats} || '/var/run/named.stats';
64
my $querystats = $ENV{querystats} || '/var/run/named.stats';
65
my %IN;
65
my %IN;
66
my @IN_KEYS;
66
67
67
# attempt to create log file if it doesn't exist
68
# attempt to create log file if it doesn't exist
68
if ( ! -r $querystats ) {
69
if ( ! -r $querystats ) {
Lines 124-143 Link Here
124
if ($line eq '++ Incoming Requests ++') {
125
if ($line eq '++ Incoming Requests ++') {
125
    # new format
126
    # new format
126
127
127
    %IN = (
128
    @IN_KEYS = ('requests', 'responses', 'success', 'auth_answer',
128
           requests => 0,
129
                'nonauth_answer', 'nxrrset', 'failure', 'nxdomain',
129
           responses => 0,
130
                'recursion', 'duplicates', 'transfers', 'rejections');
130
           success => 0,
131
    %IN = ();
131
           auth_answer => 0,
132
    for my $key (@IN_KEYS) {
132
           nonauth_answer => 0,
133
        $IN{$key} = 0;
133
           nxrrset => 0,
134
    }
134
           failure => 0,
135
           nxdomain => 0,
136
           recursion => 0,
137
           duplicates => 0,
138
           transfers => 0,
139
           rejections => 0,
140
          );
141
135
142
    # jump to server stats section
136
    # jump to server stats section
143
    while ($line ne '++ Name Server Statistics ++') {
137
    while ($line ne '++ Name Server Statistics ++') {
Lines 197-207 Link Here
197
    print "graph_vlabel queries / \${graph_period}\n";
191
    print "graph_vlabel queries / \${graph_period}\n";
198
    print "graph_category BIND\n";
192
    print "graph_category BIND\n";
199
193
200
    for my $key (keys %IN) {
194
    for my $key (@IN_KEYS) {
201
        print "query_$key.label $key\n";
195
        print "query_$key.label $key\n";
202
        print "query_$key.type DERIVE\n";
196
        print "query_$key.type DERIVE\n";
203
        print "query_$key.min 0\n";
197
        print "query_$key.min 0\n";
204
    }
198
    }
205
} else {
199
} else {
206
    print "query_$_.value $IN{$_}\n" for keys %IN;
200
    print "query_$_.value $IN{$_}\n" for @IN_KEYS;
207
}
201
}

Return to bug 195689