I am very new to zabbix and need a bit of assistance with creating actions.
What I would like to do is if a service e.g. lets say a windows service stops, it could be any one of the discovered services on my windows host. I would like to restart that service and send an email to the zabbix administrator when the service has restarted successfully.
So I have created an action that if Trigger severity = high, to send an email to the admin. This works fine!!
The problem I am having is I want to restart the failed service and send an acknowledgement email on successful restart of that failed service.
The problem is I don't know what to put in the operation details.
I was thinking of using remote commands, I have enabled remote commands on my windows host.
Operation type = remote command
Target list = current host
Type = custom script
Execute on Zabbix agent
Commands - I don't know what to put here?? I am using SC commands here. So I would enter:
sc start "servicename"
So if the Spooler service stopped, I would put:-
sc start "Spooler"
This works fine, if I know what service has stopped and enter the servicename. What happens when I don't know what service has stopped? Zabbix will have a trigger to say a particular service has stopped and the severity has gone to high for that service.
Are there some commands I can enter here that say, find the stopped service and restart it then send an email on success?
Any assistance would be much appreciated.
What I would like to do is if a service e.g. lets say a windows service stops, it could be any one of the discovered services on my windows host. I would like to restart that service and send an email to the zabbix administrator when the service has restarted successfully.
So I have created an action that if Trigger severity = high, to send an email to the admin. This works fine!!
The problem I am having is I want to restart the failed service and send an acknowledgement email on successful restart of that failed service.
The problem is I don't know what to put in the operation details.
I was thinking of using remote commands, I have enabled remote commands on my windows host.
Operation type = remote command
Target list = current host
Type = custom script
Execute on Zabbix agent
Commands - I don't know what to put here?? I am using SC commands here. So I would enter:
sc start "servicename"
So if the Spooler service stopped, I would put:-
sc start "Spooler"
This works fine, if I know what service has stopped and enter the servicename. What happens when I don't know what service has stopped? Zabbix will have a trigger to say a particular service has stopped and the severity has gone to high for that service.
Are there some commands I can enter here that say, find the stopped service and restart it then send an email on success?
Any assistance would be much appreciated.
Comment