[PATCH] CSV output for "samba-tool drs showrepl"
abartlet at samba.org
Wed Oct 24 18:45:16 UTC 2018
On Wed, 2018-10-24 at 17:20 +0200, Flavio Stanchina via samba-technical
> This patch adds CSV output (option --csv) to "samba-tool drs
> The output is meant to be equivalent to:
> repadmin /showrepl /csv
> We use this to monitor our Samba DCs with Check_MK; the AD
> plugin for Windows ("ad_replication.bat") sends CSV output and it
> easy to add it to "drs showrepl".
> For those interested, the Check_MK plugin for the Linux agent is
> # ad_replication.sh
> # Needs patched samba-tool!
> echo '<<<ad_replication>>>'
> samba-tool drs showrepl --csv 2>/dev/null
> The patch is against Samba version 4.6.7, currently used by Zentyal
> and Ubuntu artful. I know it's not the latest version; I can reapply
> on a more recent version if needed, but you're probably better
> than me to do that.
> Hope you find it useful.
Since Samba 4.9 we have a --json output, and we are moving to JSON as
our text-based interchange format. While not matching the windows tool
you mention, it should help your use case.
That isn't to say we absolutely couldn't have a --csv option (say if
there are common scripts around the windows tool), but I would be more
cautious as it it isn't as structured. It would also need (reliable!)
If you still wanted to go forward with it then rebasing it on master
and writing those tests would be the first step.
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
More information about the samba-technical