Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

ambari agent health

avatar
Explorer

Is there some api / endpoint exposed on the ambari agent that i can use to check if ambari agent is up / healthy & collect some stats

1 ACCEPTED SOLUTION

avatar
Super Collaborator

Each host has its own endpoint: api/v1/clusters/<clusterName>/hosts/<hostName>

From this, you can look at various parts of the JSON response:

"host_state": "HEALTHY",
"host_status": "HEALTHY",
"ip": "192.168.64.103",
"last_agent_env": {},
"last_heartbeat_time": 1460383979229,
"last_registration_time": 1460135920315,

The state will move from HEALTHY to HEARTBEAT_LOST (or something else like UNHEALTHY) when an agent can't communicate. Also, there is a host heartbeat alert (called Ambari Agent Heartbeat) which you can leverage to send emails or SNMP traps when the server can't communicate with an agent.

View solution in original post

2 REPLIES 2

avatar
Super Guru

@jabir ahmed

I think there is no api for ambari-agent health checkup - only you can see agent installation status using ambari api as mentioned -

https://cwiki.apache.org/confluence/display/AMBARI/Installing+ambari-agent+on+target+hosts

You might need to write custom script for the same.

Monitoring tools like nagios can track this.

avatar
Super Collaborator

Each host has its own endpoint: api/v1/clusters/<clusterName>/hosts/<hostName>

From this, you can look at various parts of the JSON response:

"host_state": "HEALTHY",
"host_status": "HEALTHY",
"ip": "192.168.64.103",
"last_agent_env": {},
"last_heartbeat_time": 1460383979229,
"last_registration_time": 1460135920315,

The state will move from HEALTHY to HEARTBEAT_LOST (or something else like UNHEALTHY) when an agent can't communicate. Also, there is a host heartbeat alert (called Ambari Agent Heartbeat) which you can leverage to send emails or SNMP traps when the server can't communicate with an agent.