Unknown Command(s)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Unknown Command(s)

Post by jkinning »

I have a powershell script that is working on 6 out of 8 servers to monitor IIS App pool and IIS websites. On these particular servers when I try to run the command I get this:
./check_nrpe -H <host> -c check_iis8_app_pool_state -a CLICPublic
Unknown command(s): check_iis8_app_pool_state

I have the command in the nsclient.ini file and the NSClient++ is running on Windows 2012R2. I cannot figure out why the client doesn't know the command.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Unknown Command(s)

Post by tgriep »

A couple of things to try is to change the command to use back slashes and edit the lastexitcode so change the following line from

Code: Select all

check_iis8_app_pool_state=cmd /c echo scripts/powershell/check_iis8_app_pool_state.ps1 $ARG1$; exit($lastexitcode) | powershell.exe -command -
to

Code: Select all

check_iis8_app_pool_state=cmd /c echo scripts\powershell\check_iis8_app_pool_state.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command -
Save the file and restart the NSClient++ service.
If you still have issues, please post the nsclient.log file so we can view the error.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Unknown Command(s)

Post by jkinning »

still getting the same thing.

Log file is attached.
You do not have the required permissions to view the files attached to this post.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Unknown Command(s)

Post by SteveBeauchemin »

If you do have existing systems that work properly - can you copy the ini file from one of those working systems, overwrite the file on the system where the problem is, and stop/start the service?

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Unknown Command(s)

Post by dwhitfield »

In addition to what @SteveBeauchemin said...
jkinning wrote:I have a powershell script
Do you mean https://raw.githubusercontent.com/ester ... _state.ps1 ? If not, could you post the code? You can PM it, if you prefer.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Unknown Command(s)

Post by jkinning »

You can close this one up. I was looking at these systems and they had two different versions of the NSClient++ installed. I uninstalled both versions and then installed one version and my checks are working.

Thanks!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Unknown Command(s)

Post by dwhitfield »

Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!
Locked