I want to monitor the service in my linux ubuntu device and create an alarm for this,
But I need a script to use Linux script temlate on SAM. I found the following script, but it didn't work, I get an unknown error.
{
#! /bin/bash
if [ $(ps aux | grep apache2 | wc -l) -gt 1 ]; then
echo "Statistic:0"
else
echo "Statistic:1"
fi
exit 0;
}