Nous avions un controle via NRPE qui fonctionnait sans probleme. Ce controle exécutait un script Powershell. Le fichier nsclient a été modifié pour accepter les scripts externes.
Nous avons voulu tester avec NRPE3 et impossible de le faire fonctionner.
Nous avons ce retour : CHECK_NRPE STATE CRITICAL: Socket timeout after 30 seconds.
Même en agrandissant le Timeout, le résultat est le même.
Faut il quelque chose de spécial pour utiliser NRPE3 ?
Merci d’avance de votre aide.
Good morning,
We had control via NRPE which worked without problem. This control executed a Powershell script. The nsclient file has been modified to accept external scripts.
We wanted to test with NRPE3 and couldn't get it to work.
We have this feedback: CHECK_NRPE STATE CRITICAL: Socket timeout after 30 seconds.
Even if you enlarge the Timeout, the result is the same.
Here is the command : ./check_centreon_nrpe3 -H HOST -p 5666 -t 30 -c eventps1
Do I need anything special to use NRPE3? Thank you in advance for your assistance.
if you have an error or a timeout when running the command line without any -c option and you don’t get OK, you must first get the OK then you can your command -c.
in your case it was ok with -u -2 -P 8192 → I (0.5.2.41 2018-04-26) seem to be doing fine…
so go with this options and don’t modify nsclient.ini
Thanks, I managed to get the powershell to work.
However, I wanted to put another script into operation.
Tested with nscp.exe: working script
Tested from the CENTREON poller: The script works.
Each command "-c xxx" must exist in your nsclient.ini, like nrpe.cfg on Linux
At the end of your nsclient.ini you should have the command you used previously, eventps1
The line is
eventps1=the real command
Just add more command there, restart service and it should work
The script is present in the ini file and in the script folder.
Its execution is OK from the Poller CENTREON.
On CENTREON (WEB interface), Unable to make this command work.
Oh I misunderstood, sorry…
can you screenshot the command from the web interface (in the detail of the service)
run it “as is” in your poller and screenshot that and send it here (you should mask your private info)
what is displayed by the web will executed “as is” by the poller.
And here !
ok, that’s much clearer
you didn’t put the correct “path”. the command is not in the “/” , you need to put the correct path, if it is a standard plugin, you should use the same $$ variable as the other commands, example ;
here on my setup it is “$CENTREONPLUGINS$” before “/”
On the other commands that work, we put this:
With the long path, I get this error message:
ok, for NRPE the “$$” variable is not $CENTREONPLUGINS$, it is $USER1$ (for old nagios and nrpe binaries, but the full path is ok to use.
for your last part, that is not an error message, it is “ok” but I fear you are trying to do something you are not understanding, or I don’t understand what is your problem... that help windows is not the execution of the command, it is just to run the command with --help to help you put the right parameters
(and that last screenshot is ok, it found the executable, ran it with --help and you get the output)
you are making a check command (“vérifier” = check)
this is a command that will be used by a a centreon service, in host.
normally you should make your command with macro like this
with this command, you can use this command in your service,
it will use the ip address of the host and you will have an automatic MACRO on your service that will be called COMMAND, where you will set the command you want to call (here you will put eventps1)
then you push your config and run your service check
after it ran, you will see the command line “generated” on the detail pane in the ressource view :
that is what you need to check if it is the right command, you can copy the command text and run that manually on the poller