Giter Site home page Giter Site logo

Comments (4)

Hazer31 avatar Hazer31 commented on June 12, 2024 1

Hi,

It looks like my problem is resolved.

Indeed, we migrated Centreon from version 20.04 to version 23.10 while keeping the configuration of local accounts.
By recreating the local account, used by Nagstamon, with a password and not the autologin, then the connection is successful and I have the logs that you mention above.
I think there was a conflict with the migrated account.

In conclusion :
Recreating the local account using a username + password solved my problem.

Thank you very much for your time.

from nagstamon.

BenoitPoulet avatar BenoitPoulet commented on June 12, 2024

Hello,

"Autologin Key" is not supported by the Centreon API v2.

You must use a username & password.

Please check on your account that the "Reach API Realtime" is enable on you account.

from nagstamon.

Hazer31 avatar Hazer31 commented on June 12, 2024

Hi,

Thank you for your answer :)

The "Reach API Realtime" function is activated for my account.
I used username and password but the problem is the same:
image

Maybe there is a security option to activate in Centreon?
Thanks :)

from nagstamon.

BenoitPoulet avatar BenoitPoulet commented on June 12, 2024

Something seems to be wrong with your credentials, because you have an 401, authentification failed.

this is the debug for a successful connection :

DEBUG: 2024-01-15 11:57:30.437446 Centreon Dev FetchURL: http://my_host/centreon/api/latest/platform/versions CGI Data: None
DEBUG: 2024-01-15 11:57:30.628492 [Centreon Dev] Status code 200
DEBUG: 2024-01-15 11:57:30.628492 [Centreon Dev] Loading class API, Centreon version : 24.4
DEBUG: 2024-01-15 11:57:30.629450 Centreon Dev Created server.
DEBUG: 2024-01-15 11:57:30.640225 Centreon Dev FetchURL: http://my_host/centreon/api/latest/platform/versions CGI Data: None
DEBUG: 2024-01-15 11:57:30.850851 [Centreon Dev] Centreon version detected : 24.4
DEBUG: 2024-01-15 11:57:30.851860 [Centreon Dev] Centreon API version used : v23.10
DEBUG: 2024-01-15 11:57:30.936992 [Centreon Dev] Checking session status
DEBUG: 2024-01-15 11:57:30.936992 [Centreon Dev] Check-session, the token expire if not been used for more than one hour. Current Token = None
DEBUG: 2024-01-15 11:57:30.936992 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/monitoring/resources?limit=0 CGI Data: None
DEBUG: 2024-01-15 11:57:31.106125 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/login CGI Data: {"security": {"credentials": {"login": "simpleuser", "password": "fGu5S16@PZCu"}}}
DEBUG: 2024-01-15 11:57:31.723450 Centreon Dev Fetched JSON: {'contact': {'alias': 'simpleuser',
             'email': '[email protected]',
             'id': 20,
             'is_admin': False,
             'name': 'simpleuser'},
 'security': {'token': 'OhCL+SSeTKTfJG4On2g3H09kCdAX6dxlZYGomzoQ41o9Gz7iJUkZUKLzIgX9lQnL'}}
DEBUG: 2024-01-15 11:57:31.723450 [Centreon Dev] API login : simpleuser / fGu5S16@PZCu > Token : OhCL+SSeTKTfJG4On2g3H09kCdAX6dxlZYGomzoQ41o9Gz7iJUkZUKLzIgX9lQnL > User ID : 20
DEBUG: 2024-01-15 11:57:31.723450 [Centreon Dev] Check-session, session renewed
DEBUG: 2024-01-15 11:57:31.723450 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/monitoring/resources?limit=0 CGI Data: None
DEBUG: 2024-01-15 11:57:32.092048 Centreon Dev Check-session, Fetched JSON: {'meta': {'limit': 0, 'page': 1, 'search': {}, 'sort_by': {}, 'total': 10},
 'result': []}
DEBUG: 2024-01-15 11:57:32.092048 Centreon Dev Check-session, Error : , Status code : 200
DEBUG: 2024-01-15 11:57:32.092048 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/monitoring/resources?types=["host"]&statuses=["WARNING","DOWN","CRITICAL","UNKNOWN"]&limit=9999 CGI Data: None
DEBUG: 2024-01-15 11:57:32.241491 [Centreon Dev] Host indexed : host_who_is_down
DEBUG: 2024-01-15 11:57:32.241491 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/monitoring/resources?types=["metaservice","service"]&statuses=["WARNING","DOWN","CRITICAL","UNKNOWN"]&limit=9999 CGI Data: None
DEBUG: 2024-01-15 11:57:32.402363 [Centreon Dev] Service indexed : host_who_is_down / Ping
DEBUG: 2024-01-15 11:57:32.402363 [Centreon Dev] Service indexed : localhost / Swap
DEBUG: 2024-01-15 11:57:32.402363 [Centreon Dev] Service indexed : host_who_is_down / Dummy
DEBUG: 2024-01-15 11:57:32.402363 Centreon Dev Filter: Service on host in DOWN host_who_is_down;Ping
DEBUG: 2024-01-15 11:57:32.402363 Centreon Dev Filter: Service on host in DOWN host_who_is_down;Dummy
DEBUG: 2024-01-15 11:57:32.608002 Saving configuration to file c:\users\benoit.poulet\.nagstamon\nagstamon.conf
DEBUG: 2024-01-15 11:57:32.623895 Centreon Dev Refreshing all hosts and services
DEBUG: 2024-01-15 11:57:33.402930 [Centreon Dev] Checking session status
DEBUG: 2024-01-15 11:57:33.402930 [Centreon Dev] Check-session, the token expire if not been used for more than one hour. Current Token = OhCL+SSeTKTfJG4On2g3H09kCdAX6dxlZYGomzoQ41o9Gz7iJUkZUKLzIgX9lQnL
DEBUG: 2024-01-15 11:57:33.402930 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/monitoring/resources?limit=0 CGI Data: None
DEBUG: 2024-01-15 11:57:33.545524 Centreon Dev Check-session, Fetched JSON: {'meta': {'limit': 0, 'page': 1, 'search': {}, 'sort_by': {}, 'total': 10},
 'result': []}
DEBUG: 2024-01-15 11:57:33.545524 Centreon Dev Check-session, Error : , Status code : 200
DEBUG: 2024-01-15 11:57:33.545524 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/monitoring/resources?types=["host"]&statuses=["WARNING","DOWN","CRITICAL","UNKNOWN"]&limit=9999 CGI Data: None
DEBUG: 2024-01-15 11:57:33.700541 [Centreon Dev] Host indexed : host_who_is_down
DEBUG: 2024-01-15 11:57:33.700541 Centreon Dev FetchURL: http://my_host/centreon/api/v23.10/monitoring/resources?types=["metaservice","service"]&statuses=["WARNING","DOWN","CRITICAL","UNKNOWN"]&limit=9999 CGI Data: None
DEBUG: 2024-01-15 11:57:33.848793 [Centreon Dev] Service indexed : host_who_is_down / Ping
DEBUG: 2024-01-15 11:57:33.850120 [Centreon Dev] Service indexed : localhost / Swap
DEBUG: 2024-01-15 11:57:33.850120 [Centreon Dev] Service indexed : host_who_is_down / Dummy
DEBUG: 2024-01-15 11:57:33.850120 Centreon Dev Filter: Service on host in DOWN host_who_is_down;Ping
DEBUG: 2024-01-15 11:57:33.850120 Centreon Dev Filter: Service on host in DOWN host_who_is_down;Dummy

The corrects settings :
image

from nagstamon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.