change healthcheck to send 0 or 1 to telegraf for zeek restart

This commit is contained in:
m0duspwnens
2020-04-14 12:57:54 -04:00
parent 69031ab6b2
commit f2980d7e09

View File

@@ -78,12 +78,14 @@ def zeek():
retcode = __salt__['zeekctl.status'](verbose=False)
logging.debug('healthcheck_module: zeekctl.status retcode: %i' % retcode)
if retcode:
zeek_restart = True
zeek_restart = 1
if calling_func != 'beacon':
docker_stop('so-zeek')
states_to_apply.append('zeek')
else:
zeek_restart = False
zeek_restart = 0
__salt__['telegraf.send']('healthcheck zeek_restart=%i' % zeek_restart)
if calling_func == 'execute' and zeek_restart:
apply_states()
@@ -91,5 +93,4 @@ def zeek():
retval.append({'zeek_restart': zeek_restart})
send_event('so/healthcheck/zeek', retval)
__salt__['telegraf.send']('healthcheck zeek_restart=%s' % str(zeek_restart))
return retval