|
@@ -57,12 +57,13 @@ class FlumeHandler(Script):
|
|
env.set_params(params)
|
|
env.set_params(params)
|
|
|
|
|
|
processes = flume_status()
|
|
processes = flume_status()
|
|
|
|
+ expected_agents = find_expected_agent_names()
|
|
|
|
|
|
json = {}
|
|
json = {}
|
|
json['processes'] = processes
|
|
json['processes'] = processes
|
|
json['alerts'] = []
|
|
json['alerts'] = []
|
|
|
|
|
|
- if len(processes) == 0 and len(find_expected_agent_names()) == 0:
|
|
|
|
|
|
+ if len(processes) == 0 and len(expected_agents) == 0:
|
|
alert = {}
|
|
alert = {}
|
|
alert['name'] = 'flume_agent'
|
|
alert['name'] = 'flume_agent'
|
|
alert['label'] = 'Flume Agent process'
|
|
alert['label'] = 'Flume Agent process'
|
|
@@ -87,9 +88,10 @@ class FlumeHandler(Script):
|
|
|
|
|
|
self.put_structured_out(json)
|
|
self.put_structured_out(json)
|
|
|
|
|
|
- if 0 == len(processes):
|
|
|
|
- raise ComponentIsNotRunning()
|
|
|
|
- else:
|
|
|
|
|
|
+ # only throw an exception if there are agents defined and there is a
|
|
|
|
+ # problem with the processes; if there are no agents defined, then
|
|
|
|
+ # the service should report STARTED (green) instead of INSTALLED (red)
|
|
|
|
+ if len(expected_agents) > 0:
|
|
for proc in processes:
|
|
for proc in processes:
|
|
if not proc.has_key('status') or proc['status'] == 'NOT_RUNNING':
|
|
if not proc.has_key('status') or proc['status'] == 'NOT_RUNNING':
|
|
raise ComponentIsNotRunning()
|
|
raise ComponentIsNotRunning()
|