Skip to main content

Hello there,

 

When I access the API using theses links:

https://my_centreon/centreon/api/latest/monitoring/resources

https://my_centreon/centreon/api/v23.04/monitoring/resources?states=[%22unhandled_problems%22]&types=[%22service%22] 

I don’t get all the information about the resources, on the api output below (some part have been removed to make it short), the “information”, last_check and “performance_data” (perhaps others) text is missing (null)

 

{
"result": [
{
"uuid": "h142-s1388",
"duration": "4w 1d",
"last_check": null,
"short_type": "s",
"id": 1388,
"type": "service",
"name": "check_tcp_port",
"alias": null,
"fqdn": null,
"host_id": 142,
"service_id": 1388,
"icon": null,
"monitoring_server_name": "xxxx",
"parent": {
"uuid": "h142",
"short_type": "h",
"id": 142,
"type": "host",
"name": "xxxx-xxxx-server",
"alias": "XXXXX XXXXX",
"fqdn": "nnn.nnn.nnn.nnnn",
"host_id": null,
"service_id": null,
"icon": null,
"status": {
"code": 0,
"name": "UP",
"severity_code": 5
},
"links": {
"uris": {
"configuration": null,
"logs": null,
"reporting": null
},
"endpoints": {},
"externals": {
"action_url": null,
"notes": null
}
}
},
"status": {
"code": 2,
"name": "CRITICAL",
"severity_code": 1
},
"in_downtime": false,
"acknowledged": false,
"active_checks": true,
"passive_checks": false,
"chart_url": null,
"last_status_change": "2023-08-16T06:06:14-04:00",
"tries": "3/3 (H)",
"information": null,
"performance_data": null,
"notification_enabled": true,
"severity": null
},
{}
],
"meta": {
"page": 1,
"limit": 10,
"search": {},
"sort_by": {},
"total": 2
}
}

 

but, if I go on the hosts/services API directly (https://my_centreon/centreon/api/latest/monitoring/resources/hosts/142/services/1388),  it show all the missing data:

 

{
"uuid": "h142-s1388",
"id": 1388,
"name": "check_tcp_port",
"type": "service",
"short_type": "s",
"status": {
"name": "CRITICAL",
"code": 2,
"severity_code": 1,
"type": 1
},
"in_downtime": false,
"acknowledged": false,
"flapping": false,
"performance_data": "",
"information": "connect to address nnn.nnn.nnn.nnn and port 11100: No route to host",
"command_line": "/usr/lib/nagios/plugins/check_tcp -H nnn.nnn.nnn.nnn -p 11100 -w 2 -c 4",
"notification_number": 676,
"latency": 0.065,
"percent_state_change": 0,
"passive_checks": false,
"execution_time": 1.213,
"active_checks": true,
"icon": {
"id": null,
"name": "",
"url": ""
},
}

 

Attached a screenshot that show the “resources” window with the missing info and on the sidebar the service windows, where the info is displayed correctly.

Someone have any idea why this can been happen and where should I look to fix it ??

centreon using the last version 23.04.

 

thanks and attentive 

 

 

Hi @supervhs , for the first API call, if you change /v23.04/ by /latest/ it’s the same result?


Hello Laurent,

 

Yes, it is the same using v23.04/latest/beta.  :-(


Are you using Centreon Web 23.04.7?


No, 23.04.06

 

https://my_centreon/centreon/api/v23.04/platform/versions

 

"web": {
"version": "23.04.6",
"major": "23",
"minor": "04",
"fix": "6"
},


Hi,

 

I have just updated to 23.04.7 and the same issue with this version too.


I don’t have this issue on my platform with same version.

Do you have error/warning messages in /var/log/php-fpm/centreon-error.log file when you access this endpoint?


Hi @Laurent 

 

Actually, this directory/file don’t exists on debian !! :-(

root@buho:~# ls -ltra  /var/log/php-fpm
ls: cannot access '/var/log/php-fpm': No such file or directory
root@buho:~# find / -name centreon-error.log
root@buho:~#

 

I only found the file /var/log/php8.1-fpm.log which don’t contain much information:

[14-Sep-2023 13:10:35] NOTICE: Terminating ...
[14-Sep-2023 13:10:35] NOTICE: exiting, bye-bye!
[14-Sep-2023 13:10:35] NOTICE: fpm is running, pid 780333
[14-Sep-2023 13:10:35] NOTICE: ready to handle connections
[14-Sep-2023 13:10:35] NOTICE: systemd monitor interval set to 10000ms
[14-Sep-2023 13:10:38] NOTICE: Terminating ...
[14-Sep-2023 13:10:38] NOTICE: exiting, bye-bye!
[14-Sep-2023 13:10:39] NOTICE: fpm is running, pid 780494
[14-Sep-2023 13:10:39] NOTICE: ready to handle connections
[14-Sep-2023 13:10:39] NOTICE: systemd monitor interval set to 10000ms
[14-Sep-2023 13:10:43] NOTICE: Terminating ...
[14-Sep-2023 13:10:43] NOTICE: exiting, bye-bye!
[14-Sep-2023 13:10:43] NOTICE: fpm is running, pid 780759
[14-Sep-2023 13:10:43] NOTICE: ready to handle connections
[14-Sep-2023 13:10:43] NOTICE: systemd monitor interval set to 10000ms
[14-Sep-2023 13:11:41] NOTICE: Terminating ...
[14-Sep-2023 13:11:41] NOTICE: exiting, bye-bye!
[14-Sep-2023 13:11:42] NOTICE: fpm is running, pid 781728
[14-Sep-2023 13:11:42] NOTICE: ready to handle connections
[14-Sep-2023 13:11:42] NOTICE: systemd monitor interval set to 10000ms
[15-Sep-2023 08:11:08] NOTICE: Reloading in progress ...
[15-Sep-2023 08:11:08] NOTICE: reloading: execvp("/usr/sbin/php-fpm8.1", {"/usr/sbin/php-fpm8.1", "--nodaemonize", "--fpm-config", "/etc/php/8.1/fpm/php-fpm.conf"})
[15-Sep-2023 08:11:08] NOTICE: using inherited socket fd=8, "127.0.0.1:9042"
[15-Sep-2023 08:11:08] NOTICE: using inherited socket fd=9, "/run/php/php8.1-fpm.sock"
[15-Sep-2023 08:11:08] NOTICE: fpm is running, pid 781728
[15-Sep-2023 08:11:08] NOTICE: ready to handle connections
[15-Sep-2023 08:11:08] NOTICE: systemd monitor interval set to 10000ms
[15-Sep-2023 08:12:15] NOTICE: Terminating ...
[15-Sep-2023 08:12:15] NOTICE: exiting, bye-bye!
[15-Sep-2023 08:12:15] NOTICE: fpm is running, pid 817847
[15-Sep-2023 08:12:16] NOTICE: ready to handle connections
[15-Sep-2023 08:12:16] NOTICE: systemd monitor interval set to 10000ms

 

I have changed the configurations from notice to debug on /etc/php/8.1/fpm/php-fpm.conf and restarted, but still no intresting information on this file.

 

[15-Sep-2023 08:12:55] NOTICE: Terminating ...
[15-Sep-2023 08:12:55] NOTICE: exiting, bye-bye!
[15-Sep-2023 08:12:55.654485] DEBUG: pid 817876, fpm_scoreboard_init_main(), line 38: got clock tick '100'
[15-Sep-2023 08:12:55.654556] DEBUG: pid 817876, fpm_signals_init_main(), line 221: Unblocking all signals
[15-Sep-2023 08:12:55.654594] DEBUG: pid 817876, fpm_socket_af_inet_socket_by_addr(), line 306: Found address for 127.0.0.1, socket opened on 127.0.0.1
[15-Sep-2023 08:12:55.654673] DEBUG: pid 817876, fpm_event_init_main(), line 359: event module is epoll and 1 fds have been reserved
[15-Sep-2023 08:12:55.654700] NOTICE: pid 817876, fpm_init(), line 83: fpm is running, pid 817876
[15-Sep-2023 08:12:55.654721] DEBUG: pid 817876, fpm_children_make(), line 430: blocking signals before child birth
[15-Sep-2023 08:12:55.655812] DEBUG: pid 817876, fpm_children_make(), line 454: unblocking signals, child born
[15-Sep-2023 08:12:55.655879] DEBUG: pid 817876, fpm_children_make(), line 460: [pool www] child 817877 started
[15-Sep-2023 08:12:55.655892] DEBUG: pid 817876, fpm_children_make(), line 430: blocking signals before child birth
[15-Sep-2023 08:12:55.656956] DEBUG: pid 817876, fpm_children_make(), line 454: unblocking signals, child born
[15-Sep-2023 08:12:55.656998] DEBUG: pid 817876, fpm_children_make(), line 460: [pool www] child 817878 started
[15-Sep-2023 08:12:55.657020] DEBUG: pid 817876, fpm_event_loop(), line 387: 41136 bytes have been reserved in SHM
[15-Sep-2023 08:12:55.657027] NOTICE: pid 817876, fpm_event_loop(), line 388: ready to handle connections
[15-Sep-2023 08:12:55.658597] DEBUG: pid 817876, fpm_systemd_heartbeat(), line 67: have notify start to systemd
[15-Sep-2023 08:12:55.658614] NOTICE: pid 817876, fpm_systemd_heartbeat(), line 74: systemd monitor interval set to 10000ms
[15-Sep-2023 08:12:56.658436] DEBUG: pid 817876, fpm_pctl_perform_idle_server_maintenance(), line 382: [pool centreon] currently 0 active children, 0 spare children
[15-Sep-2023 08:12:56.658642] DEBUG: pid 817876, fpm_pctl_perform_idle_server_maintenance(), line 398: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[15-Sep-2023 08:12:56.778269] DEBUG: pid 817876, fpm_children_make(), line 430: blocking signals before child birth
[15-Sep-2023 08:12:56.781034] DEBUG: pid 817876, fpm_children_make(), line 454: unblocking signals, child born
[15-Sep-2023 08:12:56.781153] DEBUG: pid 817876, fpm_children_make(), line 460: [pool centreon] child 817882 started
[15-Sep-2023 08:12:56.781174] DEBUG: pid 817876, fpm_pctl_on_socket_accept(), line 553: [pool centreon] got accept without idle child available .... I forked
[15-Sep-2023 08:12:56.781194] DEBUG: pid 817876, fpm_event_loop(), line 440: event module triggered 1 events
[15-Sep-2023 08:12:57.660193] DEBUG: pid 817876, fpm_pctl_perform_idle_server_maintenance(), line 382: [pool centreon] currently 0 active children, 1 spare children
[15-Sep-2023 08:12:57.660246] DEBUG: pid 817876, fpm_pctl_perform_idle_server_maintenance(), line 398: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[15-Sep-2023 08:12:58.661352] DEBUG: pid 817876, fpm_pctl_perform_idle_server_maintenance(), line 382: [pool centreon] currently 0 active children, 1 spare children
[15-Sep-2023 08:12:58.661415] DEBUG: pid 817876, fpm_pctl_perform_idle_server_maintenance(), line 398: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[15-Sep-2023 08:12:59.443948] DEBUG: pid 817876, fpm_event_loop(), line 440: event module triggered 1 events


The last 4 lines repeat a many times after this.

 

 

The file /var/log/centreon/centreon-web.log dont show any information when I load the api (only a few old (2023-08-28) ERROR there about authentications.

 

Any other suggestions ?

 

Thanks


Aditional data:

 

I found this file /etc/php/8.1/fpm/pool.d/centreon.conf

[centreon]
user = www-data
group = www-data
listen = 127.0.0.1:9042
listen.allowed_clients = 127.0.0.1
pm = ondemand
pm.max_children = 30
pm.process_idle_timeout = 10s
pm.max_requests = 500
rlimit_files = 4096
php_admin_value[error_log] = /var/log/php8.1-fpm-centreon-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/sessions
php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache

which set the logs to a filename /var/log/php8.1-fpm-centreon-error.log (not centreon-error.log), from my point of view, there is a mistake with this configuration, whereit should be /var/log/php8.1-fpm/centreon-error.log (with a slash and not a dash).

 

Anyway, I created the file /var/log/php8.1-fpm-centreon-error.log and give it persmissos 666 (temporary) and now I got some errors there, but not related with the API

 

[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning:  Attempt to read property "value" on null in /usr/share/centreon/GPL_LIB/SmartyCache/compile/3a12079fa2965478d76d72cc600318d6915d1f2a_0.file.global_health_host.ihtml.php on line 27
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Undefined array key "theme" in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 27
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Attempt to read property "value" on null in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 27
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Undefined array key "theme" in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 27
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Attempt to read property "value" on null in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 27
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Undefined array key "theme" in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 37
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Attempt to read property "value" on null in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 37
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Undefined array key "theme" in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 37
[15-Sep-2023 08:33:22 Etc/GMT+3] PHP Warning: Attempt to read property "value" on null in /usr/share/centreon/GPL_LIB/SmartyCache/compile/69f3024a902d37b45dc54ca2adc7c137329eb991_0.file.global_health_service.ihtml.php on line 37

 

 


And the /var/log/centreon/centreon-web.log after enabling the DEBUG:

[2023-09-15T08:56:15-0300] [DEBUG] [EventSubscriber\UpdateEventSubscriber:69]: Checking if route matches updates endpoint 
[2023-09-15T08:56:15-0300] [DEBUG] [Core\Security\Authentication\Infrastructure\Repository\DbWriteTokenRepository:61]: Deleting expired refresh tokens
[2023-09-15T08:56:15-0300] [DEBUG] [Core\Security\Authentication\Infrastructure\Repository\DbWriteTokenRepository:82]: Deleting expired tokens which are not linked to a refresh token
[2023-09-15T08:56:30-0300] [DEBUG] [EventSubscriber\UpdateEventSubscriber:69]: Checking if route matches updates endpoint
[2023-09-15T08:56:30-0300] [DEBUG] [Core\Security\Authentication\Infrastructure\Repository\DbWriteTokenRepository:61]: Deleting expired refresh tokens
[2023-09-15T08:56:30-0300] [DEBUG] [Core\Security\Authentication\Infrastructure\Repository\DbWriteTokenRepository:82]: Deleting expired tokens which are not linked to a refresh token
[2023-09-15T08:57:26-0300] [DEBUG] [EventSubscriber\UpdateEventSubscriber:69]: Checking if route matches updates endpoint
[2023-09-15T08:57:26-0300] [DEBUG] [Core\Security\Authentication\Infrastructure\Repository\DbWriteTokenRepository:61]: Deleting expired refresh tokens
[2023-09-15T08:57:26-0300] [DEBUG] [Core\Security\Authentication\Infrastructure\Repository\DbWriteTokenRepository:82]: Deleting expired tokens which are not linked to a refresh token

 

Question: Why my other two post are not here in this thread anymore ?? :-(


Hello and me again,

 

I have done a totally new installation (new VM with debian 11 and centreon 23.04.7) following the guide from here (https://docs.centreon.com/docs/installation/installation-of-a-central-server/using-packages/) and the result is the same (some fields are missing on the resoures page), see attached.

 


Hi @supervhs which DBMS and version do you use?


Hi,

 

Please, ignore this issue… I forgot that our automatization image come with mariadb 11 repo installed by default.

When running the apt install command, it used the version 11 and not the 10.5.

Making a downgrade from 11 to 10.5 fixed this issue.

 

Note: Sorry for not comment it before.. saw this problem for our side yesterday.

 

Thanks anyway.