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/dis ... ss+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;;
nrpe_nt to nsclient
Re: nrpe_nt to nsclient
I dare say you are actually pretty close here you might have just missed something really simple. The error message you are receiving pretty much states "I can't find that command in my INI file", so first of all make sure that the command you added was under the [NRPE Handlers] section of the INI file. You can even leave the command to be exactly the same as how you had it with nrpe_nt (that is to say you don't even need to remove the word command or the square brackets):
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$"
I prefer to leave the command[] intact so that it's uniform with the *nix NRPE daemon (it also allows me to quickly locate the NRPE section). Once you've made sure that's done... Save the file and restart the NSClient++ service (you need to do this otherwise it won't pick up the changes). With this done it should work no problems, if you still encounter errors then check nsclient.log and see if you can find any clues there.
Ninja edit: You should also have allow_arguments=1
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$"
I prefer to leave the command[] intact so that it's uniform with the *nix NRPE daemon (it also allows me to quickly locate the NRPE section). Once you've made sure that's done... Save the file and restart the NSClient++ service (you need to do this otherwise it won't pick up the changes). With this done it should work no problems, if you still encounter errors then check nsclient.log and see if you can find any clues there.
Ninja edit: You should also have allow_arguments=1
Re: nrpe_nt to nsclient
what i needed to do in the end was, the two things below (move allow arguments) and put " around path of vbs script.
[/settings/external scripts]
allow arguments = true
[/settings/external 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$"
------
jsmurphy - nsclient++ 4.0 configuration file is a bit different than previous versions designed to be alot similar but not much info about it
[/settings/external scripts]
allow arguments = true
[/settings/external 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$"
------
jsmurphy - nsclient++ 4.0 configuration file is a bit different than previous versions designed to be alot similar but not much info about it
Re: nrpe_nt to nsclient
Glad you were able to find a solution!
Re: nrpe_nt to nsclient
Oh NSclient 4.0, I haven't played with that one yet. I've been waiting for a stable release (speaking of which I should probably go look), glad you got it working!Cajun wrote: jsmurphy - nsclient++ 4.0 configuration file is a bit different than previous versions designed to be alot similar but not much info about it