Fix wrong variable assignment

This commit is contained in:
itoussies 2024-12-24 10:00:09 +01:00
parent 576bd1e352
commit ef68077a21
6 changed files with 24 additions and 36 deletions

View File

@ -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

View File

@ -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)
@ -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

View File

@ -1,3 +1,4 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
@ -175,15 +176,10 @@ Filter metrics (can be: 'TunnelIngressBytes', 'TunnelEgressBytes', 'TunnelIngres
'TunnelEgressPackets', 'TunnelIngressPacketDropTSMismatch', 'TunnelEgressPacketDropTSMismatch')
(can be a regexp).
=item B<--warning-$label$>
=item B<--warning-$label$ --critical-$label$>
Warning thresholds.
($label$ can be traffic-in, traffic-out, packets-in, packets-out, dropped-packets-in, dropped-packets-out)
=item B<--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>

View File

@ -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
@ -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

View File

@ -13,7 +13,7 @@ ${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 ***
@ -21,6 +21,8 @@ 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}