[Samba] Continuous Normalisation error for attribute whenCreated when performing dbcheck

Rowland Penny rowlandpenny at googlemail.com
Fri Oct 17 04:19:48 MDT 2014


On 17/10/14 08:51, L.P.H. van Belle wrote:
> so i changed it a bit.
> corrected the $x in thte loop, and make te loop work for more DC's.
> change the mail line for the report, and the cat command was not needed.
>
>
> #!/bin/sh
>
> ## the email adress to report to.
> SETMAILREPORT=YOUR at emaildomain.tld
>
> ## First DC ( hostname or ipadres )
> SETDCFSMO="dc1"
> ## Second DC ( hostname or ipadres more then 2 DC's, separated by space )
> SETOTHERDCS="dc2"
>
> SETSAMBATOOLS=`which samba-tool`
> SETREMOVELOG=yes
>
> for x in $SETOTHERDCS ; do
>      $SETSAMBATOOLS ldapcmp --filter="whenChanged" ldap://$SETDCFSMO ldap://$x  -d0 2>&1 >> /tmp/samba_ldapcmp_checkdb
>      if grep -q FAILURE /tmp/samba_ldapcmp_checkdb; then
>         mail -s "FAILURE ldapcmp between $SETDCFSMO and $SETOTHERDCS" $SETMAILREPORT < /tmp/samba_ldapcmp_checkdb
>      fi
>      if [ $SETREMOVELOG = yes ]; then
>          rm /tmp/samba_ldapcmp_checkdb
>      fi
> done
Hi Louis, I take it you realise you could get multiple emails if you 
have more than 2 DC's and a failure does occur on the other DC's.

For instance, you have 3 DC's (dc1,dc2,dc3) and there are problems on 
dc2 & dc3, on the first pass, dc1 & dc2 are compared and the result is 
placed into /tmp/samba_ldapcmp_checkdb, this is checked for 'FAILURE' 
and when found an email is sent, so far so good. Now dc1 & dc3 are 
compared and the result is placed into /tmp/samba_ldapcmp_checkdb, this 
is checked for failure and another email is sent.

Do you really want to do this ?

By the way, if do it the way you have it now, you could go back to one 
'>' before /tmp/samba_ldapcmp_checkdb, you should also probably move the 
last 'if' statement out of the 'do - done' stanza.

Rowland

>
>
>> -----Oorspronkelijk bericht-----
>> Van: belle at bazuin.nl [mailto:samba-bounces at lists.samba.org]
>> Namens L.P.H. van Belle
>> Verzonden: vrijdag 17 oktober 2014 9:38
>> Aan: samba at lists.samba.org
>> Onderwerp: Re: [Samba] Continuous Normalisation error for
>> attribute whenCreated when performing dbcheck
>>
>> GOOD MORNING ALL..
>>
>> Your totaly right Rowland..
>> i have only 2 dc's so it worked ... ;-) i corrected it.
>> thank you for reporting it.
>>
>> Greetz,
>>
>> Louis
>>
>>
>>> -----Oorspronkelijk bericht-----
>>> Van: rowlandpenny at googlemail.com
>>> [mailto:samba-bounces at lists.samba.org] Namens Rowland Penny
>>> Verzonden: donderdag 16 oktober 2014 16:00
>>> Aan: samba at lists.samba.org
>>> Onderwerp: Re: [Samba] Continuous Normalisation error for
>>> attribute whenCreated when performing dbcheck
>>>
>>> On 16/10/14 12:21, L.P.H. van Belle wrote:
>>>> yes..
>>>>
>>>> the attibute "whenCreated" is not synced ( correctly)
>>>> there is a bug report of this.
>>>>
>>>> you can use this script: ( original created by Mourit Jan of
>>> the samba list )
>>>> used on debian/ubuntu
>>>>
>>>>
>>>> #!/bin/sh
>>>>
>>>> ## the email adress to report to.
>>>> SETMAILREPORT=your at emaildomain.tld
>>>>
>>>> ## First DC ( hostname or ipadres ) ( The DC with the FSMO Roles )
>>>> SETDCFSMO="dc1"
>>>> ## Second DC ( hostname or ipadres more then 2 DC's,
>>> separated by space )
>>>> SETOTHERDCS="dc2"
>>>>
>>>> SETSAMBATOOLS=`which samba-tool`
>>>> SETREMOVELOG=yes
>>>>
>>>> for x in $SETOTHERDCS ; do
>>>>       $SETSAMBATOOLS ldapcmp --filter="whenChanged"
>>> ldap://$SETDCFSMO ldap://$x
>>>                                                                
>>>                                  -d0 2>&1 >
>>> /tmp/samba_ldapcmp_checkdb
>>>> done
>>>>
>>>> if grep -q FAILURE /tmp/samba_ldapcmp_checkdb; then
>>>>      cat /tmp/samba_ldapcmp_checkdb | mail -s "FAILURE
>>> ldapcmp between $SETDCFSMO
>>>                                                                
>>>                              and $SETOTHERDCS" $SETMAILREPORT
>>>> fi
>>>>
>>>> if [ $SETREMOVELOG = yes ]; then
>>>>       rm /tmp/samba_ldapcmp_checkdb
>>>> fi
>>>>    
>>>>
>>>>> -----Oorspronkelijk bericht-----
>>>>> Van: aoster at novanetwork.de
>>>>> [mailto:samba-bounces at lists.samba.org] Namens Andreas Oster
>>>>> Verzonden: donderdag 16 oktober 2014 11:08
>>>>> Aan: samba at lists.samba.org
>>>>> Onderwerp: [Samba] Continuous Normalisation error for
>>>>> attribute whenCreated when performing dbcheck
>>>>>
>>>>> Hi all,
>>>>>
>>>>> since the migration of our old Win2k domain to Samba4 some
>> years ago
>>>>> I get a lot of errors like the following when doing a
>>>>> "samba-tool dbcheck --cross-ncs --fix" :
>>>>>
>>>>>
>>>>> ERROR: Normalisation error for attribute whenCreated in
>>>>> CN=rpc-Ns-Group,CN=Schema,CN=Configuration,DC=samdom,DC=com
>>>>> value '19700101000000.0Z' should be '16010101000000.0Z'
>>>>> Fix normalisation for whenCreated from
>>>>> CN=rpc-Ns-Group,CN=Schema,CN=Configuration,DC=samdom,DC=com? [YES]
>>>>> Normalised attribute whenCreated
>>>>>
>>>>>
>>>>> This repeats 1000+ times for many different entries.
>>>>>
>>>>> The samba-tool unfortunately does not fix the issue because
>>>>> when I start
>>>>> it a second time it will complain again, this time with
>>> values switched
>>>>> around:
>>>>>
>>>>> value '16010101000000.0Z' should be '19700101000000.0Z'
>>>>>
>>>>>
>>>>> Does anyone have an idea how to fix this ?
>>>>>
>>>>> Thank you very much for your kind help.
>>>>>
>>>>> best regards
>>>>>
>>>>> Andreas
>>>>>
>>>>> -- 
>>>>> To unsubscribe from this list go to the following URL and read the
>>>>> instructions:  https://lists.samba.org/mailman/options/samba
>>>>>
>>>>>
>>> Hi Louis, I have had a look at the script you posted (after I put it
>>> back together, it arrived here a bit disjointed ;-) )
>>>
>>> Just a few comments:
>>>
>>> This line:
>>>
>>> $SETSAMBATOOLS ldapcmp --filter="whenChanged" ldap://$SETDCFSMO
>>> ldap://$SETOTHERDCS  -d0 2>&1 > /tmp/samba_ldapcmp_check
>>>
>>> Shouldn't '$SETOTHERDCS'  be '$x' ?
>>>
>>> If you have more than two DC's, shouldn't the redirection sign '>'
>>> before '$SETOTHERDCS ' actually be two i.e. '>>' ?
>>>
>>> I take it that the idea is to get cron to run it, as & when.
>>>
>>> finally, I had to rewrite the script slightly, sending the
>>> result by the
>>> 'mail' program wouldn't work for me, so I ended up using 'ssmtp'
>>>
>>> Rowland
>>>
>>> -- 
>>> To unsubscribe from this list go to the following URL and read the
>>> instructions:  https://lists.samba.org/mailman/options/samba
>>>
>>>
>> -- 
>> To unsubscribe from this list go to the following URL and read the
>> instructions:  https://lists.samba.org/mailman/options/samba
>>
>>



More information about the samba mailing list