omni-lchen / zabbix-cloudwatch

71 stars 61 forks source link

Can you elaborate more on how to set this up? #13

Open khoi-thinh opened 7 years ago

khoi-thinh commented 7 years ago

As far as i understand, you had prepared everything including template, script. In my case, i just want to integrate ELB metrics into my zabbix server. How should i do that? Please correct me if i'm wrong.

  1. Install boto 2.Create folder /opt/zabbix/cloudwatch 3.Add AWS credentials 4.Because aws_services_metrics.conf has every metrics, so i don't think i need to add anything 5.I don't know how to create template and item, so i would use ELB template you created. I would import it to zabbix 6.Create new host an linked with ELB template. 7.Execute that cron.ELB.sh Is that correct?
omni-lchen commented 7 years ago

That's correct, but you also need to install python dateutil module due to recent utc to local timezone change.

khoi-thinh commented 7 years ago

Do i have to change any value in cron.ELB.sh script or have to setup MACRO in zabbix host? I didn't see anywhere in your guide said that i need to put in aws region or anything.
And unfortunately, as i executed the cron.ELB.sh, it said: ./cron.ELB.sh: line 27: zabbixCloudWatch.py: command not found

omni-lchen commented 7 years ago

You only use MACRO if you use discovery rule, but also need to adjust the script a bit in awsLLD.py to adapt to your naming standard. You need to give execution permission to all bash and python scripts chmod +x .py chmod +x .sh

khoi-thinh commented 7 years ago

First of all, all of your scripts had been given execution permissions. The same error came out ./cron.ELB.sh: line 27: zabbixCloudWatch.py: command not found

So let me be clear I have 3 ELB running named A,B,C. I just want to get metrics from B and my instance is in Singapore region (ap-southeast-1) Where is the place i should put that information in?

In your cron.ELB.sh, there are these line

Load Balancer Name

LOAD_BALANCER=$1

Zabbix Host

ZABBIX_HOST=$2

Zabbix Server

ZABBIX_SERVER=$3

AWS Account

ACCOUNT=$4

AWS Region

REGION=$5

In your ELB template, i saw this

{$AWS_ACCOUNT} awscore {$AWS_REGION} us-east-1 I'm really confused. Can you please tell me the detail how to do? I'm not sure if i should use MACRO or something, i just want to get my specific ELB's metric and see their graph with data. So what do i have to change value in cron.ELB.sh and ELB template? Given my condition is: ELB named B, region is ap-southeast-1.
omni-lchen commented 7 years ago

That is bash wrapper script, you need to set the zabbix host, server, elb parameters in cronjob, see cron.d/crontab