omni-lchen / zabbix-cloudwatch

71 stars 61 forks source link

configuration issue with RDS #15

Open Milozavic opened 7 years ago

Milozavic commented 7 years ago

Hi well i'am stack at the step 5 when configuring zabbix trapper; what do you mean by discovery_item_value? the in step 6 when i try to add the new host, how can i find connection port (default value:10050)?

Could you please enlighten me on this :)

omni-lchen commented 7 years ago

Please import RDS and DynamoDB templates into zabbix, RDS doesn't use discovery rule, but DynamoDB uses discovery rule, which discovers DynamoDB tables by using a condition rule. As the metric uses zabbix trapper, it doesn't require zabbix agent, so the port is not required, the host is a dummy host (127.0.0.1) anyway.

Milozavic commented 7 years ago

thank you Omni-Ichen for your support, well, my question about port number was because of my AWS/RDS EndPoint is behind a firewall and only TCP/1521 is open...

Atem18 commented 7 years ago

@Milozavic Did you made a crontab entry for each RDS you want to monitor ?

Milozavic commented 7 years ago

yes and this, added this:

/1 * /opt/zabbix/cloudwatch/cron.d/cron.RDS.sh "pjhokan-db" "pjhokan-db.amazonaws.com" "localhost" "myAWSaccount" "myregion" &>/dev/null

omni-lchen commented 7 years ago

Please check all parameters are set up correctly, also the aws credentials, I don't recommend to run cron job every minute, it causes high CPU utilisation, you can run every 5 minutes, but collect 1-min data instead by changing the bash wrapper PERIOD="60", also disable this function sendLatestCloudWatchData(zabbix_server, zabbix_host, cw_data), enable the following functions in zabbix-python.py. log_buffer = 500 cw_log = initCloudWatchLog(aws_service, zabbix_host, aws_region) sendAllCloudWatchData(zabbix_server, zabbix_host, cw_data, cw_log) purgeOldCloudWatchLog(cw_log, log_buffer)

Milozavic commented 7 years ago

i've made the changes as u requested ... and i got this when running the script: [root@zbx-srv ~]#/opt/zabbix/cloudwatch/cron.d/cron.RDS.sh "db-O7KCISXXXXXX" "phinstance-db.amazonaws.com" "localhost" "xxxx-xxxx-xxxx" "region" OUTPUT: Traceback (most recent call last): File "/opt/zabbix/cloudwatch/zabbixCloudWatch.py", line 370, in cw_data = getCloudWatchData(aws_account, aws_region, aws_service, dimensions) File "/opt/zabbix/cloudwatch/zabbixCloudWatch.py", line 154, in getCloudWatchData aws_account = awsAccount(account) File "/opt/zabbix/cloudwatch/awsAccount.py", line 20, in init options = Config.options(account) File "/usr/lib64/python2.7/ConfigParser.py", line 279, in options raise NoSectionError(section) *ConfigParser.NoSectionError: No section: 'xxxx-xxxx-xxxx'

AS if the input account is not valide support me please :(

omni-lchen commented 7 years ago

It looks like your aws account specified in the parameters of cron.RDS.sh doesn't match the one in conf/awscred.conf, please check "[account]" in the conf file.

Milozavic commented 7 years ago

This is what i have in my awscred.conf [aws_account_1] aws_access_key_id=xxxxxx (login) aws_secret_access_key=xxxxxx (password) ... i've left this field [aws_account_1] as it is, should i change it with my account id value (xxxx-xxxx-xxxx) ?

Milozavic commented 7 years ago

forget to montion when accessing the cloudwatch portal i've to input my account id, login and password and the awscred.conf contain only two field access_key_id(login) and secret_access_key(password)

omni-lchen commented 7 years ago

aws_access_key_id and aws_secret_access_key are not your login id and password, you should go to IAM in AWS console to generate your access keys. Use access keys to make secure REST or HTTP Query protocol requests to AWS service APIs.

Milozavic commented 7 years ago

omni-Ichen thank you soo much for you help and sorry for not giving you feedback in time cuz i've been very busy those days... well it work finaly but still one final thing... i run the cmd

_"/opt/zabbix/cloudwatch/cron.d/cron.RDS.sh "pjhokan-db" "pjhokan-db" "localhost" "aws_account1" "ap-northeast-1" and i'm able now to see data on zabbix web-portal but when adding that to contab nothing happen!! dont know way!!! do you have any idea!!

omni-lchen commented 7 years ago

Please check cron service has started up, and you can see the cron job in cron log, /var/log/cron or /var/log/syslog

Milozavic commented 7 years ago

Oooh thank you Long Chen, thank for your support, it worked already and it was a problem of internet connection, i just run:

export https_proxy="my proxy's IP address"

thank you Long.. really u've done a great job