Umstellung HWAudit und SWAudit auf MySQL, mysql.conf nicht gefunden

Antworten
RaphaelB
Beiträge: 7
Registriert: 19 Jun 2018, 11:56

Umstellung HWAudit und SWAudit auf MySQL, mysql.conf nicht gefunden

Beitrag von RaphaelB »

Guten Tag,

Ich bin gerade dabei, das Backend für den HWAudit und SWAudit auf MySQL umzustellen und halte mich dabei an die Doku.

Ich habe also den MySQL Server konfiguriert und

Code: Alles auswählen

opsi-setup --configure-mysql
erfolgreich ausgeführt.

Anschließend habe ich die Datei '/etc/opsi/backendManager/dispatch.conf' bearbeitet, nun sieht sie so aus:

Code: Alles auswählen

# -*- coding: utf-8 -*-
# = = = = = = = = = = = = = = = = = = = = = = =
# =      backend dispatch configuration       =
# = = = = = = = = = = = = = = = = = = = = = = =
#
# This file configures which methods are dispatched to which backends.
# Entries has to follow the form:
# <regular expression to match method name(s)> : <comma separated list of backend name(s)>
#
# Backend names have to match a backend configuraton file basename <backend name>.conf beneath /etc/opsi/backends.
# For every method executed on backend dispatcher the first matching regular expression will be decisive.
#
# Typical configurations:
#    file, opsipxeconfd and dhcpd backend:
#       backend_.*         : file, opsipxeconfd, dhcpd
#       host_.*            : file, opsipxeconfd, dhcpd
#       productOnClient_.* : file, opsipxeconfd
#       configState_.*     : file, opsipxeconfd
#       .*                 : file
#
#    jsonrpc, opsipxeconfd and dhcpd backend:
#       backend_.*         : jsonrpc, opsipxeconfd, dhcpd
#       .*                 : jsonrpc
#
#    file as main backend, mysql as hw/sw invent and license management backend, opsipxeconfd and dhcpd backend:
#       backend_.*         : file, mysql, opsipxeconfd, dhcpd
#       host_.*            : file, opsipxeconfd, dhcpd
#       productOnClient_.* : file, opsipxeconfd
#       configState_.*     : file, opsipxeconfd
#       license.*          : mysql
#       softwareLicense.*  : mysql
#       audit.*            : mysql
#       .*                 : file
#

backend_.*         : file, mysql, opsipxeconfd
host_.*            : file, opsipxeconfd
productOnClient_.* : file, opsipxeconfd
configState_.*     : file, opsipxeconfd
license.*          : mysql
softwareLicense:*  : mysql
audit.*            : mysql
.*                 : file
Wenn ich nun aber 'opsi-setup --init-current-config' ausführe, bekomme ich folgende Fehlermeldung:

Code: Alles auswählen

######@######:/etc/opsi/backendManager# opsi-setup --init-current-config
[2] [Jun 19 12:04:29] Traceback: (Logger.py|753)
[2] [Jun 19 12:04:29]   File "/usr/bin/opsi-setup", line 2182, in <module>
    main()
 (Logger.py|753)
[2] [Jun 19 12:04:29]   File "/usr/bin/opsi-setup", line 2130, in main
    initializeBackends()
 (Logger.py|753)
[2] [Jun 19 12:04:29]   File "/usr/bin/opsi-setup", line 1792, in initializeBackends
    depotbackend=False
 (Logger.py|753)
[2] [Jun 19 12:04:29]   File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 265, in __init__
    self._backend = BackendDispatcher(context=self, **kwargs)
 (Logger.py|753)
[2] [Jun 19 12:04:29]   File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 377, in __init__
    self.__loadBackends()
 (Logger.py|753)
[2] [Jun 19 12:04:29]   File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 431, in __loadBackends
    raise BackendConfigurationError(u"Backend config file '%s' not found" % backendConfigFile)
 (Logger.py|753)
[2] [Jun 19 12:04:29]      ==>>> Backend configuration error: Backend config file '/etc/opsi/backends/*  : mysql.conf' not found (opsi-setup|2186)

ERROR: Backend configuration error: Backend config file '/etc/opsi/backends/*  : mysql.conf' not found
Die Datei liegt aber definitiv dort:

Code: Alles auswählen

######@######:/etc/opsi/backends# ll
insgesamt 40
drwxrwx--- 2 opsiconfd opsiadmin 4096 Jun 19 11:16 ./
drwxrwx--- 6 opsiconfd opsiadmin 4096 Mär 28 11:23 ../
-rw-rw---- 1 opsiconfd opsiadmin  412 Jan 17  2017 dhcpd.conf
-rw-rw---- 1 opsiconfd opsiadmin  139 Jan 13  2017 file.conf
-rw-rw---- 1 opsiconfd opsiadmin  232 Apr 25  2017 hostcontrol.conf
-rw-rw---- 1 opsiconfd opsiadmin  142 Jan 13  2017 jsonrpc.conf
-rw-rw---- 1 opsiconfd opsiadmin  416 Jan 13  2017 multiplex.conf
-rw-rw---- 1 opsiconfd opsiadmin  261 Jun 19 11:03 mysql.conf
-rw-rw---- 1 opsiconfd opsiadmin  120 Jan 13  2017 opsipxeconfd.conf
-rw-rw---- 1 opsiconfd opsiadmin  103 Jan 13  2017 sqlite.conf
Der Inhalt der Datei ist folgender:

Code: Alles auswählen

######@######:/etc/opsi/backends# nano mysql.conf
# -*- coding: utf-8 -*-

module = 'MySQL'
config = {
"username" : "opsi",
"connectionPoolMaxOverflow" : 10,
"database" : "opsi",
"connectionPoolTimeout" : 30,
"address" : "localhost",
"password" : "######", #zensiert
"databaseCharset" : "utf8",
"connectionPoolSize" : 20
}
Ich kann mir nicht erklären woran das liegt, außer dass es womöglich an fehlenden Berechtigungen liegt, allerdings sieht das für mich alles in Ordnung aus. Wenn ich nun die '/etc/opsi/backendManager/dispatch.conf' wiederherstelle, sodass kein MySQL genutzt wird, läuft

Code: Alles auswählen

opsi-setup --init-current-config
erfolgreich durch.

Hat jemand einen Tipp für mich?

Viele Grüße
RaphaelB
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Umstellung HWAudit und SWAudit auf MySQL, mysql.conf nicht gefunden

Beitrag von n.wenselowski »

Hi,

könnte ein Problem beim Parsen der dispatch.conf sein.
Wurde die Datei zufällig von einem Windows mit Notepad oder ähnlichen ungeeigneten Werkzeugen bearbeitet?

Welche Version von python-opsi kommt dort zum Einsatz?

Bitte mal folgendes ausführen und das Log anschauen, woher die entsprechende Zeile /etc/opsi/backends/* : mysql.conf stammt.

Code: Alles auswählen

opsi-setup -l 8 --init-current-config

Gruß

Niko

Code: Alles auswählen

import OPSI
RaphaelB
Beiträge: 7
Registriert: 19 Jun 2018, 11:56

Re: Umstellung HWAudit und SWAudit auf MySQL, mysql.conf nicht gefunden

Beitrag von RaphaelB »

n.wenselowski hat geschrieben:Hi,

könnte ein Problem beim Parsen der dispatch.conf sein.
Wurde die Datei zufällig von einem Windows mit Notepad oder ähnlichen ungeeigneten Werkzeugen bearbeitet?
Würde mich ein wenig wundern, aber ich will es nicht ausschließen. Normalerweise nur Vi, Vim oder Nano.
n.wenselowski hat geschrieben:Welche Version von python-opsi kommt dort zum Einsatz?
Wie kann ich das überprüfen? Die Python Skripte liegen ja im python2.7 Ordner, von daher.. 2.7?
n.wenselowski hat geschrieben:Bitte mal folgendes ausführen und das Log anschauen, woher die entsprechende Zeile /etc/opsi/backends/* : mysql.conf stammt.

Code: Alles auswählen

opsi-setup -l 8 --init-current-config

Gruß

Niko
Hier die Ausgabe:

Code: Alles auswählen

######@######:/etc/opsi/backendManager# opsi-setup -l 8 --init-current-config
[6] [Jun 19 13:54:56] * BackendManager is creating BackendDispatcher (BackendManager.py|264)
[6] [Jun 19 13:54:56] Backend context was set to <BackendManager()> (Backend.py|195)
[6] [Jun 19 13:54:56] Loading dispatch config file '/etc/opsi/backendManager/dispatch.conf' (BackendManager.py|371)
[7] [Jun 19 13:54:56] Trying to lock file '/etc/opsi/backendManager/dispatch.conf' (0/2000) (__init__.py|216)
[7] [Jun 19 13:54:56] File '/etc/opsi/backendManager/dispatch.conf' locked after 0 millis (__init__.py|237)
[7] [Jun 19 13:54:56] Trying to lock file '/etc/opsi/backendManager/dispatch.conf' (0/2000) (__init__.py|216)
[7] [Jun 19 13:54:56] File '/etc/opsi/backendManager/dispatch.conf' locked after 0 millis (__init__.py|237)
[7] [Jun 19 13:54:56] Read dispatch config from file u'/etc/opsi/backendManager/dispatch.conf': [[u'backend_.*', [u'file', u'mysql', u'opsipxeconfd']], [u'host_.*', [u'file', u'opsipxeconfd']], [u'productOnClient_.*', [u'file', u'opsipxeconfd']], [u'configState_.*', [u'file', u'opsipxeconfd']], [u'license.*', [u'mysql']], [u'softwareLicense', [u'*  : mysql']], [u'audit.*', [u'mysql']], [u'.*', [u'file']]] (BackendManager.py|408)
[2] [Jun 19 13:54:56] Traceback: (Logger.py|753)
[2] [Jun 19 13:54:56]   File "/usr/bin/opsi-setup", line 2182, in <module>
    main()
 (Logger.py|753)
[2] [Jun 19 13:54:56]   File "/usr/bin/opsi-setup", line 2130, in main
    initializeBackends()
 (Logger.py|753)
[2] [Jun 19 13:54:56]   File "/usr/bin/opsi-setup", line 1792, in initializeBackends
    depotbackend=False
 (Logger.py|753)
[2] [Jun 19 13:54:56]   File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 265, in __init__
    self._backend = BackendDispatcher(context=self, **kwargs)
 (Logger.py|753)
[2] [Jun 19 13:54:56]   File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 377, in __init__
    self.__loadBackends()
 (Logger.py|753)
[2] [Jun 19 13:54:56]   File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 431, in __loadBackends
    raise BackendConfigurationError(u"Backend config file '%s' not found" % backendConfigFile)
 (Logger.py|753)
[2] [Jun 19 13:54:56]      ==>>> Backend configuration error: Backend config file '/etc/opsi/backends/*  : mysql.conf' not found (opsi-setup|2186)

ERROR: Backend configuration error: Backend config file '/etc/opsi/backends/*  : mysql.conf' not found
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Umstellung HWAudit und SWAudit auf MySQL, mysql.conf nicht gefunden

Beitrag von n.wenselowski »

Hi,

mach mal bitte in deiner dispatch.conf

Code: Alles auswählen

softwareLicense:*  : mysql
zu

Code: Alles auswählen

softwareLicense.*  : mysql
(: vs .)


Gruß

Niko

Code: Alles auswählen

import OPSI
RaphaelB
Beiträge: 7
Registriert: 19 Jun 2018, 11:56

Re: Umstellung HWAudit und SWAudit auf MySQL, mysql.conf nicht gefunden

Beitrag von RaphaelB »

n.wenselowski hat geschrieben:Hi,

mach mal bitte in deiner dispatch.conf

Code: Alles auswählen

softwareLicense:*  : mysql
zu

Code: Alles auswählen

softwareLicense.*  : mysql
(: vs .)


Gruß

Niko
Ach Gott.. Ja, da hat sich das Abschreiben mal wieder gerächt. Jetzt funktionieren die nachfolgenden Befehle auch einwandfrei.
Vielen Dank fürs Helfen bei diesem peinlichen Fehler :oops:
Antworten