hygieia / hygieia-cloud-aws-collector

Hygieia Collector for AWS
https://github.com/capitalone/Hygieia/blob/gh-pages/pages/hygieia/collectors/cloud/aws.md
Apache License 2.0
1 stars 6 forks source link

AWS collector is not collecting the data #9

Open jamshaidishaque opened 4 years ago

jamshaidishaque commented 4 years ago

I have configured the AWS collector but it is not collecting the data and throwing below error

2020-04-11 17:05:00,000 [taskScheduler-1] INFO c.c.d.collector.CollectorTask - Running Collector: AWSCloud 2020-04-11 17:05:00,022 [taskScheduler-1] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:18, serverValue:29695}] to 10.0.10.51:27017 2020-04-11 17:05:00,037 [taskScheduler-1] INFO c.c.d.collector.CollectorTask - Starting AWS collection... 2020-04-11 17:05:00,038 [taskScheduler-1] INFO c.c.d.collector.CollectorTask - Collecting AWS Cloud Data... 2020-04-11 17:05:00,706 [taskScheduler-1] INFO c.c.d.c.AWSCloudCollectorTask - Collecting instance details for 1 of 59. Instance ID=i-0f40f3dbf3 2020-04-11 17:05:00,729 [taskScheduler-1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task. java.lang.NullPointerException: null at com.capitalone.dashboard.collector.DefaultAWSCloudClient.isInstanceTagged(DefaultAWSCloudClient.java:426) ~[aws-cloud-collector.jar!/:3.1.0-SNAPSHOT] at com.capitalone.dashboard.collector.DefaultAWSCloudClient.getCloudInstanceDetails(DefaultAWSCloudClient.java:178) ~[aws-cloud-collector.jar!/:3.1.0-SNAPSHOT] at com.capitalone.dashboard.collector.DefaultAWSCloudClient.getCloudInstances(DefaultAWSCloudClient.java:144) ~[aws-cloud-collector.jar!/:3.1.0-SNAPSHOT] at com.capitalone.dashboard.collector.AWSCloudCollectorTask.collectInstances(AWSCloudCollectorTask.java:137) ~[aws-cloud-collector.jar!/:3.1.0-SNAPSHOT] at com.capitalone.dashboard.collector.AWSCloudCollectorTask.collect(AWSCloudCollectorTask.java:122) ~[aws-cloud-collector.jar!/:3.1.0-SNAPSHOT] at com.capitalone.dashboard.collector.AWSCloudCollectorTask.collect(AWSCloudCollectorTask.java:51) ~[aws-cloud-collector.jar!/:3.1.0-SNAPSHOT] at com.capitalone.dashboard.collector.CollectorTask.run(CollectorTask.java:63) ~[core-3.0.4.jar!/:3.1.0-SNAPSHOT] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_231] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_231] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_231] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_231] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_231] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_231] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_231]

application.properties file

`# Database Name dbname=dashboarddb

Database HostName - default is localhost

dbhost=10.0.10.51

Database Port - default is 27017

dbport=27017

MongoDB replicaset

dbreplicaset=true dbhostport=10.0.10.51:27017,dev-percona-mongodb2:27017,dev-percona-mongodb3:27017

Database Username

dbusername=dashboarduser

Database Password

dbpassword=abcxyz123

Collector schedule (required)

aws.cron=0 0/5

aws region (e.g. eu-west-1)

aws.region=ap-southeast-1

aws_access_key_id=xxxxxxxxxxxxxxxxxxxxxxxxx aws_secret_access_key=xxxxxxxxxxxxxxxxxxxxxxxxxxx`

ashishcomps commented 4 years ago

looks like no one has replied on this yet.

ashishcomps commented 4 years ago

aws.validTagKey[0]=ABC aws.validTagKey[1]=XYZ

Please add above 2 lines in your application.properties And it should resolve the issue. It does not matter weather any of your AWS EC2 instance is tagged with these tags or not.

After adding above 2 lines, restart collector and UI.

larsen-mallick commented 4 years ago

Any idea what should be filled in the UI? There's an account number field upon hitting the configure widget button.

image

larsen-mallick commented 4 years ago

Got it, account number is the account identifier (Account Id) under Account Settings in Billing/Home -

https://console.aws.amazon.com/billing/home?#/account