centreon/centreon-archived

22.04, API V2, The host «alias» field contain the Host Template name.

Opened this issue · 0 comments

BUG REPORT INFORMATION

Prerequisites

The opened issue, must be code related. GitHub is not meant for support. Feel free to check the CONTRIBUTING section for more details.

Versions

centreon-plugin-Applications-Protocol-Dns-20220518-070245.el8.noarch
centreon-plugin-Operatingsystems-Windows-Snmp-20220518-070245.el8.noarch
centreon-common-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-broker-core-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-engine-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-widget-hostgroup-monitoring-22.04.0-1651050783.67619e0.el8.noarch
centreon-pp-manager-22.04.0-1652863784.9845a36.el8.noarch
centreon-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-plugin-Applications-Monitoring-Centreon-Database-20220518-070245.el8.noarch
centreon-plugin-Hardware-Ups-Standard-Rfc1628-Snmp-20220518-070245.el8.noarch
centreon-gorgone-centreon-config-22.04.0-1653033739.4653de3.el8.noarch
centreon-widget-engine-status-22.04.0-1652261061.4630705.el8.noarch
centreon-widget-live-top10-memory-usage-22.04.0-1651650617.376212b.el8.noarch
centreon-plugin-Applications-Monitoring-Centreon-Map4-Jmx-20220518-070245.el8.noarch
centreon-plugin-Applications-Protocol-Http-20220518-070245.el8.noarch
centreon-plugin-Network-Cisco-Standard-Snmp-20220518-070245.el8.noarch
centreon-perl-libs-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-trap-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-license-manager-common-22.04.0-1652863800.7a5c91a.el8.noarch
centreon-widget-grid-map-22.04.0-1652279283.6bfb61c.el8.noarch
centreon-web-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-widget-live-top10-cpu-usage-22.04.0-1651050981.e5e84d9.el8.noarch
centreon-widget-single-metric-22.04.0-1652876718.975cc61.el8.noarch
centreon-widget-tactical-overview-22.04.0-1652353412.e395064.el8.noarch
centreon-gorgone-22.04.0-1653033739.4653de3.el8.noarch
centreon-clib-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-plugin-Applications-Databases-Mysql-20220518-070245.el8.noarch
centreon-plugin-Applications-Monitoring-Centreon-Poller-20220518-070245.el8.noarch
centreon-plugin-Applications-Protocol-Ldap-20220518-070245.el8.noarch
centreon-plugin-Operatingsystems-Linux-Snmp-20220518-070245.el8.noarch
centreon-connector-perl-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-broker-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-engine-extcommands-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-poller-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-widget-graph-monitoring-22.04.0-1652192725.f451e5e.el8.noarch
centreon-widget-httploader-22.04.0-1651051613.6e5757c.el8.noarch
centreon-license-manager-22.04.0-1652863800.7a5c91a.el8.noarch
centreon-widget-servicegroup-monitoring-22.04.0-1651051537.cf68f62.el8.noarch
centreon-central-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-plugin-Applications-Monitoring-Centreon-Central-20220518-070245.el8.noarch
centreon-plugin-Hardware-Printers-Generic-Snmp-20220518-070245.el8.noarch
centreon-connector-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-engine-daemon-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-broker-cbd-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-widget-global-health-22.04.0-1651053081.084eba3.el8.noarch
centreon-widget-service-monitoring-22.04.0-1651053242.752cfb2.el8.noarch
centreon-plugin-Applications-Protocol-Ftp-20220518-070245.el8.noarch
centreon-broker-storage-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-broker-cbmod-22.04.0-1653033470.9bb3d5d08.el8.x86_64
centreon-database-22.04.0-1652964745.75a18ab0f1.el8.noarch
centreon-widget-host-monitoring-22.04.0-1651664501.1bd851f.el8.noarch
centreon-auto-discovery-server-22.04.0-1652863945.3d40cfd.el8.noarch
centreon-connector-ssh-22.04.0-1653033470.9bb3d5d08.el8.x86_64

Operating System

CentOS

Browser used

  • Google Chrome
  • Firefox
  • Internet Explorer IE11
  • Safari

Version: 101

Description

-- Describe the encountered issue --

Steps to Reproduce

Get the host details via the «ressources» enipoint :

curl 'http://10.66.113.52/centreon/api/latest/monitoring/resources?types=["host"]&limit=5&search={"h.name":"localhost"}'
-H 'Content-Type: application/json'
-H 'X-Auth-Token: xxxxxxxxxx'

Describe the received result

The «alias» field contain the Host Template name.
This only happen when the «alias» field is empty on the UI.

{
    "result": [
        {
            "uuid": "h16",
            "duration": "2M 2w",
            "last_check": "1m 29s",
            "short_type": "h",
            "id": 16,
            "type": "host",
            "name": "localhost",
            "alias": "generic-active-host",
            "fqdn": "localhost",
            "icon": null,
            "monitoring_server_name": "Central",
            "parent": null,
            "status": {
                "code": 0,
                "name": "UP",
                "severity_code": 5
            },
            "flapping": false,
            "in_downtime": false,
            "acknowledged": false,
            "active_checks": true,
            "passive_checks": false,
            "links": {
                "uris": {
                    "configuration": "/centreon/main.php?p=60101&o=c&host_id=16",
                    "logs": "/centreon/main.php?p=20301&h=16",
                    "reporting": "/centreon/main.php?p=307&host=16"
                },
                "endpoints": {
                    "details": "/centreon/api/latest/monitoring/resources/hosts/16",
                    "timeline": "/centreon/api/latest/monitoring/hosts/16/timeline",
                    "status_graph": null,
                    "performance_graph": null,
                    "acknowledgement": "/centreon/api/latest/monitoring/hosts/16/acknowledgements?limit=1",
                    "downtime": "/centreon/api/latest/monitoring/hosts/16/downtimes?search=%7B%22%24and%22:%5B%7B%22start_time%22:%7B%22%24lt%22:1653905431%7D,%22end_time%22:%7B%22%24gt%22:1653905431%7D,%220%22:%7B%22%24or%22:%7B%22is_cancelled%22:%7B%22%24neq%22:1%7D,%22deletion_time%22:%7B%22%24gt%22:1653905431%7D%7D%7D%7D%5D%7D",
                    "notification_policy": "/centreon/api/latest/configuration/hosts/16/notification-policy"
                },
                "externals": {
                    "action_url": "",
                    "notes": {
                        "label": "",
                        "url": ""
                    }
                }
            },
            "severity_level": null,
            "chart_url": null,
            "last_status_change": "2022-03-10T17:06:52+01:00",
            "tries": "1/3 (H)",
            "information": "OK - localhost rta 0,109ms lost 0%",
            "performance_data": "rta=0,109ms;3000,000;5000,000;0; pl=0%;80;100;0;100 rtmax=0,109ms;;;; rtmin=0,109ms;;;; ",
            "notification_enabled": true
        }
    ],
    "meta": {
        "page": 1,
        "limit": 5,
        "search": {
            "$and": {
                "h.name": "localhost"
            }
        },
        "sort_by": {},
        "total": 1
    }
}