fix(mode): Fix Velocloud modes when edge offline (#2532)

This commit is contained in:
Thibault S 2021-02-04 10:40:32 +01:00 committed by GitHub
parent 9b1a4ab406
commit 51c91d8d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 12 deletions

View File

@ -32,12 +32,22 @@ sub set_counters {
{ name => 'edges', type => 3, cb_prefix_output => 'prefix_edge_output', cb_long_output => 'long_output', { name => 'edges', type => 3, cb_prefix_output => 'prefix_edge_output', cb_long_output => 'long_output',
message_multiple => 'All edges applications usage are ok', indent_long_output => ' ', message_multiple => 'All edges applications usage are ok', indent_long_output => ' ',
group => [ group => [
{ name => 'global', type => 0 },
{ name => 'apps', display_long => 1, cb_prefix_output => 'prefix_app_output', { name => 'apps', display_long => 1, cb_prefix_output => 'prefix_app_output',
message_multiple => 'All applications usage are ok', type => 1 } message_multiple => 'All applications usage are ok', type => 1 }
] ]
} }
]; ];
$self->{maps_counters}->{global} = [
{ label => 'edge-applications-count', nlabel => 'edge.applications.total.count', set => {
key_values => [ { name => 'app_count' } ],
output_template => '%s application(s)',
perfdatas => [ { template => '%d', unit => '', min => 0, label_extra_instance => 1 } ]
}
}
];
$self->{maps_counters}->{apps} = [ $self->{maps_counters}->{apps} = [
{ label => 'traffic-in', nlabel => 'application.traffic.in.bitspersecond', set => { { label => 'traffic-in', nlabel => 'application.traffic.in.bitspersecond', set => {
key_values => [ { name => 'traffic_in' }, { name => 'display' }, { name => 'id' } ], key_values => [ { name => 'traffic_in' }, { name => 'display' }, { name => 'id' } ],
@ -148,6 +158,7 @@ sub manage_selection {
next; next;
} }
$self->{edges}->{$edge->{name}}->{global}->{app_count}++;
$self->{edges}->{$edge->{name}}->{apps}->{ $app_name } = { $self->{edges}->{$edge->{name}}->{apps}->{ $app_name } = {
id => $app->{application}, id => $app->{application},
display => $app_name, display => $app_name,
@ -186,7 +197,7 @@ Filter application by name (Can be a regexp).
=item B<--warning-*> B<--critical-*> =item B<--warning-*> B<--critical-*>
Thresholds. Thresholds.
Can be: 'traffic-in', 'traffic-out', Can be: 'edge-applications-count', 'traffic-in', 'traffic-out',
'packets-in', 'packets-out'. 'packets-in', 'packets-out'.
=back =back

View File

@ -32,12 +32,22 @@ sub set_counters {
{ name => 'edges', type => 3, cb_prefix_output => 'prefix_edge_output', cb_long_output => 'long_output', { name => 'edges', type => 3, cb_prefix_output => 'prefix_edge_output', cb_long_output => 'long_output',
message_multiple => 'All edges categories usage are ok', indent_long_output => ' ', message_multiple => 'All edges categories usage are ok', indent_long_output => ' ',
group => [ group => [
{ name => 'global', type => 0 },
{ name => 'categories', display_long => 1, cb_prefix_output => 'prefix_category_output', { name => 'categories', display_long => 1, cb_prefix_output => 'prefix_category_output',
message_multiple => 'All categories usage are ok', type => 1 } message_multiple => 'All categories usage are ok', type => 1 }
] ]
} }
]; ];
$self->{maps_counters}->{global} = [
{ label => 'edge-categories-count', nlabel => 'edge.categories.total.count', set => {
key_values => [ { name => 'category_count' } ],
output_template => '%s categorie(s)',
perfdatas => [ { template => '%d', unit => '', min => 0, label_extra_instance => 1 } ]
}
}
];
$self->{maps_counters}->{categories} = [ $self->{maps_counters}->{categories} = [
{ label => 'traffic-in', nlabel => 'category.traffic.in.bitspersecond', set => { { label => 'traffic-in', nlabel => 'category.traffic.in.bitspersecond', set => {
key_values => [ { name => 'traffic_in' }, { name => 'display' }, { name => 'id' } ], key_values => [ { name => 'traffic_in' }, { name => 'display' }, { name => 'id' } ],
@ -143,6 +153,7 @@ sub manage_selection {
next; next;
} }
$self->{edges}->{$edge->{name}}->{global}->{category_count}++;
$self->{edges}->{$edge->{name}}->{categories}->{$category->{name}} = { $self->{edges}->{$edge->{name}}->{categories}->{$category->{name}} = {
id => $category->{category}, id => $category->{category},
display => $category->{name}, display => $category->{name},
@ -181,7 +192,7 @@ Filter category by name (Can be a regexp).
=item B<--warning-*> B<--critical-*> =item B<--warning-*> B<--critical-*>
Thresholds. Thresholds.
Can be: 'traffic-in', 'traffic-out', Can be: 'edge-categories-count', 'traffic-in', 'traffic-out',
'packets-in', 'packets-out'. 'packets-in', 'packets-out'.
=back =back

View File

@ -63,6 +63,14 @@ sub set_counters {
{ template => '%s', min => 0, max => 10, label_extra_instance => 1 } { template => '%s', min => 0, max => 10, label_extra_instance => 1 }
] ]
} }
},
{ label => 'edge-links-count', nlabel => 'global.links.total.count', set => {
key_values => [ { name => 'link_count' } ],
output_template => '%s link(s)',
perfdatas => [
{ template => '%d', unit => '', min => 0, label_extra_instance => 1 }
]
}
} }
]; ];
@ -175,6 +183,7 @@ sub manage_selection {
next; next;
} }
$self->{edges}->{$edge->{name}}->{global}->{link_count}++;
$self->{edges}->{$edge->{name}}->{links}->{$link->{link}->{displayName}} = { $self->{edges}->{$edge->{name}}->{links}->{$link->{link}->{displayName}} = {
id => $link->{linkId}, id => $link->{linkId},
display => $link->{link}->{displayName}, display => $link->{link}->{displayName},
@ -212,9 +221,9 @@ Filter link by name (Can be a regexp).
=item B<--warning-*> B<--critical-*> =item B<--warning-*> B<--critical-*>
Thresholds. Thresholds.
Can be: 'qoe-voice-global', 'qoe-video-global', 'qoe-transactional-global' (global values) and/or Can be: 'edge-links-count', 'qoe-voice-global', 'qoe-video-global', 'qoe-transactional-global' (global values) and/or
'qoe-voice', 'qoe-video', 'qoe-transactional' (per link values). 'qoe-voice', 'qoe-video', 'qoe-transactional' (per link values).
=back =back
=cut =cut

View File

@ -44,12 +44,22 @@ sub set_counters {
{ name => 'edges', type => 3, cb_prefix_output => 'prefix_edge_output', cb_long_output => 'long_output', { name => 'edges', type => 3, cb_prefix_output => 'prefix_edge_output', cb_long_output => 'long_output',
message_multiple => 'All edges links status are ok', indent_long_output => ' ', message_multiple => 'All edges links status are ok', indent_long_output => ' ',
group => [ group => [
{ name => 'global', type => 0 },
{ name => 'links', display_long => 1, cb_prefix_output => 'prefix_link_output', { name => 'links', display_long => 1, cb_prefix_output => 'prefix_link_output',
message_multiple => 'All links status are ok', type => 1 } message_multiple => 'All links status are ok', type => 1 }
] ]
} }
]; ];
$self->{maps_counters}->{global} = [
{ label => 'edge-links-count', nlabel => 'edge.links.total.count', set => {
key_values => [ { name => 'link_count' } ],
output_template => '%s link(s)',
perfdatas => [ { template => '%d', unit => '', min => 0 } ]
}
}
];
$self->{maps_counters}->{links} = [ $self->{maps_counters}->{links} = [
{ {
label => 'status', label => 'status',
@ -134,6 +144,7 @@ sub manage_selection {
next; next;
} }
$self->{edges}->{$edge->{name}}->{global}->{link_count}++;
$self->{edges}->{$edge->{name}}->{links}->{$link->{link}->{displayName}} = { $self->{edges}->{$edge->{name}}->{links}->{$link->{link}->{displayName}} = {
id => $link->{linkId}, id => $link->{linkId},
display => $link->{link}->{displayName}, display => $link->{link}->{displayName},
@ -173,15 +184,13 @@ Filter link by name (Can be a regexp).
Set unknown threshold for status (Default: ''). Set unknown threshold for status (Default: '').
Can used special variables like: %{state}, %{vpn_state}, %{backup_state}. Can used special variables like: %{state}, %{vpn_state}, %{backup_state}.
=item B<--warning-status> =item B<--warning-*> B<--critical-*>
Set warning threshold for status (Default: ''). Warning & Critical thresholds
Can used special variables like: %{state}, %{vpn_state}, %{backup_state}. Can be 'status', 'edge-links-count'.
=item B<--critical-status> For 'status', special variables can be used: %{state}, %{vpn_state}, %{backup_state}
(Critical threshold default: '%{state} !~ /STABLE/ || %{vpn_state} !~ /STABLE/').
Set critical threshold for status (Default: '%{state} !~ /STABLE/ || %{vpn_state} !~ /STABLE/').
Can used special variables like: %{state}, %{vpn_state}, %{backup_state}.
=back =back

View File

@ -57,6 +57,14 @@ sub set_counters {
{ template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1 } { template => '%s', min => 0, unit => 'b/s', label_extra_instance => 1 }
] ]
} }
},
{ label => 'edge-links-count', nlabel => 'links.total.count', set => {
key_values => [ { name => 'link_count' } ],
output_template => '%s link(s)',
perfdatas => [
{ template => '%d', unit => '', min => 0, label_extra_instance => 1 }
]
}
} }
]; ];
@ -200,6 +208,7 @@ sub manage_selection {
next; next;
} }
$self->{edges}->{$edge->{name}}->{global}->{link_count}++;
$self->{edges}->{$edge->{name}}->{links}->{$link->{link}->{displayName}} = { $self->{edges}->{$edge->{name}}->{links}->{$link->{link}->{displayName}} = {
id => $link->{linkId}, id => $link->{linkId},
display => $link->{link}->{displayName}, display => $link->{link}->{displayName},
@ -248,7 +257,7 @@ Filter link by name (Can be a regexp).
=item B<--warning-*> B<--critical-*> =item B<--warning-*> B<--critical-*>
Thresholds. Thresholds.
Can be: 'links-traffic-in', 'links-traffic-out', Can be: 'edge-links-count', 'links-traffic-in', 'links-traffic-out',
'traffic-in', 'traffic-out', 'latency-in', 'traffic-in', 'traffic-out', 'latency-in',
'latency-out', 'jitter-in', 'jitter-out', 'latency-out', 'jitter-in', 'jitter-out',
'packet-loss-in', 'packet-loss-out'. 'packet-loss-in', 'packet-loss-out'.