#!/usr/bin/python2.7 # -*- coding: utf-8 -*- from subprocess import Popen, PIPE, STDOUT from univention.management.console.modules.diagnostic import Critical from univention.lib.i18n import Translation _ = Translation('univention-management-console-module-diagnostic').translate title = _('Error in local AD database') description = '\n'.join([ _('An error occured in the local AD database.'), _("To solve the problem, open a shell and run 'samba-tool dbcheck --fix'."), ]) purpose = _("This plugin calls 'samba-tool dbcheck' to find errors in the local AD database.") category = _('Application Level') def run(): process = Popen(['samba-tool', 'dbcheck'], stdout=PIPE, stderr=STDOUT) stdout, stderr = process.communicate() if process.returncode: raise Critical('\n'.join([description, '', stdout])) if __name__ == '__main__': from univention.management.console.modules.diagnostic import main main()