Hi!
@dogz said in Please give the example how to restart the remote service automatically:
I would like to know the problem is due to the web service stop or the web service is started but can't response (maybe Apache daemon is dead) or due to the programming failure or the web page is changed by crackers and so on.
You should monitor multiple things and react to them differently. First, you should monitor state of Apache service via System.ServiceState parameter. If it is not running, you can automatically restart it using actions. Also, you probably should monitor that your web server responds correctly to HTTP requests. You can done it by creating network service under web server node, or by using ServiceCheck.HTTP agent's parameter. Search the forum, there should be instructions about network service configuration. Also, if you have static web pages, you might want to monitor that they are not changed by using ESC subagent - it provides checksum calculation for web pages.
Best regards,
Victor