NSClient++ Help (#1) - nrpe_nt to nsclient (#996) - Message List

nrpe_nt to nsclient

Hi

I am in process of moving an very old nagios environment over to nagios xi.

It doing a bunch of passive checks using old nrpe_nt. I am wanting to update this to nsclient and running in to issues.

have nrpe working thru nsclient++ (version 4.0.172)

its the scripts i am haivng issues with, its a bunch that have come from here https://kb.groundworkopensource.com/display/SUPPORT/How+to+use+WMI+agentless+plugins

nrpe_nt

command[get_counter_large_rawcount]=cscript.exe //nologo //T:60 c:\nrpe_nt\plugins\v2\check_counter_large_rawcount.vbs -h "$ARG1$" -class "$ARG2$" -inst "$ARG3$" -prop "$ARG4$" -w "$ARG5$" -c "$ARG6$"

nsclient++

get_counter_large_rawcount=cscript.exe //nologo //T:60 C:\Program Files\NSClient++\scripts\check_counter_large_rawcount.vbs -h "$ARG1$" -class "$ARG2$" -inst "$ARG3$" -prop "$ARG4$" -w "$ARG5$" -c "$ARG6$"

I have updated tried both the below settings I have tried both

[/settings/NRPE/server]
allow arguments=1
allow arguments = true

So you can see nrpe works

[root@ libexec]# ./check_nrpe  -H 10.7.5.6 -c CheckCPU -a warn=80 crit=90 time=20m time=10s time=4                                               OK CPU Load ok.|'20m'=0%;80;90 '10s'=0%;80;90 '4'=1%;80;90

you can see the script does not work

[root@ libexec]# ./check_nrpe -t 60 -H 10.7.5.6 -c get_counter_large_rawcount -a "10.7.2.100" "Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics" "*" "UserConnections" "180" "200"
UNKNOWN: No handler for that command.

If i call from same nagios machine to the nrpe_nt machine it works. So its something specific with the nsclient++ machine

[root@ libexec]# ./check_nrpe -t 60 -H 10.7.6.3 -c get_counter_large_rawcount -a "10.7.2.100" "Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics" "*" "UserConnections" "180" "200"
OK -  'UserConnections' = 28; |''=28;180;200;;
  • Message #2639

    Best way to figure this out is to:

    net stop nscp
    nscp test
    ...
    ...
    exit
    net start nscp
    

    The ... will most likely contain some errors which will give you a hint as to whats wrong...

    • Message #2645

      what i needed to do in the end was, the two things below (move allow arguments) and put " around path of vbs script.

      scripts allow arguments = true

      scripts/scripts get_counter_large_rawcount=cscript.exe nologo T:60 "C:\Program Files\NSClient++\scripts\check_counter_large_rawcount.vbs" -h "$ARG1$" -class "$ARG2$" -inst "$ARG3$" -prop "$ARG4$" -w "$ARG5$" -c "$ARG6$"

      • Message #2647

        It would probably be a good idea to also add
        instead of \ to prevent accidental ecaping. At some point the system will start warning about the "old" non escaped syntax...

        scripts/scripts get_counter_large_rawcount=cscript.exe nologo T:60 "C:\\Program Files\\NSClient++\\scripts\\check_counter_large_rawcount.vbs" -h "$ARG1$" -class "$ARG2$" -inst "$ARG3$" -prop "$ARG4$" -w "$ARG5$" -c "$ARG6$"
        

        Michael Medin

Subscriptions