%!
import os
import sys
import datetime
import pprint
import time
import cmf.process
%>
<%def name="debug_pair(name, value)">
${name}
${value}
%def>
Cloudera Service and Configuration Manager Agent Status -- ${agent.cfg.reported_hostname}
Home |
Agent Log |
Firehoses Messages
Agent Metrics
Cloudera Service and Configuration Manager Agent ${version} -- ${agent.cfg.reported_hostname}
Agent Dir: ${agent.dir}
Resource Usage
Agent: CPU: ${ agent.process.cpu_times() } Memory: ${ agent.process.memory_info() } Runtime: ${ time.time() - agent.process.create_time() }
Supervisor: CPU: ${ agent.supervisor_client.psutil_process.cpu_times() } Memory: ${ agent.supervisor_client.psutil_process.memory_info() } Runtime: ${ time.time() - agent.supervisor_client.psutil_process.create_time() }
Agent threads:
## Sadly (http://code.google.com/p/psutil/issues/detail?id=186), these
## are not the same thread IDs as python's, so it's hard to tell who
## the culprit is.
% for t in agent.process.threads():
${t}
% endfor
Component Info
% if agent.cached_component_info:
% for c in agent.cached_component_info:
- ${str(c)}
% endfor
% endif
Processes
Active
% for process in cmf.process.Process.GetProcesses(lambda p: p.activated):
${process.name}
- Name
- ${process.name}
- State
<%
try:
supervisor_state = agent.supervisor_client.get_process_info(process.name)['statename']
except Exception, e:
supervisor_state = "Unknown: " + str(e)
%>
- ${ supervisor_state }
- Run Generation
- ${ process.raw.get('run_generation', "unknown") }
- Working Dir
- ${process.dir}
- Supervisor Config
- link
## For security, don't print process config links.
% if False:
- Process Configs
-
- Process Logs
-
% endif
- Status Pages
-
% for name, link in process.raw.get("status_links", {}).iteritems():
- ${name}
% endfor
## Show monitor status if monitoring is enabled
% if process.monitor is not None:
<%
try:
status_report = process.monitor.get_debug_status_report()
except Exception, e:
status_report = None
status_report_error = e
%>
- ${process.monitor}
-
% if status_report:
- Config:
% for k, v in status_report.config_items:
- ${k} -- ${v}
% endfor
- Stats:
% for k in sorted(status_report.stats.iterkeys()):
- ${k} -- ${status_report.stats[k]}
% endfor
% if status_report.last_collection_ended:
- Last collection ended: ${datetime.datetime.fromtimestamp(status_report.last_collection_ended)}
% endif
% if status_report.last_collection_length:
- Last collection length: ${status_report.last_collection_length}
% endif
## Show last 10 errors at most
% if status_report.errors:
- Errors:
% for err in status_report.errors[-5:]:
${err}
% endfor
% endif
% else:
Error: ${str(status_report_error)}
% endif
% endif
% endfor
Firehoses:
% for fhname, fhreport in agent.monitor_daemon.firehoses.get_debug_status_reports().items():
- ${fhname}:
-
% for k, v in fhreport.config_items:
- ${k} -- ${v}
% endfor
% endfor
Agent Detail
${debug_pair("Raw arguments", sys.argv)}
${debug_pair("Arguments (after defaults)", agent.cfg.show_config())}
${debug_pair("Last Successful Heartbeat", str(agent.last_successful_heartbeat and datetime.datetime.fromtimestamp(agent.last_successful_heartbeat)))}
${debug_pair("Last Heartbeat Request", pprint.pformat(agent.last_heartbeat_request))}
${debug_pair("Last Failed Heartbeat Request", pprint.pformat(agent.last_failed_heartbeat_request))}
## For security, don't print heartbeat response.
% if False:
${debug_pair("Last Heartbeat Response", pprint.pformat(agent.last_heartbeat_response))}
% endif
- Supervisor
-
PID: ${agent.supervisor_client.pid}
All Process Info:
${ pprint.pformat(agent.supervisor_client.get_all_process_info()) }