Skip to main content

Hello everyone,

We are currently using the following plugin to retrieve all AWS CloudWatch alarms:

/usr/lib/centreon/plugins/centreon_aws_cloudwatch_api.pl --plugin=cloud::aws::cloudwatch::plugin --mode=get-alarms --custommode='awscli' --aws-secret-key='***' --aws-access-key='***' --aws-role-arn='' --proxyurl='' --region='sa-east-1' --filter-alarm-name='' --warning-status='%{state_value} =~ /INSUFFICIENT_DATA/i' --critical-status='%{state_value} =~ /ALARM/i' --verbose

We have an active alarm, which can be confirmed when using the --debug option. The output indicates that the instance memory has <StateValue>ALARM</StateValue>. However, the final result is:

ok: status : skipped (no value(s))

My question is: could this be a potential bug in the plugin?

When running the native AWS CLI command:

aws cloudwatch describe-alarms --region sa-east-1 --state-value ALARM

all active alarms are correctly returned, while the plugin does not display them.

Below is the --debug output showing the alarm:

   

  <member>
        <TreatMissingData>breaching</TreatMissingData>
        <AlarmConfigurationUpdatedTimestamp>2025-09-01T18:58:33.193Z</AlarmConfigurationUpdatedTimestamp>
        <StateValue>ALARM</StateValue>
        <Threshold>40.0</Threshold>
        <StateReason>Threshold Crossed: no datapoints were received for 1 period and 1 missing datapoint was treated as tBreaching].</StateReason>
        <InsufficientDataActions/>
        <StateTransitionedTimestamp>2025-09-02T04:39:15.668Z</StateTransitionedTimestamp>
        <AlarmActions/>
        <StateUpdatedTimestamp>2025-09-02T04:39:15.668Z</StateUpdatedTimestamp>
        <ComparisonOperator>GreaterThanThreshold</ComparisonOperator>
        <AlarmName>Instance memory</AlarmName>
        <EvaluationPeriods>1</EvaluationPeriods>
        <StateReasonData>{"version&quot;:&quot;1.0&quot;,&quot;queryDate&quot;:&quot;2025-09-02T04:39:15.664+0000&quot;,&quot;period&quot;:300,&quot;recentDatapoints&quot;:i],&quot;threshold&quot;:40.0,&quot;evaluatedDatapoints&quot;:a{&quot;timestamp&quot;:&quot;2025-09-02T04:34:00.000+0000&quot;}]}</StateReasonData>
        <ActionsEnabled>true</ActionsEnabled>
        <DatapointsToAlarm>1</DatapointsToAlarm>
        <Metrics>
          <member>
            <Expression>MAX(e1)</Expression>
            <ReturnData>true</ReturnData>
            <Label>Instance memory usage</Label>
            <Id>e2</Id>
          </member>
          <member>
            <Period>300</Period>
            <Expression>SELECT AVG(mem_used_percent) FROM SCHEMA(CWAgent,InstanceId) GROUP BY InstanceId ORDER BY AVG() DESC</Expression>
            <ReturnData>false</ReturnData>
            <Label>Instance</Label>
            <Id>e1</Id>
          </member>
        </Metrics>
        <CreationId>87b60bf6-d984-4612-8e58-c77ed25e9809/1751060096124</CreationId>
        <OKActions/>
        <AlarmArn>arn:aws:cloudwatch:sa-east-1:074071149174:alarm:Instance memory</AlarmArn>
        <Dimensions/>
      </member>
    </MetricAlarms>
  </DescribeAlarmsResult>
  <ResponseMetadata>
    <RequestId>af6003e5-476b-400c-a06f-77ce382f0c99</RequestId>
  </ResponseMetadata>
</DescribeAlarmsResponse>

2025-09-02 09:44:31,070 - MainThread - botocore.hooks - DEBUG - Event needs-retry.cloudwatch.DescribeAlarms: calling handler <botocore.retryhandler.RetryHandler object at 0x7f8741f3e650>
2025-09-02 09:44:31,071 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
OK: 0 problem(s) detected | 'alerts'=0;;;0;
Command line: 'aws cloudwatch describe-alarms --region sa-east-1 --output json --debug'
ok: status : skipped (no value(s))
ok: status : skipped (no value(s))

 

Be the first to reply!

Reply