awslabs / collectd-cloudwatch

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

Looking up <Private DNS> failed #56

Closed adjourn closed 3 years ago

adjourn commented 7 years ago

I use latest Amazon Linux AMI, collectd version is 5.7.1-3.19.amzn1.

I started with #5 steps but setup fails. After digging into this, I realized that configuration has changed a lot, here's what I did:

(echo "1"; echo "1"; echo "1"; echo "1"; ecyho "1"; echo "1"; echo "1"; echo "2"; echo "1"; echo "3"; cat) | python setup.py

[1] get region automatically
[1] get EC2 instance id automatically
[1] choose IAM role
[1] no proxy server name
[1] no proxy server port
[1] no ASG metrics
[1] no fixed metric dimension
[2] no high resolution metrics
[1] default flush interval (60s)
[3] use CloudWatch recommended configuration (4 metrics)

But I still get the following response:

...
Enter choice [3]: Plugin configuration written successfully.
Stopping collectd process ... NOT OK
Starting collectd process ... NOT OK
Installation cancelled due to an error.
Executed command: '/usr/sbin/collectd'.
Error output: ''.

plugin.conf still messed up, blocked_metrics, whitelist.conf are empty and /var/log/messages:

Oct  3 15:30:04 ip-10-10-5-245 collectd[8532]: plugin_load: plugin "syslog" successfully loaded.
Oct  3 15:30:04 ip-10-10-5-245 collectd[8532]: plugin_load: plugin "cpu" successfully loaded.
Oct  3 15:30:04 ip-10-10-5-245 collectd[8532]: plugin_load: plugin "interface" successfully loaded.
Oct  3 15:30:04 ip-10-10-5-245 collectd[8532]: plugin_load: plugin "load" successfully loaded.
Oct  3 15:30:04 ip-10-10-5-245 collectd[8532]: plugin_load: plugin "memory" successfully loaded.
Oct  3 15:30:04 ip-10-10-5-245 collectd[8532]: plugin_load: plugin "python" successfully loaded.
Oct  3 15:30:04 ip-10-10-5-245 collectd[8532]: Looking up "ip-10-10-5-245" failed. You have set the "FQDNLookup" option, but I cannot resolve my hostname to a fully qualified domain name. Please fix the network configuration.

ip-10-10-5-245 seems to be first part of private DNS ip-10-10-5-245.<region>.compute.internal.


Any ideas? I have no idea how to resolve this.

yimuniao commented 7 years ago

Could you check if "collectd-python" package installed on your system? for exampe: rpm -qa| grep collectd-python. If no , please install it with "yum install -y collectd-python"

And we support non-interactive mode now, you can run ./setup.py -h for help

yimuniao commented 7 years ago

For example:

[root@ip-172-31-34-234 ~]# ./setup.py -h usage: setup.py [-h] [-I] [-H HOST_NAME] [-r REGION] [-n NAME] [-p PORT] [-e] [-f FLUSH_INTERVAL] [-a ACCESS_KEY] [-s SECRET_KEY] [-P CREDENTIALS_PATH] [-m recommended|add|not_modify] [-g] [-c] [-v DIMENSION_VALUE] [-d] [-D]

Script for custom installation process for collectd AWS CloudWatch plugin

optional arguments: -h, --help show this help message and exit -I, --non_interactive Non interactive mode (default: False) -H HOST_NAME, --host_name HOST_NAME Manual override for EC2 Instance ID and Host information propagated by collectd (default: None) -r REGION, --region REGION Manual override for region used to publish metrics (default: None) -n NAME, --proxy_name NAME Proxy server name (default: None) -p PORT, --proxy_port PORT Proxy server port (default: None) -e, --enable_high_resolution_metrics Enable high resolution metrics (default: False) -f FLUSH_INTERVAL, --flush_interval FLUSH_INTERVAL Flush interval (in seconds) (default: None) -a ACCESS_KEY, --access_key ACCESS_KEY AWS IAM user access key (default: None) -s SECRET_KEY, --secret_key SECRET_KEY AWS IAM user secret key (default: None) -P CREDENTIALS_PATH, --creds_path CREDENTIALS_PATH Absolute path to AWS credentials file (default: None) -m recommended|add|not_modify, --installation_method recommended|add|not_modify Choose how to install CloudWatch plugin in collectd (default: None) -g, --push_asg Include the Auto-Scaling Group name as a metric dimension: (default: False) -c, --push_constant Include the FixedDimension as a metric dimension (default: None) -v DIMENSION_VALUE, --dimension_value DIMENSION_VALUE FixedDimension value (default: None) -d, --debug Provides verbose logging of metrics emitted to CloudWatch (default: False) -D, --debug_setup Provides verbose logging during setup process (default: False)

yimuniao commented 7 years ago

You can run "./setup.py -I -a *accesskey* -s securitykey***" to install this plugin.

adjourn commented 7 years ago

I still get the same error with sudo python ./setup.py -I.

Terminal after running setup:

Plugin configuration written successfully.
Stopping collectd process ... NOT OK
Starting collectd process ... NOT OK
Installation cancelled due to an error.
Executed command: '/usr/sbin/collectd'.
Error output: ''.

/var/log/messages:

Oct  3 18:10:02 ip-10-10-8-49 collectd[29221]: plugin_load: plugin "syslog" successfully loaded.
Oct  3 18:10:02 ip-10-10-8-49 collectd[29221]: plugin_load: plugin "cpu" successfully loaded.
Oct  3 18:10:02 ip-10-10-8-49 collectd[29221]: plugin_load: plugin "interface" successfully loaded.
Oct  3 18:10:02 ip-10-10-8-49 collectd[29221]: plugin_load: plugin "load" successfully loaded.
Oct  3 18:10:02 ip-10-10-8-49 collectd[29221]: plugin_load: plugin "memory" successfully loaded.
Oct  3 18:10:02 ip-10-10-8-49 collectd[29221]: Looking up "ip-10-10-8-49" failed. You have set the "FQDNLookup" option, but I cannot resolve my hostname to a fully qualified domain name. Please fix the network configuration.

sudo yum list installed | grep collectd:

collectd.x86_64                      5.7.1-3.19.amzn1              @amzn-main
collectd-python.x86_64               5.7.1-3.19.amzn1              @amzn-main
libcollectdclient.x86_64             5.7.1-3.19.amzn1              @amzn-main

sudo service collectd restart:

not restarting due to configuration error
yimuniao commented 7 years ago

I guess you are missing "yum install -y collectd-python" And you can try "sudo python ./setup.py -I -m recommended"

adjourn commented 3 years ago

I think I stopped trying to make it work after some frustration. Closing this.