Improve ContextCSN error messages
This commit is contained in:
parent
2ece7b0cab
commit
43df1e8de3
1 changed files with 22 additions and 9 deletions
|
@ -398,11 +398,16 @@ if options.nagios:
|
||||||
errors=[]
|
errors=[]
|
||||||
|
|
||||||
if not options.nocheckcontextcsn:
|
if not options.nocheckcontextcsn:
|
||||||
for srv in LdapServersCSN:
|
if not LdapServersCSN[options.provider]:
|
||||||
if srv==options.provider:
|
errors.append('ContextCSN of LDAP server provider could not be found')
|
||||||
continue
|
else:
|
||||||
if LdapServersCSN[srv]!=LdapServersCSN[options.provider]:
|
for srv in LdapServersCSN:
|
||||||
errors.append('ContextCSN of %s not the same of provider' % srv)
|
if srv==options.provider:
|
||||||
|
continue
|
||||||
|
if not LdapServersCSN[srv]:
|
||||||
|
errors.append('ContextCSN of %s not found' % srv)
|
||||||
|
elif LdapServersCSN[srv]!=LdapServersCSN[options.provider]:
|
||||||
|
errors.append('ContextCSN of %s not the same of provider' % srv)
|
||||||
|
|
||||||
if len(not_found[options.consumer])>0:
|
if len(not_found[options.consumer])>0:
|
||||||
errors.append("%s not found object(s) on consumer" % len(not_found[options.consumer]))
|
errors.append("%s not found object(s) on consumer" % len(not_found[options.consumer]))
|
||||||
|
@ -420,11 +425,19 @@ else:
|
||||||
noerror=True
|
noerror=True
|
||||||
for srv in servers:
|
for srv in servers:
|
||||||
if not options.nocheckcontextcsn:
|
if not options.nocheckcontextcsn:
|
||||||
if srv==options.provider:
|
if not LdapServersCSN[options.provider]:
|
||||||
continue
|
logging.warning('ContextCSN of LDAP server provider could not be found')
|
||||||
if LdapServersCSN[srv]!=LdapServersCSN[options.provider]:
|
|
||||||
logging.warning('ContextCSN of %s not the same of provider' % srv)
|
|
||||||
noerror=False
|
noerror=False
|
||||||
|
else:
|
||||||
|
for srv in LdapServersCSN:
|
||||||
|
if srv==options.provider:
|
||||||
|
continue
|
||||||
|
if not LdapServersCSN[srv]:
|
||||||
|
logging.warning('ContextCSN of %s not found' % srv)
|
||||||
|
noerror=False
|
||||||
|
elif LdapServersCSN[srv]!=LdapServersCSN[options.provider]:
|
||||||
|
logging.warning('ContextCSN of %s not the same of provider' % srv)
|
||||||
|
noerror=False
|
||||||
|
|
||||||
if len(not_found[srv])>0:
|
if len(not_found[srv])>0:
|
||||||
logging.warning('Not found objects on %s :\n - %s' % (srv,'\n - '.join(not_found[srv])))
|
logging.warning('Not found objects on %s :\n - %s' % (srv,'\n - '.join(not_found[srv])))
|
||||||
|
|
Loading…
Reference in a new issue