Hello,
When you tried to connect to your host from your poller through SSH, did you try the connection as the user ‘centreon-engine’?
Please note
--ssh-password
Define the password associated with the user name. Cannot be
used with the sshcli backend. Warning: using a password is not
recommended. Use --ssh-priv-key instead.
Also do you you have a space between username and password
ncentreon-engine@CC-2304-Central ~]$ /usr/lib/centreon/plugins/centreon_linux_ssh.pl --plugin=os::linux::local::plugin --mode=open-files --hostname='localhost' --ssh-backend='libssh' --ssh-username='centreon' --ssh-password='centreon' --ssh-port='22'
OK: current open files: 202 | 'system.files.open.count'=202;;;0;
'centreon-engine@CC-2304-Central ~]$ /usr/lib/centreon/plugins/centreon_linux_ssh.pl --plugin=os::linux::local::plugin --mode=open-files --hostname='localhost' --ssh-backend='libssh' --ssh-username='centreon'--ssh-password='centreon' --ssh-port='22'
UNKNOWN: auth issue: Access denied for 'publickey'. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic
No, I am not using the centreon-engine user. I have a predefined user for ssh to all my machines for monitoring needs and i am using the same. SSH connection using that user is working fine.
Okay but what i mean is when you tried your manual SSH connection from the poller, which poller’s user you used
When Centreon execute plugins (like centreon_linux_ssh.pl), it does as centreon-engine s o to reproduce the exact condition of Centreon execution, you need to test your command as centreon-engine , even if you connect remotely to your host as another user
Like this
#On your Poller
su centreon-engine
ssh admin@x.x.x.x
#OR
/usr/lib/centreon/plugins/centreon_linux_ssh.pl --plugin=os::linux::local::plugin --mode=open-files --hostname='x.x.x.x' --ssh-backend='libssh' --ssh-username='admin' --ssh-password='******' --ssh-port='22'
Also, as said @ponchoh, don’t forget the space between your username and password parameter, it seems there is not in the command you gave us (and i got the same error as you when i remove this space)
I get the same error as in the centreon gui
proot@~]# su centreon-engine
bash-4.4$
bash-4.4$ /usr/lib/centreon/plugins/centreon_linux_ssh.pl --plugin=os::linux::local::plugin --mode=open-files --hostname='x.x.x.x' --ssh-backend='libssh' --ssh-username='admin' --ssh-password='******' --ssh-port='22'
UNKNOWN: command execution error rexit code: 127]
Okay, and did you try the manual SSH connection too, as centreon-engine on your poller?
Yes manual ssh connection works from centreon-engine on poller to the host.
Now I have a different error. Direct ssh works but when i use the centreon_linux_ssh.pl to connect, I get
UNKNOWN: auth issue: pubkey issue
Possibly you are using some other user than cenrteon-engine? can you confirm you can do the ssh through your centreon-engine?
su - centreon-engine
ssh …..
or the cenrteon command
in this case is not enjoying your keys, have you confirmed login without username/password but with keys?
No I am using basic username password and not keys. Anyways thanks for your inputs but i am moving to snmp based template monitoring. the ssh based monitoring is too complicated.