enh(plugin)apps-pfsense-snmp metricsv2 (#2495)
This commit is contained in:
parent
fbc3f0f11a
commit
c2056a7a26
|
@ -32,9 +32,8 @@ sub new {
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
'filter-name:s' => { name => 'filter_name' }
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
|
||||||
});
|
});
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,39 +34,39 @@ sub set_counters {
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
{ label => 'match', set => {
|
{ label => 'match', nlabel => 'packets.matched.persecond', set => {
|
||||||
key_values => [ { name => 'pfCounterMatch', per_second => 1 } ],
|
key_values => [ { name => 'pfCounterMatch', per_second => 1 } ],
|
||||||
output_template => 'Packets Matched Filter Rule : %.2f/s',
|
output_template => 'Packets Matched Filter Rule : %.2f/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'match', template => '%.2f', unit => '/s', min => 0 },
|
{ label => 'match', template => '%.2f', unit => '/s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'badoffset', set => {
|
{ label => 'badoffset', nlabel => 'packets.badoffset.persecond', set => {
|
||||||
key_values => [ { name => 'pfCounterBadOffset', per_second => 1 } ],
|
key_values => [ { name => 'pfCounterBadOffset', per_second => 1 } ],
|
||||||
output_template => 'Bad Offset Packets : %.2f/s',
|
output_template => 'Bad Offset Packets : %.2f/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'bad_offset', template => '%.2f', unit => '/s', min => 0 },
|
{ label => 'bad_offset', template => '%.2f', unit => '/s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'fragment', set => {
|
{ label => 'fragment', nlabel => 'packets.fragmented.persecond', set => {
|
||||||
key_values => [ { name => 'pfCounterFragment', per_second => 1 } ],
|
key_values => [ { name => 'pfCounterFragment', per_second => 1 } ],
|
||||||
output_template => 'Fragmented Packets : %.2f/s',
|
output_template => 'Fragmented Packets : %.2f/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'fragment', template => '%.2f', unit => '/s', min => 0 },
|
{ label => 'fragment', template => '%.2f', unit => '/s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'short', set => {
|
{ label => 'short', nlabem => 'packets.short.persecond', set => {
|
||||||
key_values => [ { name => 'pfCounterShort', per_second => 1 } ],
|
key_values => [ { name => 'pfCounterShort', per_second => 1 } ],
|
||||||
output_template => 'Short Packets : %.2f/s',
|
output_template => 'Short Packets : %.2f/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'short', template => '%.2f', unit => '/s', min => 0 },
|
{ label => 'short', template => '%.2f', unit => '/s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'normalize', set => {
|
{ label => 'normalize', nlabel => 'packets.normalized.persecond',set => {
|
||||||
key_values => [ { name => 'pfCounterNormalize', per_second => 1 } ],
|
key_values => [ { name => 'pfCounterNormalize', per_second => 1 } ],
|
||||||
output_template => 'Normalized Packets : %.2f/s',
|
output_template => 'Normalized Packets : %.2f/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
|
@ -74,14 +74,14 @@ sub set_counters {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'memdrop', set => {
|
{ label => 'memdrop', nlabel => 'packets.memorydropped.persecond',set => {
|
||||||
key_values => [ { name => 'pfCounterMemDrop', per_second => 1 } ],
|
key_values => [ { name => 'pfCounterMemDrop', per_second => 1 } ],
|
||||||
output_template => 'Dropped Packets Due To Memory : %.2f/s',
|
output_template => 'Dropped Packets Due To Memory : %.2f/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'memdrop', template => '%.2f', unit => '/s', min => 0 },
|
{ label => 'memdrop', template => '%.2f', unit => '/s', min => 0 }
|
||||||
],
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,46 +34,46 @@ sub set_counters {
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{pfint} = [
|
$self->{maps_counters}->{pfint} = [
|
||||||
{ label => 'traffic-in-pass', set => {
|
{ label => 'traffic-in-pass', nlabel => 'pass.traffic.in.bitspersecond', set => {
|
||||||
key_values => [ { name => 'pfInterfacesIf4BytesInPass', per_second => 1 }, { name => 'display' } ],
|
key_values => [ { name => 'pfInterfacesIf4BytesInPass', per_second => 1 }, { name => 'display' } ],
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
output_template => 'Traffic In Pass : %s %s/s',
|
output_template => 'Traffic In Pass : %s %s/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'traffic_in_pass', template => '%.2f',
|
{ label => 'traffic_in_pass', template => '%.2f',
|
||||||
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' },
|
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'traffic-out-pass', set => {
|
{ label => 'traffic-out-pass', nlabel => 'pass.traffic.out.bitspersecond', set => {
|
||||||
key_values => [ { name => 'pfInterfacesIf4BytesOutPass', per_second => 1 }, { name => 'display' } ],
|
key_values => [ { name => 'pfInterfacesIf4BytesOutPass', per_second => 1 }, { name => 'display' } ],
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
output_template => 'Traffic Out Pass : %s %s/s',
|
output_template => 'Traffic Out Pass : %s %s/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'traffic_out_pass', template => '%.2f',
|
{ label => 'traffic_out_pass', template => '%.2f',
|
||||||
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' },
|
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'traffic-in-block', set => {
|
{ label => 'traffic-in-block', nlabel => 'block.traffic.in.bitspersecond', set => {
|
||||||
key_values => [ { name => 'pfInterfacesIf4BytesInBlock', per_second => 1 }, { name => 'display' } ],
|
key_values => [ { name => 'pfInterfacesIf4BytesInBlock', per_second => 1 }, { name => 'display' } ],
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
output_template => 'Traffic In Block : %s %s/s',
|
output_template => 'Traffic In Block : %s %s/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'traffic_in_block', template => '%.2f',
|
{ label => 'traffic_in_block', template => '%.2f',
|
||||||
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' },
|
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'traffic-out-block', set => {
|
{ label => 'traffic-out-block', nlabel => 'block.traffic.out.bitspersecond', set => {
|
||||||
key_values => [ { name => 'pfInterfacesIf4BytesOutBlock', per_second => 1 }, { name => 'display' } ],
|
key_values => [ { name => 'pfInterfacesIf4BytesOutBlock', per_second => 1 }, { name => 'display' } ],
|
||||||
output_change_bytes => 2,
|
output_change_bytes => 2,
|
||||||
output_template => 'Traffic Out Block : %s %s/s',
|
output_template => 'Traffic Out Block : %s %s/s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'traffic_out_block', template => '%.2f',
|
{ label => 'traffic_out_block', template => '%.2f',
|
||||||
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' },
|
min => 0, unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
|
||||||
],
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,12 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'list-pfinterfaces' => 'apps::pfsense::snmp::mode::listpfinterfaces',
|
'list-pfinterfaces' => 'apps::pfsense::snmp::mode::listpfinterfaces',
|
||||||
'packet-stats' => 'apps::pfsense::snmp::mode::packetstats',
|
'packet-stats' => 'apps::pfsense::snmp::mode::packetstats',
|
||||||
'pfinterfaces' => 'apps::pfsense::snmp::mode::pfinterfaces',
|
'pfinterfaces' => 'apps::pfsense::snmp::mode::pfinterfaces',
|
||||||
'runtime' => 'apps::pfsense::snmp::mode::runtime',
|
'runtime' => 'apps::pfsense::snmp::mode::runtime'
|
||||||
);
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue