NSClient++ Help (#1) - nagios get vbscript parameters / recuperer des parametres de nagios dans un VbScript? [SOLVED] (#604) - Message List

nagios get vbscript parameters / recuperer des parametres de nagios dans un VbScript? [SOLVED]

Hello,

My question is illustrated in french is the following pdf document :
http://lapageatotof.free.fr/docs/it/others/NSClientQuestion.pdf

I try to get parameters on a vbscript but I don t know how.
As show in the PDF, in the NSC.ini file, I put a line in the External Scripts section, the line is eneded like

myvbscript.vbs $ARG1$

my question is :
how can I get in my vbscript the $ARG1$ value ?

In French :
Bonjour,
Ma question est illustrée dans le PDF joint.
Je cherche à savoir comment récupérer un paramètre passé dans la ligne du script
check_nrpe
de nagios dans le vbscript déclaré dans le NSC.ini de nsclient et je n'y arrive pas. Quelle est la bonne technique ?

  • Message #1846

    I can explain differently :

    my commands.cfg file on my nagios server :

    define command{
            command_name    check_nrpe_test
            command_line    $USER1$/check_nrpe -H mynrpeserver -c $ARG1$ -a $ARG2$
            }
    

    my windows.cfg file :

    define service{
            use                             generic-service
            host_name                       myaimserver
            service_description             Check FilePresence with NRPE
            check_command                   check_nrpe_test!check_fileexist!onevar
            check_period                    24x7
            notifications_enabled           1
            }
    

    my NSC.ini :

    [External Scripts]
    ;check_es_long=scripts\long.bat
    ;check_es_ok=scripts\ok.bat
    ;check_es_nok=scripts\nok.bat
    ;check_vbs_sample=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs
    ;check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -
    check_fileexist=cscript.exe //T:30 //NoLogo scripts\lib\wrapper.vbs scripts\check_fileexist.vbs %ARGS% $ARG2$
    

    and here is what I get in arguments from my check_fileexist.vbs script : Argument number 0 : scripts\check_fileexist.vbs Argument number 1 : %ARGS% Argument number 2 : $ARG2$

    so, for example, $ARG2$ is not replace by 'onevar'

Subscriptions