General discussion

  • Creator
    Topic
  • #2300495

    Monitoring Disk Space

    Locked

    by hanes_ray ·

    Is there a good utility out there for monitoring disk space. Since linux doesn’t warn you I’d like something that will tell me when a systems disk is full.

All Comments

  • Author
    Replies
    • #3522388

      Monitoring Disk Space

      by woody ·

      In reply to Monitoring Disk Space

      cron will send you (root) any output from scripts run by cron. (No output, no report) So create a script (diskcheck.sh) in /etc/cron.daily and put in it:
      #!/bin/sh
      # Get the remaining percent of drive space and
      # report if it is below the warning threshhold

      # Percent space remain threshold (integer with NO ‘%’ sign
      WARNLVL=15
      # Space delimited list of drives to check. eg: “/ /var /home”
      DRIVELIST=”/ /home”

      WARNING=””
      for DRIVE in $DRIVELIST ; do
      PCT=`df -h $DRIVE | grep -v Filesystem | sed ‘s@[[:space:]]\{1,\}@ @g’ | cut -d \ -f5 | sed s@%@@`
      if (($PCT < $WARNLVL)) ; then WARNING="$WARNING$DRIVE is low on space! ($PCT Remaining) " fi done if [ "$WARNING" != "" ]; thenecho $WARNING fi # End script Do not forget to set the script executable: chmod 755 /etc/cron.daily/diskcheck.sh

      • #3522386

        Monitoring Disk Space

        by woody ·

        In reply to Monitoring Disk Space

        the PCT=`…` line should be all on one line to the final @ symbol with its trailing back tick (`)

      • #3526826

        Monitoring Disk Space

        by hanes_ray ·

        In reply to Monitoring Disk Space

        Poster rated this answer

    • #3540274

      Monitoring Disk Space

      by servermonkey ·

      In reply to Monitoring Disk Space

      I use nagios (www.nagios.org) with snmp configured on each server monitored. I query the oid’s for each file system every 15 min. to poll disk usage.

    • #3540619

      Monitoring Disk Space

      by jerome ·

      In reply to Monitoring Disk Space

      in addition to woody’s script i suggest adding
      this line..

      mail your_email_addr < $VAR_THAT_HOLDS_RESULT this would eliminate the user to constantly executing the script... and would just wait for the mail every morning... hmm.. and one more thing it would be best if it would mail the disk space status without any constraint.. no more warning level..

    • #3534328

      Monitoring Disk Space

      by mtuppen ·

      In reply to Monitoring Disk Space

      We use Big Brother (from bb4.com) to monitor our servers – including disk space. This would be overkill for just 1 server, but it is great for monitoring many servers.

      If you wanted to, you could also look for a linux disk checking solution at freshmeat.net

      Regards,
      Mike.

    • #3526825

      Monitoring Disk Space

      by hanes_ray ·

      In reply to Monitoring Disk Space

      This question was closed by the author

Viewing 4 reply threads