Chapter 26. check_filesystems.hpux.sh

#!/bin/sh

df -P | grep -v ^Filesystem | awk '{print $5,$6}'| \
THRESHOLD=80 /usr/bin/perl -na -F"%\s" -e '$percent = $F[0]; $filesystem = $F[1];
if ($percent > $ENV{THRESHOLD}) {
    chomp $filesystem;
    $hostname = `hostname`;
    chomp $hostname;
    print "$hostname:${filesystem} is at ${percent}%.  \n" or die "3";
}'