mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
ctdb-scripts: Improve error messages when using NFS service_check_cmd
When external monitoring is enabled for an NFS service using service_check_cmd then $ctdb_check_rpc_out is empty because the internal RPC checking isn't used. This results in empty log messages like: 60.nfs: ERROR: or: 60.nfs: WARNING: Improve this so it at least says: 60.nfs: ERROR: monitoring service "statd" failed Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
59c71646ff
commit
84fdc2a562
@ -168,11 +168,15 @@ nfs_check_service ()
|
||||
# Using eval means variables can contain semicolon separated commands
|
||||
if eval "$service_check_cmd" ; then
|
||||
_ok=true
|
||||
else
|
||||
_err="monitoring service \"${_progname}\" failed"
|
||||
fi
|
||||
else
|
||||
if nfs_check_rpcinfo \
|
||||
"$_progname" "$version" "$family" >/dev/null ; then
|
||||
_ok=true
|
||||
else
|
||||
_err="$ctdb_check_rpc_out"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -190,14 +194,14 @@ nfs_check_service ()
|
||||
if [ $unhealthy_after -gt 0 ] ; then
|
||||
if [ $_failcount -ge $unhealthy_after ] ; then
|
||||
_unhealthy=true
|
||||
echo "ERROR: $ctdb_check_rpc_out"
|
||||
echo "ERROR: $_err"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $restart_every -gt 0 ] ; then
|
||||
if [ $(($_failcount % $restart_every)) -eq 0 ] ; then
|
||||
if ! $_unhealthy ; then
|
||||
echo "WARNING: $ctdb_check_rpc_out"
|
||||
echo "WARNING: $_err"
|
||||
fi
|
||||
nfs_restart_service
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user