Skip to content

Commit

Permalink
Fix wrong variable assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
itoussies committed Dec 24, 2024
1 parent 576bd1e commit ef68077
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 36 deletions.
14 changes: 7 additions & 7 deletions src/cloud/azure/network/vpngateway/mode/health.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@ Set resource group (required if resource's name is used).
=item B<--warning-status>
Define the conditions to match for the status to be WARNING (default: '').
You can use the following variables: %{status}, %{summary}
You can use the following variables: C<%{status}>, C<%{summary}>.
=item B<--critical-status>
Define the conditions to match for the status to be CRITICAL (default: '%{status} =~ /^Unavailable$/').
You can use the following variables: %{status}, %{summary}
Define the conditions to match for the status to be CRITICAL (default: C<%{status} =~ /^Unavailable$/>).
You can use the following variables: C<%{status}>, C<%{summary}>.
=item B<--unknown-status>
Define the conditions to match for the status to be UNKNOWN (default: '%{status} =~ /^Unknown$/').
You can use the following variables: %{status}, %{summary}
Define the conditions to match for the status to be UNKNOWN (default: C<%{status} =~ /^Unknown$/>).
You can use the following variables: C<%{status}>, C<%{summary}>.
=item B<--ok-status>
Define the conditions to match for the status to be OK (default: '%{status} =~ /^Available$/').
You can use the following variables: %{status}, %{summary}
Define the conditions to match for the status to be OK (default: C<%{status} =~ /^Available$/>).
You can use the following variables: C<%{status}>, C<%{summary}>.
=back
Expand Down
21 changes: 6 additions & 15 deletions src/cloud/azure/network/vpngateway/mode/sitetraffic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,11 @@ Example:
Using resource name:
perl centreon_plugins.pl --plugin=cloud::azure::network::vpngateway::plugin --custommode=azcli --mode=site-traffic
--resource=MyResource --resource-group=MYRGROUP --aggregation='average' --aggregation='total' --critical-bandwidth-average='10'
--verbose
C<perl centreon_plugins.pl --plugin=cloud::azure::network::vpngateway::plugin --custommode=azcli --mode=site-traffic --resource=MyResource --resource-group=MYRGROUP --aggregation='average' --aggregation='total' --critical-bandwidth-average='10' --verbose>
Using resource ID:
perl centreon_plugins.pl --plugin=cloud::azure::network::vpngateway::plugin --custommode=azcli --mode=site-traffic
--resource='/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/virtualNetworkGateways/xxx'
--aggregation='average' --aggregation='total' --critical-bandwidth-average='10' --verbose
C<perl centreon_plugins.pl --plugin=cloud::azure::network::vpngateway::plugin --custommode=azcli --mode=site-traffic --resource='/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/virtualNetworkGateways/xxx' --aggregation='average' --aggregation='total' --critical-bandwidth-average='10' --verbose>
Default aggregation: 'average' (*Bandwidth), 'total' (P2SConnectionCount)
Expand All @@ -153,18 +149,13 @@ Set resource group (required if resource's name is used).
=item B<--filter-metric>
Filter metrics (can be: 'AverageBandwidth', 'P2SBandwidth', 'P2SConnectionCount')
Filter metrics (can be: C<AverageBandwidth>, C<P2SBandwidth>, C<P2SConnectionCount>)
(can be a regexp).
=item B<--warning-$label$>
=item B<--warning-$label$ --critical-$label$>
Warning thresholds
($label$ can be: 'bandwidth-average', 'p2s-bandwidth', p2s-connections)
=item B<--critical-$label$>
Critical thresholds
($label$ can be: 'bandwidth-average', 'p2s-bandwidth', p2s-connections)
Thresholds
($label$ can be: C<bandwidth-average>, C<p2s-bandwidth>, C<p2s-connections>)
=back
Expand Down
12 changes: 4 additions & 8 deletions src/cloud/azure/network/vpngateway/mode/tunneltraffic.pm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
Expand Down Expand Up @@ -175,15 +176,10 @@ Filter metrics (can be: 'TunnelIngressBytes', 'TunnelEgressBytes', 'TunnelIngres
'TunnelEgressPackets', 'TunnelIngressPacketDropTSMismatch', 'TunnelEgressPacketDropTSMismatch')
(can be a regexp).
=item B<--warning-$label$>
Warning thresholds.
($label$ can be traffic-in, traffic-out, packets-in, packets-out, dropped-packets-in, dropped-packets-out)
=item B<--critical-$label$>
=item B<--warning-$label$ --critical-$label$>
Critical thresholds
($label$ can be traffic-in, traffic-out, packets-in, packets-out, dropped-packets-in, dropped-packets-out)
Thresholds
($label$ can be C<traffic-in>, C<traffic-out>, C<packets-in>, C<packets-out>, C<dropped-packets-in>, C<dropped-packets-out>)
=item B<--per-sec>
Expand Down
9 changes: 4 additions & 5 deletions src/cloud/azure/network/vpngateway/mode/vpngatewaystatus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ __END__
Check VPN gateways status.
Example:
perl centreon_plugins.pl --plugin=cloud::azure::network::vpngateway::plugin --custommode=azcli --mode=vpn-gateways-status
--resource-group='MYRESOURCEGROUP' --verbose
C<perl centreon_plugins.pl --plugin=cloud::azure::network::vpngateway::plugin --custommode=azcli --mode=vpn-gateways-status --resource-group='MYRESOURCEGROUP' --verbose>
=over 8
Expand All @@ -136,12 +135,12 @@ Filter VPN Gateways by name (can be a regexp).
=item B<--warning-status>
Define the conditions to match for the status to be WARNING (default: '').
You can use the following variables: %{provisioning_state}, %{gateway_type}, %{vpn_type}, %{display}
You can use the following variables: C<%{provisioning_state}>, C<%{gateway_type}>, C<%{vpn_type}>, C<%{display}>
=item B<--critical-status>
Define the conditions to match for the status to be CRITICAL (default: '%{provisioning_state} ne "Succeeded"').
You can use the following variables: %{provisioning_state}, %{gateway_type}, %{vpn_type}, %{display}
Define the conditions to match for the status to be CRITICAL (default: C<%{provisioning_state} ne "Succeeded">).
You can use the following variables: C<%{provisioning_state}>, C<%{gateway_type}>, C<%{vpn_type}>, C<%{display>}
=back
Expand Down
4 changes: 3 additions & 1 deletion tests/cloud/azure/network/vpngateway/vpngatewaystatus.robot
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ ${MOCKOON_JSON} ${CURDIR}${/}vpngatewaystatus.json

${BASE_URL} http://${HOSTNAME}:${APIPORT}
${LOGIN_ENDPOINT} ${BASE_URL}/login
${CMD} ${CENTREON_PLUGINS} --plugin=cloud::azure::network::vpngateway::plugin --custommode=api --mode=vpn-gateway-status --subscription=subscription --tenant=tenant --client-id=client_id --client-secret=secret --resource-group=resource-group --login-endpoint=${LOGIN_ENDPOINT} --management-endpoint=${BASE_URL}
${CMD} ${CENTREON_PLUGINS} --plugin=cloud::azure::network::vpngateway::plugin --custommode=api --subscription=subscription --tenant=tenant --client-id=client_id --client-secret=secret --resource-group=resource-group --login-endpoint=${LOGIN_ENDPOINT}


*** Test Cases ***
VPN Gateway status ${tc}
[Tags] cloud azure api mockoon
${command} Catenate
... ${CMD}
... --mode=vpn-gateway-status
... --management-endpoint=${BASE_URL}
... ${extra_options}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Expand Down

0 comments on commit ef68077

Please sign in to comment.