zabbix-cloudwatch icon indicating copy to clipboard operation
zabbix-cloudwatch copied to clipboard

Region immunity

Open vanch opened this issue 9 years ago • 3 comments

After hours of debug I found some issue.

Environment: Ruby 2.0.0p645 Amazon Linux AMI release 2015.03 zabbix-cloudwatch 0.1.0

Problem: Always empty response with right request.

zabbix-cloudwatch --aws-access-key $AWSACCESSKEY --aws-secret-key $AWSSECRETKEY --aws-region eu-central-1 --namespace "AWS/RDS" --metricname FreeStorageSpace --dimension-name "DBInstanceIdentifier" --dimension-value somename

gives me nothing, just empty datapoint array.

Investigation: I've been found similar issues when region is not set, so I checked. In main binary that's ok eu-central-1, but when you going lower, to get_aws_options function, there is if with && which gives you on p options.key?"aws-region" && options['aws-region'] != '' - false. I can't understand why it's possible.

Solution: I've changed && to and and everything works. In this statement there is no difference between && and and so it's ok.

vanch avatar Aug 27 '15 07:08 vanch

http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/ good catch.

randywallace avatar Jan 29 '16 10:01 randywallace

#7 should resolve this

randywallace avatar Jan 29 '16 10:01 randywallace

Good! confirmed here the change from && to and and now is working :+1:

tiago-cruz-movile avatar Apr 01 '16 20:04 tiago-cruz-movile