Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Centreon CLAPI fails to create RTDOWNTIME if hostname is numeric only #9540

Open
matix42 opened this issue Mar 2, 2021 · 0 comments
Open
Labels
status/new New tickets

Comments

@matix42
Copy link

matix42 commented Mar 2, 2021

For the RPM based systems

-- Copy/Paste the result of the following command --

$ rpm -qa | grep centreon | egrep -v "(plugin|pack)" | sort
centreon-20.10.3-10.el7.centos.noarch
centreon-auto-discovery-server-20.10.2-1.el7.centos.noarch
centreon-base-config-centreon-engine-20.10.3-10.el7.centos.noarch
centreon-broker-20.10.3-5.el7.centos.x86_64
centreon-broker-cbd-20.10.3-5.el7.centos.x86_64
centreon-broker-cbmod-20.10.3-5.el7.centos.x86_64
centreon-broker-core-20.10.3-5.el7.centos.x86_64
centreon-broker-graphite-20.10.3-5.el7.centos.x86_64
centreon-broker-storage-20.10.3-5.el7.centos.x86_64
centreon-clib-20.10.0-2.el7.centos.x86_64
centreon-common-20.10.3-10.el7.centos.noarch
centreon-connector-20.10.0-2.el7.centos.x86_64
centreon-connector-perl-20.10.0-2.el7.centos.x86_64
centreon-connector-ssh-20.10.0-2.el7.centos.x86_64
centreon-cwrapper-perl-0.1-1.el7.centos.x86_64
centreon-database-20.10.3-10.el7.centos.noarch
centreon-engine-20.10.2-2.el7.centos.x86_64
centreon-engine-daemon-20.10.2-2.el7.centos.x86_64
centreon-engine-extcommands-20.10.2-2.el7.centos.x86_64
centreon-gorgone-20.10.2-1.el7.centos.noarch
centreon-gorgone-centreon-config-20.10.2-1.el7.centos.noarch
centreon-license-manager-20.10.1-1.el7.centos.noarch
centreon-license-manager-common-20.10.1-1.el7.centos.noarch
centreon-perl-libs-20.10.3-10.el7.centos.noarch
centreon-poller-centreon-engine-20.10.3-10.el7.centos.noarch
centreon-pp-manager-20.10.0-1.el7.centos.noarch
centreon-release-20.10-2.el7.centos.noarch
centreon-trap-20.10.3-10.el7.centos.noarch
centreon-web-20.10.3-10.el7.centos.noarch
centreon-widget-engine-status-20.10.0-5.el7.centos.noarch
centreon-widget-global-health-20.10.0-5.el7.centos.noarch
centreon-widget-graph-monitoring-20.10.0-5.el7.centos.noarch
centreon-widget-grid-map-20.10.0-5.el7.centos.noarch
centreon-widget-hostgroup-monitoring-20.10.0-5.el7.centos.noarch
centreon-widget-host-monitoring-20.10.0-5.el7.centos.noarch
centreon-widget-httploader-20.10.0-5.el7.centos.noarch
centreon-widget-live-top10-cpu-usage-20.10.0-5.el7.centos.noarch
centreon-widget-live-top10-memory-usage-20.10.0-5.el7.centos.noarch
centreon-widget-servicegroup-monitoring-20.10.0-5.el7.centos.noarch
centreon-widget-service-monitoring-20.10.0-5.el7.centos.noarch
centreon-widget-tactical-overview-20.10.0-5.el7.centos.noarch

Operating System

*CentOS Linux release 7.9.2009 (Core)

Description

If I add a RTDOWNTIME to a hostname with numeric only name it returns errors..

Steps to Reproduce

centreon -u clapi -p xxxxxx -o RTDOWNTIME -a add -v "HOST;998;2021/03/02 10:00;2021/03/04 10:00;1;3600;test;1"

it works if hostname contain at least one non numeric character (example : m998)

Describe the received result

PHP Fatal error: Uncaught Error: Call to a member function query() on null in /usr/share/centreon/www/include/common/common-Func.php:240
Stack trace:
#0 /usr/share/centreon/www/class/centreonExternalCommand.class.php(545): getMyHostName('998')
#1 /usr/share/centreon/www/class/centreon-clapi/centreonRtDowntime.class.php(491): CentreonExternalCommand->addHostDowntime('998', ''en'', '2021/03/05 10:2...', '2021/03/27 10:1...', '1', '3600', false)
#2 /usr/share/centreon/www/class/centreon-clapi/centreonRtDowntime.class.php(443): CentreonClapi\CentreonRtDowntime->addHostDowntime('998', '2021/03/05 10:2...', '2021/03/27 10:1...', '1', '3600', ''en'', false)
#3 /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php(719): CentreonClapi\CentreonRtDowntime->add('HOST;998;2021/0...')
#4 /usr/share/centreon/bin/centreon(199): CentreonClapi\CentreonAPI->launchAction()
#5 {main}
thrown in /usr/share/centreon/www/include/common/common-Func.php on line 240

@matix42 matix42 added the status/new New tickets label Mar 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/new New tickets
Projects
None yet
Development

No branches or pull requests

1 participant