Skip to main content

Hi,

I added centreon_linux_ssh plugin to be able to execute some shell scripts on remote servers.

 

I generated public/private ssh keys.

I copied the public key on my remote server.

I tested connection to the remote server without password and it’s works fine.

 

But how to use macros to execute my script ?

 

My script is based on remote server:

 

  • Remote server IP: 10.200.10.1
  • Path of the script: /usr/share/snmp/my-scripts/vmpro.sh

 

The script return the status of a running server (OK, CRITICAL or UNKNOWN.

 

Here is my service created:

 

 

Thank you for help

I have this error now:

 

 


Hi,

 

One syntax of "manage returns" is :

exit_code1,OK|WARNING|UNKNOWN|CRITICAL,information_text11#exit_code2,OK|WARNING|UNKNOWN|CRITICAL,information_text2...]]#,OK|WARNING|UNKNOWN|CRITICAL,information_text_other_cases]

Here is an example :

0,OK,Etat OK#1,WARNING,Etat warning#,CRITICAL,Etat KO

For your case, you should try :

0,OK,State OK#2,CRITICAL,State critical#3,WARNING,State warning#,WARNING,Unmanaged exit code

Regards


Reply