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
Labels
status/new
New tickets
For the RPM based systems
-- Copy/Paste the result of the following command --
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
The text was updated successfully, but these errors were encountered: