ike-dai / zaws

Zabbix AWS monitoring template
49 stars 27 forks source link

cannot process json request #1

Open lbardelli opened 8 years ago

lbardelli commented 8 years ago

Hi Ike,

I try ZWAS on Zabbix 3.0, and he can discovery my hosts, but without any information...

On zabbix_server.log, I have this error:

2205:20160304:161438.281 cannot process json request: Can't open JSON object or array "null,"clock":1457108078}"

image

Do you know how can I figure out this ?

Thanks!

ike-dai commented 8 years ago

Thank you for trying zaws! Are each instances running ? This tool can get CloudWatch data for only running instances. Please check your CloudWatch data. https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#

ike-dai commented 8 years ago

If you can, please send me zabbix_server.log. dai.ikd123@gmail.com

And, please send screen capture (Configuration->Hosts->->Discovery->CloudWatch discovery (EC2)).

ghost commented 7 years ago

Hello guys,

I'm getting the same error message: 1483:20161201:093657.760 cannot process json request: Can't open JSON object or array "null,"clock":1480606617}". Any updates about this topic?

Best regards!

ankush-grover-3pg commented 7 years ago

Hi, I am also getting the same error and I am running Zabbix server version 3.2.1-1 on Ubuntu 16.04 on Amazon EC2. The Zabbix Server time is in UTC

Error Message:

16163:20161204:035601.206 received invalid agent history data from "127.0.0.1": Can't open JSON object or array "null,"clock":1480823761}" 16163:20161204:035610.875 received invalid agent history data from "127.0.0.1": Can't open JSON object or array "null,"clock":1480823770}" 16164:20161204:035701.402 received invalid agent history data from "127.0.0.1": Can't open JSON object or array "null,"clock":1480823821}"

ike-dai commented 7 years ago

@ihernandezbm @ankush-grover-3pg Thank you for your reporting.

This error will be caused by not getting data from AWS CloudWatch API. Please check AWS IAM user permissions.

Zaws calls CloudWatch ListMetrics API and GetMetricStatistics API. These permissions are set your IAM user? For example, please check the following command with your API Access key id and secret key.

aws cloudwatch list-metrics --namespace "AWS/EC2"
ankush-grover-3pg commented 7 years ago

Hi Ike-dai, It is not related to Permissions because I can list the metrics through the command you have mentioned.

aws cloudwatch list-metrics --namespace "AWS/EC2" --profile ops-dev

"Metrics": [ { "Dimensions": [ { "Name": "InstanceId", "Value": "i-xxxxxx" } ], "Namespace": "AWS/EC2", "MetricName": "NetworkIn" }, { "Dimensions": [ { "Name": "InstanceId", "Value": "i-xxxxxxx" } ], "Namespace": "AWS/EC2", "MetricName": "NetworkPacketsIn" }, { "Dimensions": [ { "Name": "InstanceId", "Value": "i-xxxxxx" } ], "Namespace": "AWS/EC2", "MetricName": "DiskReadOps" },

ghost commented 7 years ago

Thank you for your response, I really appreciate that. I'll will check what you mentioned and then will let you all know!

Best regards!

On Dec 4, 2016 21:44, "Daisuke Ikeda" notifications@github.com wrote:

@ihernandezbm https://github.com/ihernandezbm @ankush-grover-3pg https://github.com/ankush-grover-3pg Thank you for your reporting.

This error will be caused by not getting data from AWS CloudWatch API. Please check AWS IAM user permissions.

Zaws calls CloudWatch ListMetrics API and GetMetricStatistics API. These permissions are set your IAM user? For example, please check the following command with your API Access key id and secret key.

aws cloudwatch list-metrics --namespace "AWS/EC2"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ike-dai/zaws/issues/1#issuecomment-264761798, or mute the thread https://github.com/notifications/unsubscribe-auth/AWGc9gvb1FgqCjPNgV68-Ku9Jnqhxp-Iks5rE4ibgaJpZM4Hpf8L .

ghost commented 7 years ago

Hi all,

It was my mistake, I didn't configured my credentials in Zabbix console, I mean that I ran "aws configure" and set the credentials, and everything started working!

Thank you so much!

wagrodrigo commented 7 years ago

Displays Json error!!!

valery-zhurbenko commented 7 years ago

@I got same error. Just SSH'ed to zabbix (ubuntu), added AWS profile for user "ubuntu".. That pushed plugin to work! But still there are messages in zabbix server log: received invalid agent history data from "127.0.0.1": Can't open JSON object or array "null,"clock":1486563970}.. I use zabbix 3.2.

ike-dai commented 7 years ago

@valery-zhurbenko Thanks. zaws is executed with Zabbix Server process owner (default "zabbix"). Your zabbix-server processes will be running with "ubuntu" user.

About your error, I want to know which item is error state. Please check the following items and low-level-discovery rules status on your Zabbix Web dashboard.

micerinos commented 7 years ago

Hello,

I have the same error on zabbix 3.2.4: 25344:20170307:113123.590 received invalid agent history data from "127.0.0.1": Can't open JSON object or array "null,"clock":1488882683}"

Command aws cloudwatch list-metrics --namespace "AWS/EC2" works.

Somebody fix this issue?

TY Jose Luis

ike-dai commented 7 years ago

Hi, Sorry, I have not found the cause yet. Please tell me about your error item or discovery rules.

micerinos commented 7 years ago

In Item: cloudwatch stats monitor (EC2)

Discovery rules works like charm.