Auto restart Windows service using zabbix

In the event that a critical application service stops unexpectedly or fails to start up for unknown reasons or your web server fails to respond and you are no where near your system, you can setup zabbix to proactively restart such services. For the purpose of this post, I will configure zabbix to restart ‘Active Directory Domain Service‘ when service goes down. – Log onto zabbix → click on Configuration/Actions → click Create action (top right corner) → Enter Action name and leave rest as default – Click on Conditions tab → Leave condition label (A) → remove any other conditions and add a new Trigger condition (new condition would be ‘Trigger = ) → click Add to add the new condition – Click on Operations tab → Operation type is ‘Remote command’ → Enter new Target as ‘Current host’ → Type equals ‘Custom script’ → Execute equals ‘Zabbix agent’ → Command enter ‘cmd /c “net start “NTDS”‘ → click Add to add the new reactive action → save the configuration – To test this, simply stop the ‘Active Directory Domain Service‘ → Wait for few seconds and check if service had restarted → To confirm this test, below is the log in the agent log file: [box type="