Monitoring services of EC2 Windows Service status running/stopped using AWS CloudWatch

I want to configure CloudWatch metrics for my ec2 windows server for fetching details of running and stopped services details. and need to trigger the alarm if the service is not running.

I have tried this one "Monitoring services of EC2 Windows instance using AWS CloudWatch" and I could get the status of a specified service, but I would like to automate this using user data commands input while launching the instance. Is this possible?

Source: Windows Questions