Open Omermiz opened 7 years ago
Hi, you need to set up a cron job running "python icinga2_multi_aws.py" in the required frequency or just run this manually to get some output. This will gather AWS inventory and insert new hosts to Icinga2 and will remove the hosts corresponding to terminated EC2 instances. Script requires icingacli installed in order to run. If you have any output from the script, please post it here and I can review.
now this is my output. root@monitor:/srv/icinga2-aws-multi-account-instance-discovery# python icinga2_multi_aws.py {u'': [{'ImageId': 'ami-****', 'InstanceId': 'i-', 'InstanceType': 'r3.large', 'KeyName': '*', 'PublicDnsName': 'ec2----.us-west-2.compute.amazonaws.com', 'PublicIpAddress': '...', 'Tags': [{u'Key': 'Env', u'Value': 'QA'}, {u'Key': 'Name', u'Value': '*'}, {u'Key': 'Environment', u'Value': 'Production'}]}]} Host 'i-***' does not exist ERROR: Icinga\Exception\NotFoundError in /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObjectGroups.php:192 with message: The group "aws-" doesn't exists. added node i-
I do apologize, probably the config isn't rich enough and description for it as well. In the code you have "groups": [ "aws-" + account ], which mean, the script expects "aws-myaccount" host group created in icinga, and fails when it isn't found...
I understand. Thank you im trying to fix it now.
Hi, I cannot understand how this works. I copied the config_example.json to config.json, edited it how it should be, and i cannot get any machine when running the script. this is my config:
}