3 Replies Latest reply on May 28, 2016 10:13 AM by aLTeReGo

    Return Linux root space from Perl script into email alert

    chris3264

      We have a number of Linux servers and like a number of discussions, it SNMP doesn't take into account the reserved memory off the root partition.

       

      I've found a Perl script that works well to poll the space left as the OS sees it.

       

      #!/usr/bin/perl

      @stat=split(" ",`df -Pm | grep "\/\$"`);

      $exit=`echo $?`;

      if ( $exit == 0 ) {

              print "Message: Available space on / partition in MB : $stat[3]\n";

              print "Statistic: $stat[3]\n";

              exit 0;

              }

      print "Message: ERROR: Check the command (df) syntax in script.\n";

      exit 1;

       

      Is there a way to have the returned value of available space included in the generated email notification?

       

      Thanks for your help !

       

      Linux Drive Monitors not Accounting for Reserved Space

      Need help with a Perl script please!