Question

SQL Request in my host from Centreon

  • 24 August 2023
  • 4 replies
  • 172 views

Badge +1

Hello,

I need to make a SQL request in Centreon. But the SQL request should be take data to external database, thats means, Centreon haven’t this database. 

I created a HOST with my server data, and a service with SQL Request. 

This image contain the values of service.

And the next picture is the error.

Well, how can I make this action?


4 replies

Userlevel 5
Badge +14

Hello

Have you tried the command line for your command directly in the shell? 

this will give us more information other than “timeout”

You should be able to copy the command directly from the detail page of your Query service

 

it may be that the default timeout is too short, or there is another error we cannot see here, without all the informations (host configuration, etc...)

you should paste your command line here with the result in the poller shell

 

you can try running the same command with “ --verbose --debug “ and paste the result here. 

 

 

 

 

Badge +1

Hello, I have done what you said. The error is ‘Procces Timeout’ only. 

I haven’t another information for this error. :(

Userlevel 5
Badge +14

well, you didn’t provide the necessary information to help you (command line or host detail), so I will assume your centreon poller does not have access to mysql as it is the only reason for a timeout

is the ip/port accessible, does your mysql login have access remotely to the database with the correct grant

can you connect with mysql command directly from the poller to the mysqlserver with the login you have setup? is the tcport 3306 (or whatever you have setup on you mysql) open on the network ?

Badge +1

Hello, the command line is as follows:

/usr/lib/centreon/plugins//centreon_mysql.pl --plugin=database::mysql::plugin --host=IP --username='root' --password=password --port='3306'  --mode=sql --sql-statement="SELECT COUNT(*) FROM table.database" --warning='' --critical=''

 

 

Reply