@@ -75,46 +75,46 @@ sub set_counters {
7575 closure_custom_threshold_check => \&catalog_status_threshold_ng
7676 }
7777 },
78- { label => ' in-discard' , set => {
78+ { label => ' in-discard' , nlabel => ' interface.packets.in.discard.percentage ' , set => {
7979 key_values => [ { name => ' discard_in' , diff => 1 }, { name => ' total_in' , diff => 1 }, { name => ' display' } ],
8080 closure_custom_calc => $self -> can(' custom_packet_calc' ), closure_custom_calc_extra_options => { type => ' discard' , label_ref => ' in' },
8181 closure_custom_output => $self -> can(' custom_packet_output' ), output_error_template => ' Discard In : %s' ,
8282 threshold_use => ' result_prct' ,
8383 perfdatas => [
84- { label => ' packets_discard_in ' , value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
84+ { value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
8585 unit => ' %' , label_extra_instance => 1, instance_use => ' display' }
8686 ]
8787 }
8888 },
89- { label => ' out-discard' , set => {
89+ { label => ' out-discard' , nlabel => ' interface.packets.out.discard.percentage ' , set => {
9090 key_values => [ { name => ' discard_out' , diff => 1 }, { name => ' total_out' , diff => 1 }, { name => ' display' } ],
9191 closure_custom_calc => $self -> can(' custom_packet_calc' ), closure_custom_calc_extra_options => { type => ' discard' , label_ref => ' out' },
9292 closure_custom_output => $self -> can(' custom_packet_output' ), output_error_template => ' Discard Out : %s' ,
9393 threshold_use => ' result_prct' ,
9494 perfdatas => [
95- { label => ' packets_discard_out ' , value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
95+ { value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
9696 unit => ' %' , label_extra_instance => 1, instance_use => ' display' }
9797 ]
9898 }
9999 },
100- { label => ' in-error' , set => {
100+ { label => ' in-error' , nlabel => ' interface.packets.in.error.percentage ' , set => {
101101 key_values => [ { name => ' error_in' , diff => 1 }, { name => ' total_in' , diff => 1 }, { name => ' display' } ],
102102 closure_custom_calc => $self -> can(' custom_packet_calc' ), closure_custom_calc_extra_options => { type => ' error' , label_ref => ' in' },
103103 closure_custom_output => $self -> can(' custom_packet_output' ), output_error_template => ' Error In : %s' ,
104104 threshold_use => ' result_prct' ,
105105 perfdatas => [
106- { label => ' packets_error_in ' , value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
106+ { value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
107107 unit => ' %' , label_extra_instance => 1, instance_use => ' display' }
108108 ]
109109 }
110110 },
111- { label => ' out-error' , set => {
111+ { label => ' out-error' , nlabel => ' interface.packets.out.error.percentage ' , set => {
112112 key_values => [ { name => ' error_out' , diff => 1 }, { name => ' total_out' , diff => 1 }, { name => ' display' } ],
113113 closure_custom_calc => $self -> can(' custom_packet_calc' ), closure_custom_calc_extra_options => { type => ' error' , label_ref => ' out' },
114114 closure_custom_output => $self -> can(' custom_packet_output' ), output_error_template => ' Error In : %s' ,
115115 threshold_use => ' result_prct' ,
116116 perfdatas => [
117- { label => ' packets_error_out ' , value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
117+ { value => ' result_prct' , template => ' %.2f' , min => 0, max => 100,
118118 unit => ' %' , label_extra_instance => 1, instance_use => ' display' }
119119 ]
120120 }
@@ -124,7 +124,7 @@ sub set_counters {
124124
125125sub new {
126126 my ($class , %options ) = @_ ;
127- my $self = $class -> SUPER::new(package => __PACKAGE__ , %options , statefile => 1);
127+ my $self = $class -> SUPER::new(package => __PACKAGE__ , %options , statefile => 1, force_new_perfdata => 1 );
128128 bless $self , $class ;
129129
130130 $options {options }-> add_options(arguments => {
@@ -235,6 +235,21 @@ Command used: /sbin/ip -s addr 2>&1
235235
236236=over 8
237237
238+ =item B<--unknown-status >
239+
240+ Define the conditions to match for the status to be UNKNOWN.
241+ You can use the following variables: %{status}, %{display}
242+
243+ =item B<--warning-status >
244+
245+ Define the conditions to match for the status to be WARNING.
246+ You can use the following variables: %{status}, %{display}
247+
248+ =item B<--critical-status >
249+
250+ Define the conditions to match for the status to be CRITICAL (default: '%{status} ne "RU"').
251+ You can use the following variables: %%{status}, %{display}
252+
238253=item B<--warning-* >
239254
240255Warning threshold in percent of total packets. Can be:
0 commit comments