[Samba] samba4 check database replication script. samba-check-db-repl.sh

L.P.H. van Belle belle at bazuin.nl
Mon Mar 23 04:31:12 MDT 2015

I have created a new script for checking samba DC database replications. 
I have tested with 2 DC's , if there people with more than 2 DCs, and want to test for me, would be great. 
I tested on debian wheezy, but should work on any apt-get capable os.  ( but not tested ) 

What it does.. 
- auto detects the DC in you network. 
- detects the DC met FSMO roles and compairs this db with all other DC's.  
    ( based on : 1 DC is running all the FSMO roles ) 
- compaires with different settings. 
    samba-tool drs showrepl and  samba-tool ldapcmp --filter="whenChanged" 
- you can set these check on or off per check.
- automatic checks for needed programs and installs when not found.
- installs all needed programs without any questions asked.

- e-mail reporting when errors are found.  ( default only on errors found ) 
- if no sendmail program is found, installs postfix and sets relayhost for you if needed.
    postfix wil be running on localhost only
    relayhost is not needed if you have a "correct" dns setup. 
- can run as cron job, if administrator password is suppied in the script.
- run it without email address for console output only
- asks for Administrator password if not supplied in the script.
- colored output on console. 
- can run by change-ing only the "CONFIGURED=no" to yes

get it here: 
wget --no-check-certificate https://secure.bazuin.nl/scripts/samba-check-db-repl.sh

Let me know what you think of this one..  
Suggestions are always welkom. 

More information about the samba mailing list