# Nitty gritty - monitoring and IP handling
GANRECDIR="/var/lib/nfs/ganesha"
-GANRECDIR3="/var/lib/nfs/ganesha_local"
# Return 'active' if the shared filesystem is accessible.
get_cluster_fs_state ()
if [ ! -e "$GANRECDIR" ]; then
ln -sv "$_link_dst" "$GANRECDIR"
fi
-
- mkdir -p "$GANRECDIR3"
}
service_check ()
return 1
fi
- # Check red conditions against limit
- _reds_max=2
- _reds=$(ls $GANRECDIR3 | grep -c "red")
-
- if [ $_reds -ge $_reds_max ] ; then
- echo "Too many red conditions (${_reds}/${_reds_max})"
- return 1
- fi
-
- # Check for stall
- _stall_max=120
- _now=$(date +"%s")
- _last=$(ls -t $GANRECDIR3 | sed -n -e '1s@_.*@@p')
- [ -n $_last ] || _last=$_now # Handle startup
- _stall=$(($_now - $_last))
- if [ $_stall -ge $_stall_max ] ; then
- echo "ERROR: Stalled for ${_stall} second(s)"
- return 1
- fi
-
return 0
}