Hello there,
I'm currently in the process of migrating from CentOS 7 with Centreon 21.10 to Debian Bullseye with version 23.04, following the migration guide provided here: Centreon Migration Guide.
I've encountered an issue with Gorgone, where it seems to be ignoring the ssh_port
configuration and attempting to connect to the pollers using the default SSH port (22/tcp). Here's a summary of the problem and the steps I've taken:
Problem Description:
- The configuration is the same as what was working on the old server.
- The SSH port for the pollers is correctly set up and recognized by Gorgone.
- When I check the NODES, I can see that the
ssh_port
for the pollers is correctly configured.
2023-08-19 16:55:46 - DEBUG - core] Message received - REGISTERNODES] ] ] {"nodes"::{"address":"server3.company.com","ssh_username":"centreon","ssh_port":222,"type":"push_ssh","id":"2"},{"id":"3","type":"push_ssh","ssh_port":2255,"address":"server4.company.com","ssh_username":"centreon"},{"type":"push_ssh","ssh_port":22,"id":"4","address":"192.168.10.200","ssh_username":"centreon"},{"address":"server1.company.com","ssh_username":"centreon","id":"5","ssh_port":22,"type":"push_ssh"},{"type":"push_ssh","ssh_port":222,"id":"6","address":"server5.company.com","ssh_username":"centreon"},{"id":"15","ssh_port":22,"type":"push_ssh","ssh_username":"centreon","address":"server2.company.com"}]}
However, after a few seconds, Gorgone only connects to the servers using the default SSH port (22/tcp), and all the others that are using different ports experience timeouts.
2023-08-19 07:26:01 - INFO - -sshclient] Client authenticated successfully to 'ssh://192.168.10.200:22'
2023-08-19 07:26:08 - INFO - -sshclient] Client authenticated successfully to 'ssh://server1.company.com:22'
2023-08-19 07:26:10 - INFO - -sshclient] Client authenticated successfully to 'ssh://server2.company.com:22'
2023-08-19 07:26:19 - ERROR - -sshclient] Connect method: connect failed: Timeout connecting to server3.company.com
2023-08-19 07:27:00 - ERROR - -sshclient] Connect method: connect failed: Timeout connecting to server4.company.com
Steps Taken:
- The new server is using the same IP as the old one, so there are no network problems.
- Manual SSH connections from the Gorgone account to the remote pollers work without any issues.
Temporary Workaround: After hours of troubleshooting, I tried creating an SSH config file for the Gorgone user as a workaround, and it worked. Here's the content of the .ssh/config
file:
cat /var/lib/centreon-gorgone/.ssh/config
Host *
IdentityFile /var/lib/centreon-gorgone/.ssh/id_rsa
Host server4.company.com
Port 2255
Host server3.company.com
Port 222
Host server5.company.com
Port 222
With this config file in place, Gorgone correctly connects to the pollers using the specified SSH ports. Here the ouput:
2023-08-19 15:57:01 - INFO - Fsshclient] Client authenticated successfully to 'ssh://192.168.10.200:22'
2023-08-19 15:57:02 - INFO - Fsshclient] Client authenticated successfully to 'ssh://server1.company.com:22'
2023-08-19 15:57:03 - INFO - Fsshclient] Client authenticated successfully to 'ssh://server2.company.com:22'
2023-08-19 16:02:42 - INFO - Fsshclient] Client authenticated successfully to 'ssh://server5.company.com:222'
2023-08-19 16:40:02 - INFO - Fsshclient] Client authenticated successfully to 'ssh://server4.company.com:2255'
2023-08-19 16:40:03 - INFO - Fsshclient] Client authenticated successfully to 'ssh://server3.company.com:222'
Additional Information:
All packages are up to date, including libssh-session-perl and centreon-gorgone.
$ dpkg -l | egrep '(libssh-session-perl|gorgone)'
ii centreon-gorgone 23.04.5-bullseye amd64 Centreon Gorgone.
ii libssh-session-perl 0.8-1 amd64 Support for the SSH protocol via libssh.
Any insights or solutions to this problem. I'm puzzled as to why Gorgone is not correctly recognizing the SSH ports without the SSH config file.