SOLVED: Enterprise: ec2 in keepalive handler

enterprise

#1

I’ve been trying to use ec2 integration for auto-deregistration, which i got it working.
Issue was, it would only work if is sole handler for keepalive event.
For example, current config works

“keepalive”: {
“contact”: “appsupport”,
“handlers”: [
“ec2”
],
“thresholds”: {
“critical”: 360,
“warning”: 180
}
},

but if i add additional handler(email), then it wouldn’t work.

“keepalive”: {
“contact”: “appsupport”,
“handlers”: [
“ec2”,
“email”
],
“thresholds”: {
“critical”: 360,
“warning”: 180
}
},

Idea is, if sensu detects an instance termination, then it should use ec2 handler to deregister automatically. otherwise, if the server can’t talk to clients for whatever reasons for certain period of time, it should send out an email alert.

Any ideas?

Thank you


#2

The EC2 integration is expected to handle keepalive events, regardless of whether any other handlers are configured for keepalives.

Will you please share log output showing the handling of a keepalive event with both your email and ec2 handlers configured? This would help us understand why the integration isn’t working as we expect.


#3

{
“timestamp”: “2018-11-08T09:25:07.325933-0500”,
“level”: “error”,
“message”: “ec2 integration error”,
“error”: “You are not authorized to perform this operation.”,
“event”: {
“id”: “dada5682-db69-43ef-a549-47b19edd3f14”,
“client”: {
“name”: “centos-repo-npr-01”,
“address”: “…”,
“ec2”: {
“instance_id”: “…”
},
“keepalive”: {
“contact”: “appsupport”,
“handlers”: [
“email”,
“ec2”
],
“thresholds”: {
“critical”: 360,
“warning”: 180
}
},
“memory”: {
“contact”: “martin”,
“critical”: 98,
“warning”: 78
},
“safe_mode”: false,
“subscriptions”: [
“cloudops”,
“sensu_agents”,
“prd”,
“linux”,
“client:centos-repo-npr-01”
],
“version”: “1.5.0”,
“timestamp”: 1541686926
},
“check”: {
“thresholds”: {
“warning”: 180,
“critical”: 360
},
“contact”: “appsupport”,
“handlers”: [
“email”,
“ec2”
],
“name”: “keepalive”,
“issued”: 1541687107,
“executed”: 1541687107,
“output”: “No keepalive sent from client for 181 seconds (>=180)”,
“status”: 1,
“type”: “standard”,
“history”: [
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“0”,
“1”
],
“total_state_change”: 6
},
“occurrences”: 1,
“occurrences_watermark”: 1,
“last_ok”: 1541687077,
“action”: “create”,
“timestamp”: 1541687107,
“last_state_change”: 1541687107,
“silenced”: false,
“silenced_by”:
}
}


Does ec2 integration require more than aws access & secret key? The credential i provided to Sensu server has full access to ec2 so i’m certain the aws credential is not an issue, so not sure what’s not being authorized.


#4

oops. i was using old aws credentials; i’ll try again with new credential.


#5

it works. thanks…/


closed #6