diff --git a/Win/mini_ipmi_ohmr.py b/Win/mini_ipmi_ohmr.py index 6ad8c6b..2b54978 100755 --- a/Win/mini_ipmi_ohmr.py +++ b/Win/mini_ipmi_ohmr.py @@ -10,7 +10,6 @@ # path to zabbix agent configuration file agentConf = r'C:\zabbix_agentd.conf' -#agentConf = r'C:\zabbix\conf\zabbix_agentd.win.conf' #senderPath = r'zabbix_sender' senderPath = r'C:\zabbix-agent\bin\win32\zabbix_sender.exe' @@ -62,6 +61,16 @@ def getOutput(): else: error = 'CONFIGURED' + # Prevent empty results + m0 = 'Status: Extracting driver failed' + m1 = 'First Exception: OpenSCManager returned zero.' + m2 = 'Second Exception: OpenSCManager returned zero.' + if m0 in p or \ + m1 in p or \ + m2 in p: + print('OHMR failed. Try again.') + sys.exit(1) + return error, p