Use cloudwatch to determine if linux service is running
问题 Suppose I have an ec2 instance with service /etc/init/my_service.conf with contents script exec my_exec end script How can I monitor that ec2 instance such that if my_service stopped running I can act on it? 回答1: You can publish a custom metric to CloudWatch in the form of a "heart beat". Have a small script running via cron on your server checking the process list to see whether my_service is running and if it is, make a put-metric-data call to CloudWatch. The metric could be as simple as