CloudWatch Alarms based on file existence in Ec2

Viewed 125

I have a requirement to monitor for a specific file in the /mnt/file-i-need-to-monitor.txt path where I need to;

  1. Create alarms if the file doesn't exist anymore.
if [ ! -f /mnt/file-i-need-to-monitor.txt ]; then
    // create aws alarm and notify via an email
fi

How can I integrate this methodology?

I have looked into the aws log agent but it seems like it is for pushing any custom logs to a log group.

Can someone help me fix this?

1 Answers
Related