Skip to main content
Question

centreon_linux_ssh plugin

  • October 23, 2025
  • 25 replies
  • 108 views

Forum|alt.badge.img+5
Hello,I'm encountering an error when using the "centreon_linux_ssh" plugin. I want to test whether a folder is present on a remote server (Ubuntu).I get the error message "option '63' requires an argument" from the Centreon interface.However, when testing the command as "centreon-engine," I do get a response.Thank you for your help.Eric

25 replies

Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 23, 2025

/usr/lib/centreon/plugins//centreon_linux_ssh.pl --plugin=os::linux::local::plugin --mode=cmd-return --hostname='10.X.X.X' --ssh-backend='' --ssh-username='root' --ssh-priv-key='/var/lib/centreon-engine/.ssh/id_ecdsa' --ssh-port=''  --exec-command='ls'  --exec-command-options='/etc/cron.d/montage' --manage-returns='%(code) == 0,CRITIQUE,disque RO#%(code) == 1,UNKNOWN,probleme inconnu#%(code) == 2,OK,disque RW' --verbose --debug


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 23, 2025
same result with this:
/usr/lib/centreon/plugins//centreon_linux_ssh.pl --plugin=os::linux::local::plugin --mode=cmd-return --hostname='10.XX.XX.XX' --ssh-backend='' --ssh-username='root' --ssh-priv-key='/var/lib/centreon-engine/.ssh/id_ecdsa' --ssh-port='' --exec-command='find' --exec-command-options='/etc/cron.d/montage' --manage-returns='%(code) == 3,OK,disque RW#%(code) == 1,UNKNOWN,probleme inconnu#%(code) == 0,CRITIQUE,disque RO' --verbose --debug

ponchoh
Centreonian
Forum|alt.badge.img+14
  • Centreonian
  • 531 replies
  • October 23, 2025

Are you using Centreon’s templates? Do you get any errors on the other checks? does the Host check work? 😊sorry for so many questions, I’ve never seen the 63


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 24, 2025
Hello,yes, no, and noThis is indeed a first for me; the other models work perfectly.

Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 24, 2025

 


Forum|alt.badge.img+3
  • Centreonian
  • 27 replies
  • October 27, 2025

Hello
never seen that too.
can you check your env variables are the same than engine ?
in root, do the following : 

ps -aux | grep centengine find the pid of the process

tr '\0' '\n' <  /proc/<PID>/environ

 

Then you can sudo su centreon-engine and change your env variable to match what you saw in the last command.

if you execute the plugin in this condition do you have the same output as the webapp ?

 

Evan


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 27, 2025
Hello Evanadam,This is what I get, 
but then I don't know how to modify the "env" variable.

Forum|alt.badge.img+3
  • Centreonian
  • 27 replies
  • October 27, 2025

in centreon-engine user, you can copy paste the output of the command you show directly in your terminal, then use the command “env” to list all environment variable, and use the command 

unset variableName to remove every variable not present in your capture. Once you have the same environment variable you can try to execute the plugin again


sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • October 28, 2025

I think you use the centreon ssh connector for the plugins in check_command configuration . if you disable it normally it will be fine .

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 29, 2025
Hello Sdouce,I deactivated the plugin, replaced "find" with "ls" (it works on others), and the error message is different now:
However, from Centreon Engine, the command returns two different codes: 0 if the "montage" folder exists and "3" if it doesn't.Thank you

sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • October 29, 2025

Did you test it from centreon-engine user on your poller ? 
Try /bin/ls for the command 
add --sshcli-option='-o=StrictHostKeyChecking=no' 

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 29, 2025
I'm making progress :-)- First attempt without the montage.txt file- Then with it
The variable return value seems correct from Centreon Engine, but from the interface, I still get the message: "execute command failed"

 


sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • October 29, 2025

 --manage-returns='%(code) == 0,OK,File xxx exist#%(code) == 1,CRITICAL,File xxx not exist#,UNKNOWN,XXXXXXX'

You try to do ‘ls /home/montage.txt’

what apend when you execute from centreon-engine user 

ssh -i /var/lib/centreon-engine/.ssh/id_rsa.pu root@YOUR_IP ‘ls /home/montage.txt’
echo $?

This return code you want to manage to buid your managed-return …. 

PS: Your IP address is readable as well . 

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 29, 2025
1st test with id_rsa.pub2nd test with id_ecdsa

sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • October 29, 2025

Ok first your id_rsa key should have 0600 right … Sorry you have to connect  with id_rsa not id_rsa.pub

 

And launch : 

ssh -i /var/lib/centreon-engine/.ssh/id_rsa.pu root@YOUR_IP ‘ls /home/montage.txt && /bin/echo $?’
 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 29, 2025
1. Test without the "montage.txt" file2. Test with the file

 


sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • October 29, 2025

no space between $ and ? you have to write echo $? 

 

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 29, 2025
with and without

 


sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • October 29, 2025

I dont understand this ‘without’ version of command line . 

The firts command line work as well :

  • It show you the result of you ls : /home/montage.txt
  • It show you the return code:  0

  --manage-returns='%(code) == 0,OK,File xxx exist#%(code) == 1,CRITICAL,File xxx not exist#,UNKNOWN,XXXXXXX'

 

The other code you can catch them to do your monitoring

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 30, 2025
Hello,The first line is the output of the command when the "montage.txt" file is created on the server being monitored.The second line is the output without the "montage.txt" file.I do get two different return codes, but from the Centreon interface, the status remains "unknown" instead of changing to "available" or "critical".

Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 31, 2025

 

Hello Sdouce,

When I run the full command from Centreon Engine, everything works correctly. The command returns "0" when the "montage.txt" file is present.

However, from the graphical interface, I still get the message "execute command fail".

 


sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • October 31, 2025

It seem so you have an environnent variable on your centreon-engine. 
Try to connect on centreon-engine user 

Type env and unset one by one one and execute in commande line 

unset PATH

centreon_linux_ssh.pl --plugin=os::linux::local::plugin --mode=cmd-return --hostn …..

 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • October 31, 2025
I'm afraid I don't quite understand.
Here's the output of "env" from Centreon Engine.

sdouce
Forum|alt.badge.img+12
  • Builder **
  • 53 replies
  • November 3, 2025

Type su - centreon-engine 

under centreon-engine type 

unset PATH 

and execute the plugin command line . 

Do it for all variable present in env beggining by PATH , LANG, 


Forum|alt.badge.img+5
  • Author
  • Steward **
  • 67 replies
  • November 3, 2025
Hello,I'm lost. Sorry.I'm in console mode under Centreon-engine.But I don't understand what I'm supposed to test.