opsi mit externem Grafana

SirTux
Beiträge: 558
Registriert: 05 Feb 2011, 18:37

opsi mit externem Grafana

Beitrag von SirTux »

Hi,

ist es zwangsläufig vorgesehen, daß Grafana ab 4.2 auf dem opsi-Server läuft oder kann man eine bereits bestehende Installation auf einem anderen Server mitverwenden?

Viele Grüße,
Stefan
Zuletzt geändert von SirTux am 01 Mär 2024, 13:10, insgesamt 1-mal geändert.
Benutzeravatar
fkalweit
uib-Team
Beiträge: 173
Registriert: 23 Okt 2020, 16:14

Re: opsi 4.2 und Grafana

Beitrag von fkalweit »

Hallo,

es ist grundsätzlich möglich Grafana auch auf einem anderen System zu betreiben.

Viele Grüße
fkalweit
SirTux
Beiträge: 558
Registriert: 05 Feb 2011, 18:37

Re: opsi 4.2 und Grafana

Beitrag von SirTux »

Hi,

gibt es schon Doku dazu? Ist es eigentlich gedacht, daß redis auf jedem Depotserver läuft?

Viele Grüße,
Stefan
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: opsi 4.2 und Grafana

Beitrag von SisterOfMercy »

SirTux hat geschrieben:gibt es schon Doku dazu?
https://download.uib.de/opsi4.2/documen ... rerequires

Perhaps here?
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
SirTux
Beiträge: 558
Registriert: 05 Feb 2011, 18:37

Re: opsi 4.2 und Grafana

Beitrag von SirTux »

Nein da steht nicht wie man ein bereits existierendes Grafana verwenden kann.
Benutzeravatar
wolfbardo
uib-Team
Beiträge: 1354
Registriert: 01 Jul 2008, 12:10

Re: opsi 4.2 und Grafana

Beitrag von wolfbardo »

Um eine externe Grafana-Instanz anzubinden müssen die folgenden opsiconfd-Konfigurationen geändert werden:

Code: Alles auswählen

--grafana-internal-url
Die URL über die der opsiconfd administrativ auf die Zentrale Grafana-Instanz zugreifen kann.
Z.B.:

Code: Alles auswählen

http://<api-key>@grafana:3000

Code: Alles auswählen

--grafana-external-url
Die URL auf die Clients weitergeleitet werden, die auf den Grafana-Link auf der opsiconfd-Admin-Seite klicken.

Gruss
Bardo Wolf


OPSICONF 2024
https://opsi.org/en/opsiconf/

opsi-Basisworkshops:

22. - 25. 04. 2024


opsi support - uib gmbh
For productive opsi installations we recommend maintainance + support contracts which are the base of opsi development.

http://www.uib.de
SirTux
Beiträge: 558
Registriert: 05 Feb 2011, 18:37

Re: opsi 4.2 und Grafana

Beitrag von SirTux »

Hi,

funktioniert das auch irgendwie mit einem selbst-signierten Zertifikat? Ich bekomme aktuell ein CERTIFICATE_VERIFY_FAILED.

Viele Grüße,
Stefan
SirTux
Beiträge: 558
Registriert: 05 Feb 2011, 18:37

Re: opsi 4.2 und Grafana

Beitrag von SirTux »

Das Zertifikat habe ich natürlich im System-Zertifikat-Store auf dem opsi-Server hinterlegt. Ein wget auf Grafana funktioniert entsprechend ohne Fehlermeldung.

Log:

Code: Alles auswählen

[3] [2021-06-09 11:24:37.017] [10.5.150.50    ] HTTPSConnectionPool(host='influxdb-server', port=3000): Max retries exceeded with url: /api/users/lookup?loginOrEmail=opsidashboard (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1091)')))   (session.py:295)
Traceback (most recent call last):
  File "opsiconfd/session.py", line 262, in __call__
  File "starlette/exceptions.py", line 82, in __call__
  File "starlette/exceptions.py", line 71, in __call__
  File "starlette/routing.py", line 566, in __call__
  File "starlette/routing.py", line 227, in handle
  File "starlette/routing.py", line 41, in app
  File "fastapi/routing.py", line 202, in app
  File "fastapi/routing.py", line 150, in run_endpoint_function
  File "starlette/concurrency.py", line 34, in run_in_threadpool
  File "concurrent/futures/thread.py", line 57, in run
  File "opsiconfd/application/admininterface.py", line 211, in open_grafana
  File "requests/sessions.py", line 555, in get
  File "requests/sessions.py", line 542, in request
  File "requests/sessions.py", line 655, in send
  File "requests/adapters.py", line 514, in send
requests.exceptions.SSLError: HTTPSConnectionPool(host='influxdb-server', port=3000): Max retries exceeded with url: /api/users/lookup?loginOrEmail=opsidashboard (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1091)')))

wget:

Code: Alles auswählen

root@opsi:~# wget https://influxdb-server:3000/
--2021-06-09 11:25:03--  https://influxdb-server:3000/
Resolving influxdb-server (influxdb-server)... 10.5.150.11
Connecting to influxdb-server (influxdb-server)|10.5.150.11|:3000... connected.
HTTP request sent, awaiting response... 302 Found
Location: /login [following]
--2021-06-09 11:25:03--  https://influxdb-server:3000/login
Reusing existing connection to influxdb-server:3000.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html                                                       [ <=>                                                                                                                                         ]  34,07K  --.-KB/s    in 0,001s  

2021-06-09 11:25:03 (63,6 MB/s) - ‘index.html’ saved [34884]

SirTux
Beiträge: 558
Registriert: 05 Feb 2011, 18:37

opsi 4.3 und Grafana

Beitrag von SirTux »

Hallo,

mit einem offiziellen Zertifikat hat das unter 42 schlußendlich funktioniert.

Seit 4.3 ist das aber leider wieder kaputt. Für den Admin-Client sehe ich folgendes im Log:

Code: Alles auswählen

[3] [2024-03-01 12:58:19.668] [CLIENT-IP] argument of type 'NoneType' is not iterable   (admininterface.py:528)
Traceback (most recent call last):
  File "opsiconfd/application/admininterface.py", line 513, in open_grafana
  File "opsiconfd/application/metrics.py", line 114, in create_grafana_datasource
  File "contextlib.py", line 210, in __aenter__
  File "opsiconfd/grafana.py", line 298, in async_grafana_admin_session
  File "urllib/parse.py", line 671, in unquote
TypeError: argument of type 'NoneType' is not iterable
Für den Grafana-Server folgendes:

Code: Alles auswählen

[3] [2024-03-01 13:07:32.813] [GRAFANA-IP    ] TSDB: Error at upsert, update is not supported when DUPLICATE_POLICY is set to BLOCK mode   (session.py:306)
Traceback (most recent call last):
  File "opsiconfd/session.py", line 377, in __call__
  File "opsiconfd/session.py", line 234, in handle_request
  File "opsiconfd/session.py", line 1330, in check_access
  File "opsiconfd/session.py", line 1143, in authenticate
  File "redis/asyncio/client.py", line 606, in execute_command
  File "redis/asyncio/retry.py", line 59, in call_with_retry
  File "redis/asyncio/client.py", line 580, in _send_command_parse_response
  File "redis/asyncio/client.py", line 627, in parse_response
  File "redis/asyncio/connection.py", line 538, in read_response
redis.exceptions.ResponseError: TSDB: Error at upsert, update is not supported when DUPLICATE_POLICY is set to BLOCK mode
[3] [2024-03-01 13:07:32.815] [GRAFANA-IP    ] TSDB: Error at upsert, update is not supported when DUPLICATE_POLICY is set to BLOCK mode   (session.py:306)
Traceback (most recent call last):
  File "opsiconfd/session.py", line 377, in __call__
  File "opsiconfd/session.py", line 234, in handle_request
  File "opsiconfd/session.py", line 1330, in check_access
  File "opsiconfd/session.py", line 1143, in authenticate
  File "redis/asyncio/client.py", line 606, in execute_command
  File "redis/asyncio/retry.py", line 59, in call_with_retry
  File "redis/asyncio/client.py", line 580, in _send_command_parse_response
  File "redis/asyncio/client.py", line 627, in parse_response
  File "redis/asyncio/connection.py", line 538, in read_response
redis.exceptions.ResponseError: TSDB: Error at upsert, update is not supported when DUPLICATE_POLICY is set to BLOCK mode
[3] [2024-03-01 13:07:32.816] [GRAFANA-IP    ] TSDB: Error at upsert, update is not supported when DUPLICATE_POLICY is set to BLOCK mode   (session.py:306)
Traceback (most recent call last):
  File "opsiconfd/session.py", line 377, in __call__
  File "opsiconfd/session.py", line 234, in handle_request
  File "opsiconfd/session.py", line 1330, in check_access
  File "opsiconfd/session.py", line 1143, in authenticate
  File "redis/asyncio/client.py", line 606, in execute_command
  File "redis/asyncio/retry.py", line 59, in call_with_retry
  File "redis/asyncio/client.py", line 580, in _send_command_parse_response
  File "redis/asyncio/client.py", line 627, in parse_response
  File "redis/asyncio/connection.py", line 538, in read_response
redis.exceptions.ResponseError: TSDB: Error at upsert, update is not supported when DUPLICATE_POLICY is set to BLOCK mode
[4] [2024-03-01 13:07:33.014] [GRAFANA-IP    ] Opsi service authentication error: No password specified   (session.py:283)
[4] [2024-03-01 13:07:33.044] [GRAFANA-IP    ] Opsi service authentication error: No password specified   (session.py:283)
[4] [2024-03-01 13:07:33.080] [GRAFANA-IP    ] Blocking client 'GRAFANA-IP' for 2.00 minutes   (session.py:1291)
[4] [2024-03-01 13:07:33.130] [GRAFANA-IP    ] Opsi service authentication error: No password specified   (session.py:283)
[4] [2024-03-01 13:07:33.130] [GRAFANA-IP    ] Opsi service authentication error: No password specified   (session.py:283)
[4] [2024-03-01 13:07:33.133] [GRAFANA-IP    ] Opsi service authentication error: No password specified   (session.py:283)
[4] [2024-03-01 13:07:33.282] [GRAFANA-IP    ] Opsi service authentication error: No password specified   (session.py:283)
Viele Grüße,
Stefan
Benutzeravatar
fkalweit
uib-Team
Beiträge: 173
Registriert: 23 Okt 2020, 16:14

Re: opsi mit externem Grafana

Beitrag von fkalweit »

Hallo,

ich versuche das mal bei uns in einer Testumgebung nachzustellen.
Dann finden wir zusammen bestimmt eine Lösung.
Evt brauche ich dann noch weitere Informationen.


Viele Grüße
Fabian
Antworten