Hello,
i am using checkmk enterprise (1.6.0p11) and i want to monitor nfs mounts on AIX 7.2 using the AIX agent. As far as I can see the following section in the agent code is intended for this:
# Check for hanging NFS mounts. This needs a GNU stat installed in the PATH
if type stat >/dev/null 2>&1 ; then
echo '<<<nfsmounts>>>'
mount | grep ' nfs' | awk '{print $3;}' | \
while read MP
do
waitmax 5 stat -f -c '"'$MP' ok - - - -"' "$MP" || \
echo "$MP hanging 0 0 0 0"
done
Unfortunately, the stat command does not exist on our AIX systems. Does anyone know if this can be installed? Does it currently work for anyone?
Okay, I’ve already figured it out. If you run the agent script as root user, it’ll find the stat command. But if the agent script is executed remotely by checkmk over inet.d, it won’t find the command. Workaround now was to put the stat path into the .profile of the root user. But I am looking for a better way to extend the PATH variable for the agent script.
Hello, Simon,
/etc/environment we had already tried. So the stat command was in the path of the root user, but only if you logged in via ssh. The checkmk-script nevertheless did not have the command in the path.
Then we just copied the stat command to /usr/bin and now everything works.
Maybe it would have worked to adjust the path variable in /etc/profile, but we didn’t try that anymore.
Thanks for your help!