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.
Unknown Command(s)
Unknown Command(s)
You do not have the required permissions to view the files attached to this post.
Re: Unknown Command(s)
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
to
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.
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 -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 -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!
Re: Unknown Command(s)
still getting the same thing.
Log file is attached.
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)
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
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
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)
In addition to what @SteveBeauchemin said...
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 wrote:I have a powershell script
Re: Unknown Command(s)
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!
Thanks!
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Unknown Command(s)
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!