[Samba] samba-check-db-script python failure
L.P.H. van Belle
belle at bazuin.nl
Fri Apr 24 05:29:27 MDT 2015
Hai Bob.
SETDNSDOMAIN='hostname -d'
needs to be:
SETDNSDOMAIN=`hostname -d`
.. so change them all .
SETDNSDOMAIN=`hostname -d`
SETHOSTNAME=`hostname -s`
SERVER_IP_ADDRESS=`hostname -i`
and you can ignore :
>[....] Stopping domain name service...: bind9rndc: connect failed:
>127.0.0.1#953: connection refused
>
>. ok
>
>[ ok ] Starting domain name service...: bind9.
in the next script version you wont see these messages.
as long as you see..
>[ ok ] Starting domain name service...: bind9.
its ok.
Greetz,
Louis
>-----Oorspronkelijk bericht-----
>Van: bob at donelsontrophy.net
>[mailto:samba-bounces at lists.samba.org] Namens Bob of Donelson Trophy
>Verzonden: vrijdag 24 april 2015 13:17
>Aan: samba at lists.samba.org
>Onderwerp: Re: [Samba] samba-check-db-script python failure
>
>
>
>from DC1:
>
>root at dc01:~# cat /etc/hosts
>127.0.0.1 localhost localhost.localdomain
>192.168.16.51 dc01.dtsh***m.dt dc01
>root at dc01:~# cat /etc/resolv.conf
>search dtsh***m.dt
>nameserver 192.168.16.52
>nameserver 127.0.0.1
>root at dc01:~# kinit Administrator
>Password for Administrator at DTSH***M.DT:
>Warning: Your password will expire in 179 days on Tue Oct 20 20:38:48
>2015
>root at dc01:~# SETDNSDOMAIN='hostname -d'
>root at dc01:~# SETHOSTNAME='hostname -s'
>root at dc01:~# SERVER_IP_ADDRESS='hostname -i'
>root at dc01:~# echo "Test domainname: $SETDNSDOMAIN"
>
>Test domainname: hostname -d
>root at dc01:~# echo "Test Hostname: $SETHOSTNAME"
>Test Hostname: hostname -s
>root at dc01:~# echo "Test Ip_address: $SERVER_IP_ADDRESS"
>Test Ip_address: hostname -i
>
>root at dc01:~# dig A $SETHOSTNAME.$SETDNSDOMAIN @localhost
>Invalid option: -s.hostname
>Usage: dig [@global-server] [domain] [q-type] [q-class] {q-opt}
> {global-d-opt} host [@local-server] {local-d-opt}
> [ host [@local-server] {local-d-opt} [...]]
>
>from DC2:
>
>root at dc02:~# cat /etc/hosts
>127.0.0.1 localhost localhost.localdomain
>192.168.16.52 dc02.dtsh***m.dt dc02
>root at dc02:~# cat /etc/resolv.conf
>search dtsh***m.dt
>nameserver 192.168.16.52
>root at dc02:~# cat /etc/resolv.conf
>search dtsh***m.dt
>nameserver 192.168.16.51
>nameserver 127.0.0.1
>root at dc02:~# kinit Administrator
>Password for Administrator at DTSH***M.DT:
>Warning: Your password will expire in 179 days on Tue Oct 20 07:22:08
>2015
>root at dc02:~# SETDNSDOMAIN='hostname -d'
>root at dc02:~# SETHOSTNAME='hostname -s'
>root at dc02:~# SERVER_IP_ADDRESS='hostname -i'
>root at dc02:~# echo "Test domainname: $SETDNSDOMAIN"
>Test domainname: hostname -d
>root at dc02:~# echo "Test Hostname: $SETHOSTNAME"
>Test Hostname: hostname -s
>root at dc02:~# echo "Test Ip_address: $SERVER_IP_ADDRESS"
>Test Ip_address: hostname -i
>root at dc02:~# dig A $SETHOSTNAME.$SETDNSDOMAIN at localhost
>Invalid option: -s.hostname
>Usage: dig [@global-server] [domain] [q-type] [q-class] {q-opt}
> {global-d-opt} host [@local-server] {local-d-opt}
> [ host [@local-server] {local-d-opt} [...]]
>
>Use "dig -h" (or "dig -h | more") for complete list of options
>
>I am not clear as to what you wanted me to do with the bottom (what
>appeared to be a script, maybe?) section?
>
>And then I found "Invalid option: -s.hostname" interesting.
>
>In addition to the information you wanted. I reran the sernet install
>script on DC2 (fresh install) and discovered this:
>
>Setting up krb5-user (1.10.1+dfsg-5+deb7u3) ...
>
>==========Enable bind gssapi and bind9_DLZ
>===============================
>
>[....] Stopping domain name service...: bind9rndc: connect failed:
>127.0.0.1#953: connection refused
>
>. ok
>
>[ ok ] Starting domain name service...: bind9.
>
>==========Disable Printing ===============================
>
>This is output near the end of the install. Notice the "bindrndc:
>connect failed . . ." Might this have anything to do with my machine
>speed issues? Could this be what is breaking my DNS?
>---
>
>-------------------------
>
>Bob Wooden of Donelson Trophy
>
>615.885.2846 (main)
>www.donelsontrophy.com [1]
>
>"Everyone deserves an award!!"
>
>On 2015-04-24 01:43, L.P.H. van Belle wrote:
>
>> I upped 1.0.4 of the script..
>>
>> I added checks if no DC's are found, error message and exits script,
>> so no python errors anymore, if i did it right. ;-)
>>
>> on both DC's do the following.
>>
>> and whats the output of :
>> cat /etc/hosts
>> cat /etc/resolv.conf
>>
>> and
>> kinit Administrator
>> SETDNSDOMAIN=`hostname -d`
>> SETHOSTNAME=`hostname -s`
>> SERVER_IP_ADRESS=`hostname -i`
>>
>> echo "Test domainname: $SETDNSDOMAIN"
>> echo "Test Hostname : $SETHOSTNAME"
>> echo "Test Ip_address: $SERVER_IP_ADRESS"
>>
>> dig A $SETHOSTNAME.$SETDNSDOMAIN @localhost
>>
>> if [ -z "`host -t SRV _ldap._tcp.${SETDNSDOMAIN}. | grep
>'not found'`" ]; then
>> echo "testing of : host -t SRV _ldap._tcp.${SETDNSDOMAIN}. : ok"
>> else
>> echo "testing of : host -t SRV _ldap._tcp.${SETDNSDOMAIN}. : FAILED"
>> fi
>> if [ -z "`host -t SRV _kerberos._udp.${SETDNSDOMAIN}. | grep
>"not found" `" ]; then
>> echo "testing of : host -t SRV _kerberos._udp.${SETDNSDOMAIN}. : ok"
>> else
>> echo "testing of : host -t SRV
>_kerberos._udp.${SETDNSDOMAIN}. : FAILED"
>> fi
>> if [ -z "`host -t A ${SETHOSTNAME}.${SETDNSDOMAIN}. | grep
>"not found" `" ]; then
>> echo "testing of : host -t A ${SETHOSTNAME}.${SETDNSDOMAIN}. : ok"
>> else
>> echo "testing of : host -t A ${SETHOSTNAME}.${SETDNSDOMAIN}.
>: FAILED"
>> echo "trying to fix it now: "
>> samba-tool dns add ${SETHOSTNAME}.${SETDNSDOMAIN}
>${SETDNSDOMAIN} ${SETHOSTNAME} A ${SERVER_IP_ADRESS}
>> fi
>>
>> Greetz,
>>
>> Louis
>> -----Oorspronkelijk bericht----- Van: bob at donelsontrophy.net
>[mailto:samba-bounces at lists.samba.org] Namens Bob of Donelson
>Trophy Verzonden: donderdag 23 april 2015 19:42 Aan:
>samba at lists.samba.org Onderwerp: Re: [Samba]
>samba-check-db-script python failure Hum-m-m! nslookup on DC1
>can "find" DC2 and my member server and not itself. nslookup
>on DC2 can "find" DC1 and my member server but not itself. And
>(just because) nslookup on the member server can "find" DC1
>and itself but not DC2. And I have a meeting in a few and I
>will not get back to this until tonight. Suggestions? ---
>------------------------- Bob Wooden of Donelson Trophy
>615.885.2846 (main) www.donelsontrophy.com [1] [1 [1]]
>"Everyone deserves an award!!" On 2015-04-23 10:26, Rowland
>Penny wrote: On 23/04/15 16:22, Bob of Donelson Trophy wrote:
>I went and got the newest (upped recently) script. No love. I
>removed the email address line to get more command line
>output. root at dc01:~# ./samba-check-db-repl.sh Runnin
> g with
>with console output Running : /usr/bin/samba-tool ldapcmp
>--filter='whenChanged' ldap://dc01 ldap://dc02.dtsh***m.dt.
>Please wait.. this can take a while.. Failed to bind - LDAP
>error 49 LDAP_INVALID_CREDENTIALS - <SASL:[GSS-SPNEGO]:
>NT_STATUS_LOGON_FAILURE> <> Failed to connect to
>'ldap://dc02.dtsh***m.dt.' with backend 'ldap': (null)
>ERROR(ldb): uncaught exception - None File
>"/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py",
>line 175, in _run return self.run(*args, **kwargs) File
>"/usr/lib/python2.7/dist-packages/samba/netcmd/ldapcmp.py",
>line 968, in run outf=self.outf, errf=self.errf) File
>"/usr/lib/python2.7/dist-packages/samba/netcmd/ldapcmp.py",
>line 64, in __init__ options=ldb_options) File
>"/usr/lib/python2.7/dist-packages/samba/__init__.py", line
>114, in __init__ self.connect(url , flags, options) .. Next
>check.. Running : samba-tool drs showrepl
>./samba-check-db-repl.sh: line 284: [: 0: unary operator
>expected ./samba-check-db-repl.sh: line 287: [: 0: un
> ary
>operator expected Thoughts? --- ------------------------- Bob
>Wooden of Donelson Trophy 615.885.2846 (main)
>www.donelsontrophy.com [1] [1 [1]] [1 [1]] "Everyone deserves
>an award!!" On 2015-04-23 09:05, L.P.H. van Belle wrote: Hai
>Bob, ah.. LDAP_INVALID_CREDENTIALS, this is not a python
>error, but password error.. ;-) i upped a new version of
>samba-check-db-repl.sh ( direct link :
>https://secure.bazuin.nl/scripts/samba-check-db-repl.sh [2] [2
>[2]] [3 [2]]) small change in the install of the mail tools
>section. A bit info for this version. ## Version : 1.0.3 ##
>release d.d. : 22-04-2015 ## moved mailx part within checks if
>an e-mail adres is used. ## Samba database checker. ( DB check
>up to 10 samba DC's ) ## This script wil check for error in
>the samba databases with samba-tool ## NOTICE !! This script
>does only work with samba DC's ## A samba DC + Windows Dc wont
>work and is not tested, if you get that to work, ## please
>share the code ;-) The script wil find the DC with FSM
> O roles,
>and matches all other dc's with the one containing the FSMO
>roles. tested with samba 4.1.17 and 4.2.1 ( debian wheezy )
>Gr. Louis -----Oorspronkelijk bericht----- Van:
>bob at donelsontrophy.net [mailto:samba-bounces at lists.samba.org]
>Namens Bob of Donelson Trophy Verzonden: donderdag 23 april
>2015 15:48 Aan: SAMBA MailList Onderwerp: [Samba]
>samba-check-db-script python failure When I run
>./samba-check-db-repl.sh script I am getting the following:
>root at dc01:~# ./samba-check-db-repl.sh Failed to bind - LDAP
>error 49 LDAP_INVALID_CREDENTIALS - <SASL:[GSS-SPNEGO]:
>NT_STATUS_LOGON_FAILURE> <> Failed to connect to
>'ldap://dc02.dtsh**m.dt.' with backend 'ldap': (null)
>ERROR(ldb): uncaught exception - None File
>"/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py",
>line 175, in _run return self.run(*args, **kwargs) File
>"/usr/lib/python2.7/dist-packages/samba/netcmd/ldapcmp.py",
>line 968, in run outf=self.outf, errf=self.errf) File
>"/usr/lib/python2.7/dist-packages/samba/netcmd/ldapcmp.py",
>line 64, in __init__ options=ldb_options) File
>"/usr/lib/python2.7/dist-packages/samba/__init__.py", line
>114, in _ _ init__ self.connect(url, flags, options)
>./samba-check-db-repl.sh: line 257: [: 0: unary operator
>expected What would the "unary operator expected" issue be? --
>------------------------- Bob Wooden of Donelson Trophy
>615.885.2846 (main) www.donelsontrophy.com [1] [1 [1]] [1 [1]]
>[1 [1]] "Everyone deserves an award!!" Links: ------ [1 [1]]
>http://www.donelsontrophy.com [1] [1 [1]] [1 [1]] -- To
>unsubscribe from this list go to the following URL and read
>the instructions:
>https://lists.samba.org/mailman/options/samba [3] [3 [3]] [2
>[3]] Links: ------ [1] http://www.donelsontrophy.com [1] [1
>[1]] [2] https://lists.samba.org/mailman/options/samba [3] [3
>[3]] [3 [3]]
>https://secure.bazuin.nl/scripts/samba-check-db-repl.sh [2] [2
>[2]] DNS problem ?? Rowland Links: ------ [1]
>http://www.donelsontrophy.com [1
> ] [2]
>https://secure.bazuin.nl/scripts/samba-check-db-repl.sh [2]
>[3] https://lists.samba.org/mailman/options/samba [3] -- To
>unsubscribe from this list go to the following URL and read
>the instructions: https://lists.samba.org/mailman/options/samba [3]
>
>
>Links:
>------
>[1] http://www.donelsontrophy.com
>[2] https://secure.bazuin.nl/scripts/samba-check-db-repl.sh
>[3] 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