{"id":2209,"date":"2017-12-08T04:49:49","date_gmt":"2017-12-08T04:49:49","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2209"},"modified":"2020-01-09T09:45:37","modified_gmt":"2020-01-09T09:45:37","slug":"shellscript-to-monitor-available-disk-space-on-aix","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/shellscript-to-monitor-available-disk-space-on-aix\/","title":{"rendered":"ShellScript to monitor available disk space on AIX"},"content":{"rendered":"<p><strong>tpatil created the topic: ShellScript to monitor available disk space on AIX<\/strong><br \/>\n<code>#!\/bin\/ksh<\/p>\n<p># This script monitors available disk space.<br \/>\n# This script emails an alert when a locally mounted partition crosses a given threshold.<br \/>\n# Set your threshold percentage (do not include the % sign), email address, and excluded mount points, then add to crontab<br \/>\n# TPatil 03\/12\/10<br \/>\n#<br \/>\n# Add this to crontab -e for root<br \/>\n# Diskspace monitoring script<br \/>\n#0 6 * * 1-5 \/bin\/diskMonitor.sh >\/dev\/null 2>&1<\/p>\n<p>THRESHOLD=\"90\"<br \/>\nEMAIL=\"abc@abc.com\"<br \/>\n# Excluded mount points *must* be pipe delimited<br \/>\n# \"\/proc|\/export\/home|Mounted\" should always be included<br \/>\nEXCLUDE=\"\/proc|\/export\/home|Mounted\"<\/p>\n<p>df -k | awk '{print $7\"\\t\"$4}' |egrep -v \"(${EXCLUDE})\" | while read LINE; do<br \/>\n PERC=`echo $LINE |awk '{print $2}' |cut -d\"%\" -f1`<br \/>\n if [ $PERC -gt $THRESHOLD ]; then<br \/>\n   echo \"${PERC}% ALERT\" | \/usr\/bin\/mail -s \"Disk Space Alert: ${LINE} used on `hostname`\" $EMAIL<br \/>\n fi<br \/>\ndone<\/code><\/p>\n<p><strong>scmjobs replied the topic: Re: ShellScript to monitor available disk space on AIX<\/strong><br \/>\nthanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>tpatil created the topic: ShellScript to monitor available disk space on AIX #!\/bin\/ksh # This script monitors available disk space. # This script emails an alert when a locally mounted&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[454],"tags":[462],"class_list":["post-2209","post","type-post","status-publish","format-standard","hentry","category-shell-script","tag-shellscript"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2209"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2209\/revisions"}],"predecessor-version":[{"id":2210,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2209\/revisions\/2210"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}