mirror of
https://github.com/samba-team/samba.git
synced 2025-02-08 05:57:51 +03:00
check winbind in monitoring event too
(This used to be ctdb commit bccba656c21d0edbd9840401a3c43a76b1b3bc05)
This commit is contained in:
parent
d683080b08
commit
9d0a595594
@ -65,6 +65,9 @@ case $cmd in
|
|||||||
|
|
||||||
smb_ports=`testparm -sv 2> /dev/null | egrep '\s*smb ports =' | cut -d= -f2`
|
smb_ports=`testparm -sv 2> /dev/null | egrep '\s*smb ports =' | cut -d= -f2`
|
||||||
ctdb_check_tcp_ports "Samba" $smb_ports
|
ctdb_check_tcp_ports "Samba" $smb_ports
|
||||||
|
|
||||||
|
# check winbind is OK
|
||||||
|
ctdb_check_command "winbind" "wbinfo -p"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
@ -162,3 +162,17 @@ ctdb_check_tcp_ports() {
|
|||||||
}
|
}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
# check a command returns zero status
|
||||||
|
# usage: ctdb_check_command SERVICE_NAME <command>
|
||||||
|
######################################################
|
||||||
|
ctdb_check_command() {
|
||||||
|
service_name="$1"
|
||||||
|
wait_cmd="$2"
|
||||||
|
[ -z "$wait_cmd" ] && return;
|
||||||
|
$wait_cmd > /dev/null 2>&1 || {
|
||||||
|
echo "`date` ERROR: $service_name - $wait_cmd returned error"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user