Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026:ย Sept. 14-17ย in St. Paul, MN |ย Learn More
Hey nice work. I wrote a little wrapper for this to check on every mount point. A little more dynamic for systems where a mount point may get missed by accident.
#! /bin/bash
# Wrapper script for check_hdd_inodes # Checks all mount points in one easy output
if [ $# -ne 2 ] then echo “Usage: $0 [warn %] [crit %]” exit 3 fi
loc=”/usr/local/bin/check_hdd_inodes” out=””
for s in `df -ilP | cut -d”%” -f2 | grep “/”` do getStat=`$loc -w $1 -c $2 -p $s` out=`echo -e “$getStat $out”` done out=`echo “$out” | sed s/”|”/”n “/g`
if [ `echo “$out” | cut -d”;” -f1 | grep CRITICAL | wc -l` -gt 0 ] then echo -e “CRITICAL: inodes above $1 % threshold. Click service name for more info.
$out” exit 2 elif [ `echo “$out” | cut -d”;” -f1 | grep WARNING | wc -l` -gt 0 ] then echo -e “WARNING: inodes above $1 % threshold. Click service name for more info.
$out” exit 1 elif [ `echo “$out” | cut -d”;” -f1 | grep OK | wc -l` -gt 0 ] then echo -e “OK: inodes below thresholds. Click service name for more info.
$out” exit 0 fi
echo “Oops; something went wrong :(” exit 3