Nagstamon icon indicating copy to clipboard operation
Nagstamon copied to clipboard

Nagstamon 3.8 /3.9 and Centreon 22.04.0

Open RAICO-IT opened this issue 2 years ago • 60 comments

Hello,

We have a problem in the interaction of Nagstamon 3.8 or 3.9 and the new Centreon version 22.04.0. Nagstamom only shows the message "Empty host XML result" We have already tried everything possible to solve this problem, but we are not getting any further. Jumping from Nagstamon to Monitor, Host etc. works without errors. Does anyone have an idea how we can solve this problem or is the Centreon version too new and everything is different there? We would be very grateful for any tips!

RAICO-IT avatar Jun 23 '22 10:06 RAICO-IT

Which version of Nagstamon 3.9 do you use?

HenriWahl avatar Jun 23 '22 17:06 HenriWahl

We use the version 3.9-20220619. But even with the officially released v. 3.8 we get the same message.

RAICO-IT avatar Jun 24 '22 05:06 RAICO-IT

same problem for me since 22.04..... "Empty host XML result"

jcdubassin avatar Jun 24 '22 13:06 jcdubassin

Hello,

Nagstamon do not support Centreon higher than 21.10, even in the 3.8.

The support for Centreon 22.04 and the API V2 has been added to Nagstamon version 3.9.xxxx.

BUT there is no access to it, as the integration is missing : no config screen, no possibility to switch on the right class

as discussed here : https://github.com/HenriWahl/Nagstamon/issues/812

BenoitPoulet avatar Jun 24 '22 13:06 BenoitPoulet

Here we have the same problem.

guinfox avatar Jun 27 '22 14:06 guinfox

centreon 22.04 and nagstamon 3.9 :(

guinfox avatar Jun 27 '22 14:06 guinfox

Please check the latest testing release from https://github.com/HenriWahl/Nagstamon/releases/tag/latest which tries to access this issue.

HenriWahl avatar Jun 29 '22 04:06 HenriWahl

Hello to all who have worked on this problem. With the new version everything works again. It's nice to see that sometimes things work in IT! Many thanks to everyone who was involved in solving the problem!

RAICO-IT avatar Jun 29 '22 06:06 RAICO-IT

Thanks !!!

jcdubassin avatar Jun 29 '22 08:06 jcdubassin

Hi everyone ! Doesn't work for me with :( Centreon 22.04.0 and nagstamon 3.9-20220626 Installer : Nagstamon-3.9-20220626-win64_setup.exe

MrManjah avatar Jun 29 '22 10:06 MrManjah

Hi everyone ! Doesn't work for me with :( Centreon 22.04.0 and nagstamon 3.9-20220626 Installer : Nagstamon-3.9-20220626-win64_setup.exe

Same version for me , works fine ( centreon 22.04 )

jcdubassin avatar Jun 29 '22 11:06 jcdubassin

Thks @jcdubassin . Do you use a SSL certificate on Centreon web server ?

MrManjah avatar Jun 29 '22 12:06 MrManjah

@MrManjah Can you give more information ?  Centreon version ? Error you have and if you can, enable the debug and post the log (without private information)

I run this version on Centreon 22.04 with valid SSL certificate, and on another one in HTTP.

Please note that using «autologin» is not supported on 22.04, you must use login/password. Be careful to try with the latest version posted 3 hours ago https://github.com/HenriWahl/Nagstamon/releases/tag/latest

BenoitPoulet avatar Jun 29 '22 16:06 BenoitPoulet

Hi @BenoitPoulet , Here the informations : Centreon version 22.04.0 and nagstamon 3.9-20220626 with the latest binary (18h ago) No autologin

Debug logs : ERROR: 2022-06-30 09:27:17.819630 Centreon Traceback (most recent call last): File "Nagstamon\Servers\Centreon\CentreonLegacy.py", line 263, in _get_sid AttributeError: 'NoneType' object has no attribute 'find' DEBUG: 2022-06-30 09:27:17.819630 Centreon Session renewed DEBUG: 2022-06-30 09:27:17.819630 Centreon FetchURL: https://server/centreon/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1 CGI Data: None DEBUG: 2022-06-30 09:27:17.885695 Centreon Empty host XML result DEBUG: 2022-06-30 09:27:47.939743 Centreon Checking session status DEBUG: 2022-06-30 09:27:47.939743 Centreon URLs defined for Centreon 19.04 DEBUG: 2022-06-30 09:27:47.939743 Centreon FetchURL: https://server/centreon/api/internal.php?object=centreon_keepalive&action=keepAlive CGI Data: None DEBUG: 2022-06-30 09:27:48.229024 Centreon Session status : "Unauthorized", http code : 401 DEBUG: 2022-06-30 09:27:48.229024 Centreon FetchURL: https://server/centreon/index.php CGI Data: None ERROR: 2022-06-30 09:27:48.304101 Centreon Traceback (most recent call last): File "Nagstamon\Servers\Centreon\CentreonLegacy.py", line 263, in _get_sid AttributeError: 'NoneType' object has no attribute 'find'

MrManjah avatar Jun 30 '22 07:06 MrManjah

I can see that the auto-detection of the Centreon's version failed.

The auto-detection relies on this page , car you to try to access to it without being logged into Centreon ?

https://server/centreon/api/latest/platform/versions

BenoitPoulet avatar Jun 30 '22 07:06 BenoitPoulet

It work in private browsing, without authentication prompt with result like this : {"web":{"version":"22.04.0","major":"22","minor":"04","fix":"0"}.....

MrManjah avatar Jun 30 '22 10:06 MrManjah

For the previous logs, i try to connect with a user without admin privilege in Centreon With admin account i have this errors:

DEBUG: 2022-06-30 12:20:12.278714 Monitor server FetchURL: https://server/centreon/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1 CGI Data: None DEBUG: 2022-06-30 12:20:12.344023 Monitor server Empty host XML result DEBUG: 2022-06-30 12:20:13.477553 Centreon FetchURL: https://server/centreon/api/latest/platform/versions CGI Data: None ERROR: 2022-06-30 12:20:13.536552 Centreon Traceback (most recent call last): File "urllib3\connectionpool.py", line 703, in urlopen File "urllib3\connectionpool.py", line 386, in _make_request File "urllib3\connectionpool.py", line 1040, in validate_conn File "urllib3\connection.py", line 414, in connect File "urllib3\util\ssl.py", line 449, in ssl_wrap_socket ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "requests\adapters.py", line 489, in send File "urllib3\connectionpool.py", line 785, in urlopen File "urllib3\util\retry.py", line 592, in increment urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='server', port=443): Max retries exceeded with url: /centreon/api/latest/platform/versions (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)'))) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "Nagstamon\Servers\Generic.py", line 1511, in FetchURL File "requests\sessions.py", line 600, in get File "requests\sessions.py", line 587, in request File "requests\sessions.py", line 701, in send File "requests\adapters.py", line 563, in send requests.exceptions.SSLError: HTTPSConnectionPool(host='server', port=443): Max retries exceeded with url: /centreon/api/latest/platform/versions (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

Below the Nagstamon configuration image

MrManjah avatar Jun 30 '22 10:06 MrManjah

The log you sent is not complete, the beginning is missing.

it must look like this :

DEBUG: 2022-06-30 14:55:56.560070 preprod FetchURL: https://centreon-preprod/centreon/api/latest/platform/versions CGI Data: None
DEBUG: 2022-06-30 14:55:56.827359 [preprod] Status code 200
DEBUG: 2022-06-30 14:55:56.828356 [preprod] Loading class API, Centreon version : 22.4
DEBUG: 2022-06-30 14:55:56.828356 preprod Created server.
DEBUG: 2022-06-30 14:55:56.836364 preprod FetchURL: https://centreon-preprod/centreon/api/latest/platform/versions CGI Data: None
DEBUG: 2022-06-30 14:55:57.056834 [preprod] Centreon code version selected : >= 21
DEBUG: 2022-06-30 14:55:57.056834 [preprod] URLs defined for Centreon vers. : 22
DEBUG: 2022-06-30 14:55:57.060775 preprod FetchURL: https://centreon-preprod/centreon/api/latest/login CGI Data: {"security": {"credentials": {"login": "mylogin", "password": "xxxxxxxxxxxxxxx"}}}
DEBUG: 2022-06-30 14:55:57.785054 preprod Fetched JSON: {'contact': {'alias': 'mylogin',
             'email': 'mylogin',
             'id': 96,
             'is_admin': False,
             'name': 'my name'},
 'security': {'token': 'pSZ1hDy64+so83axTvKsebpVKS1jUBA0Ks4Bn7XQYLVGhdxuLAU2HfiOUYeg8QIM'}}
DEBUG: 2022-06-30 14:55:57.785054 [preprod] API login : mylogin / xxxxxxxxxxxxxxx > Token : pSZ1hDy64+so83axTvKsebpVKS1jUBA0Ks4Bn7XQYLVGhdxuLAU2HfiOUYeg8QIM > User ID : 96
DEBUG: 2022-06-30 14:55:57.785054 [preprod] Checking session status
DEBUG: 2022-06-30 14:55:57.785054 [preprod] Check-session, the token will be deleted if it has not been used for more than one hour. Current Token = pSZ1hDy64+so83axTvKsebpVKS1jUBA0Ks4Bn7XQYLVGhdxuLAU2HfiOUYeg8QIM
DEBUG: 2022-06-30 14:55:57.786018 preprod FetchURL: https://centreon-preprod/centreon/api/latest/monitoring/resources?limit=0 CGI Data: None
DEBUG: 2022-06-30 14:55:58.121103 preprod Check-session, Fetched JSON: {'meta': {'limit': 0, 'page': 1, 'search': {}, 'sort_by': {}, 'total': 31},
 'result': []}
DEBUG: 2022-06-30 14:55:58.121103 preprod Check-session, Error : , Status code : 200
DEBUG: 2022-06-30 14:55:58.121103 preprod FetchURL: https://centreon-preprod/centreon/api/latest/monitoring/resources?types=["host"]&statuses=["WARNING","DOWN","CRITICAL","UNKNOWN"]&limit=9999 CGI Data: None
DEBUG: 2022-06-30 14:55:58.387568 [preprod] Host indexed : dirv-monitoring-centreon-02
DEBUG: 2022-06-30 14:55:58.387568 preprod FetchURL: https://centreon-preprod/centreon/api/latest/monitoring/resources?types=["metaservice","service"]&statuses=["WARNING","DOWN","CRITICAL","UNKNOWN"]&limit=9999 CGI Data: None

BenoitPoulet avatar Jun 30 '22 13:06 BenoitPoulet

Please be careful, the latest beta release publish the 04/07 from commit #376eee8, does not contain the Centreon 22.04 support anymore. @HenriWahl is this intended ?

BenoitPoulet avatar Jul 04 '22 09:07 BenoitPoulet

No, this is not intended. I am checking what went wrong.

HenriWahl avatar Jul 04 '22 10:07 HenriWahl

Building 3.9-20220704 at the moment, shall be available in some minutes and contains the merge again.

HenriWahl avatar Jul 04 '22 10:07 HenriWahl

Hello,

I've the same problem : https://$SERVER/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1 CGI Data: None

I use Centreon 22.04.1 with Nagstamon 3.9-20220807.

Thank you for your help

ASLLR avatar Aug 08 '22 07:08 ASLLR

@ASLLR as this thread grew a lot - which problem exactly?

HenriWahl avatar Aug 08 '22 07:08 HenriWahl

Hi @HenriWahl thank for your answer, i speak about the compatibility with Centreon 22.04. I've update my server and after nagstamon stop working with "Monitor URL Invalid". In debug mode i can the the line : https://$SERVER/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1 CGI Data: None I think is linked with the forst message of this issue.

Best Regards,

ASLLR avatar Aug 08 '22 08:08 ASLLR

Hi guys,

With Nagstamon-3.9-20220807-win64.zip, I got the following despite I had uncheck the box ignore ssl certificate and/or setting my server's certificate and/or the complete chain:

DEBUG: 2022-08-08 09:51:52.426089 Monitor server FetchURL: https://myfqdn/centreon/api/latest/platform/versions CGI Data: None ERROR: 2022-08-08 09:51:52.552304 Monitor server Traceback (most recent call last): File "urllib3\connectionpool.py", line 703, in urlopen File "urllib3\connectionpool.py", line 386, in _make_request File "urllib3\connectionpool.py", line 1042, in validate_conn File "urllib3\connection.py", line 414, in connect File "urllib3\util\ssl.py", line 449, in ssl_wrap_socket ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "requests\adapters.py", line 489, in send File "urllib3\connectionpool.py", line 787, in urlopen File "urllib3\util\retry.py", line 592, in increment urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='myfqdn', port=443): Max retries exceeded with url: /centreon/api/latest/platform/versions (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)')))

If that can help, I remember that I had to add some "self.session.verify = False" in multiple place (Generic.py & Centreon.py) to implement quickly (& reaaaally dirty) the fix from Benoit but I don't remember exactly the modification I made. The changes also fixed the issue with the verification of updates as we have SSL decryption in our corporate network.

brice-automatizit avatar Aug 08 '22 08:08 brice-automatizit

@ASLLR Do you use autologin which should NOT work as described in https://github.com/HenriWahl/Nagstamon/issues/815#issuecomment-1170180568 ?

HenriWahl avatar Aug 08 '22 19:08 HenriWahl

@brice-automatizit did you check or uncheck the ignore SSL setting?

HenriWahl avatar Aug 08 '22 19:08 HenriWahl

@ASLLR Do you use autologin which should NOT work as described in #815 (comment) ?

Hi @HenriWahl no i'm not using autologin.

Best regards

ASLLR avatar Aug 09 '22 06:08 ASLLR

@brice-automatizit did you check or uncheck the ignore SSL setting?

Indeed, I *checked the box to ignore the TLS/SSL certificate

brice-automatizit avatar Aug 09 '22 07:08 brice-automatizit

Hello, I've the same problem with Nagstamon 3.9-20220807.

JGomsss avatar Aug 12 '22 19:08 JGomsss