Monit alert script7/14/2023 NOTE: Before you schedule this script please change ADMIN Email address and Threshold value. If <<– This IF condition will validate the space, which is provided by the above command then number greater then or equal to 90 it will trig an alert using mail command to your given ADMIN address. # Validate the Percentage of Disk space #ĭISK_AVAIL=`/bin/df -k / | grep -v Filesystem |awk '’ |sed ‘s/%//g’ <<– This line will calculate the disk space in percentage number # Change ADMIN Mail address as per the requirement path in $PATHS # You can change your threshold value whatever you want # ![]() # Disk Space Monitoring Script Get Email Alert # It will send an email to $ADMIN, if the (free available) percentage # Shell script to monitor or watch the low-disk space ![]() Your script log is located here System Logs System Log Script Log Statement. Since we are targeting incidents, we choose Incident incident. Then we must define which table to run the business rule against. ![]() Disk Space Monitoring Script And Get Email Alert when CRITICAL, When Disk space is reached more than threshold value. So for our business rule it will be Teams monitalert pri1. I hope this disk space monitoring script will help to monitor the disk space. I was able to automate this with a shell script and a cron job by evaluating the output of monit report and it’s working pretty well I was initially attempting to do this in Monit (trying to get it to alert to an HTTP endpoint with this basic check, versus sending an email) but I was unable to find a way. Most of the environments (small environments) they are not effort to buy a monitoring tools in this case, scripting will come handy to monitor your environment.
0 Comments
Leave a Reply. |