awslabs / collectd-cloudwatch

A collectd plugin for sending data to Amazon CloudWatch
MIT License
200 stars 132 forks source link

On collectd >5.5 the default metrics include swap even if swap not enabled (Results in 400 errors in collectd logs) #13

Closed atackett closed 7 years ago

atackett commented 8 years ago

When installing on a CentOS 7 AMI (behaves the same on RHEL 7.2) which has collectd 5.6 in the repos the setup.py defaults to option 3 on the last step which adds the 4 metrics to the whitelist.

If the machine does not have swap enabled the swap--percent-used causes 400 errors to the API because the plugin tries to send NaN values to CloudWatch.

setup.py should check if swap is even enabled before adding swap to whitelist.

atackett commented 8 years ago

One thing to add for anyone looking to fix. If you're seeing 400 errors in /var/log/collectd.log try removing swap--percent-used from: /opt/collectd-plugins/cloudwatch/config/whitelist.conf

Then restart collectd. If you have SELinux in enforcing mode you may have some trouble restarting collectd. If you look in collectd.log you won't see it actually reload.

I don't know SELinux too well so someone may have a better fix here, but to check if this is the problem set SELinux to permissive in /etc/selinux/config and reboot. I had no luck with setenforce 0.

If anyone has an SELinux policy that will play nice with collectd I'm all ears. :)

atackett commented 7 years ago

Updated the title of the issue to include mentioning 400 errors so it might catch more people heading here for help. :)

sebasrp commented 7 years ago

fixed by https://github.com/awslabs/collectd-cloudwatch/commit/853c99e4b370a2518107c29c69364f81985b38b0