Windows check-certificate Unknown command(s) showing
-
- Posts: 222
- Joined: Thu Jul 06, 2017 8:55 am
Windows check-certificate Unknown command(s) showing
Hi Team,
I want to monitor the windows server certificate monitoring using nagios. I have downloaded the check_certificate plugin and executed in server which looks working fine. Find the attachment for output while executed the script.
But when we are calling the same script we are not getting command error from nagios server. The below are the configuration from nagios server end.
define command {
command_name check_nrpe_Certificate
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -u -t 90 -c $ARG1$
}
root@ip-xxxxx:/usr/local/nagios/libexec# ./check_nrpe -H 172.31.89.249 -t 90 -c Check-Certificate
Unknown command(s): check-certificate
We have added some details in nsclient.in as follows below and we copy the script in nsclint++/script/
[/settings/external scripts/]
PSCheckCertificate=cmd /c echo scripts\Check-Certificate.ps1; exit($lastexitcode) | powershell.exe -command -
Please suggest where we are doing mistake.
I want to monitor the windows server certificate monitoring using nagios. I have downloaded the check_certificate plugin and executed in server which looks working fine. Find the attachment for output while executed the script.
But when we are calling the same script we are not getting command error from nagios server. The below are the configuration from nagios server end.
define command {
command_name check_nrpe_Certificate
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -u -t 90 -c $ARG1$
}
root@ip-xxxxx:/usr/local/nagios/libexec# ./check_nrpe -H 172.31.89.249 -t 90 -c Check-Certificate
Unknown command(s): check-certificate
We have added some details in nsclient.in as follows below and we copy the script in nsclint++/script/
[/settings/external scripts/]
PSCheckCertificate=cmd /c echo scripts\Check-Certificate.ps1; exit($lastexitcode) | powershell.exe -command -
Please suggest where we are doing mistake.
Re: Windows check-certificate Unknown command(s) showing
In your nsclient.ini, you've named the command PSCheckCertificate. That is what you should be passing as the command name -c via check_nrpe:grayloglearn wrote: [/settings/external scripts/]
PSCheckCertificate=cmd /c echo scripts\Check-Certificate.ps1; exit($lastexitcode) | powershell.exe -command -
Code: Select all
#check_nrpe -H 172.31.89.249 -t 90 -c PSCheckCertificate
https://docs.nsclient.org/howto/external_scripts/
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
-
- Posts: 222
- Joined: Thu Jul 06, 2017 8:55 am
Re: Windows check-certificate Unknown command(s) showing
Hi team,
We have tried with the below but still we are getting same error.
root@ip-xxxx:/usr/local/nagios/libexec# ./check_nrpe -H 172.31.89.249 -t 90 -c PSCheckCertificate
Unknown command(s): pscheckcertificate
We have tried with the below but still we are getting same error.
root@ip-xxxx:/usr/local/nagios/libexec# ./check_nrpe -H 172.31.89.249 -t 90 -c PSCheckCertificate
Unknown command(s): pscheckcertificate
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Windows check-certificate Unknown command(s) showing
Can you share your nsclient.ini from 172.31.89.249?grayloglearn wrote:Hi team,
We have tried with the below but still we are getting same error.
root@ip-xxxx:/usr/local/nagios/libexec# ./check_nrpe -H 172.31.89.249 -t 90 -c PSCheckCertificate
Unknown command(s): pscheckcertificate
Thanks
-
- Posts: 222
- Joined: Thu Jul 06, 2017 8:55 am
Re: Windows check-certificate Unknown command(s) showing
Hi Team
Please find the attachment for nsclient.ini
Please find the attachment for nsclient.ini
You do not have the required permissions to view the files attached to this post.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Windows check-certificate Unknown command(s) showing
Did you restart the NSClient++ service after adding the PSCheckCertificate command?
-
- Posts: 222
- Joined: Thu Jul 06, 2017 8:55 am
Re: Windows check-certificate Unknown command(s) showing
Yes I have restarted multiple times..
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Windows check-certificate Unknown command(s) showing
I guess next we need to look in the nsclient.log to see what errors are in there
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Windows check-certificate Unknown command(s) showing
Oh I just noticed this in your nsclient.ini file
this
should be this
Then restart nsclient++
this
Code: Select all
[/settings/external scripts/]
PSCheckCertificate=cmd /c echo scripts\Check-Certificate.ps1; exit($lastexitcode) | powershell.exe -command -
Code: Select all
[/settings/external scripts/scripts]
PSCheckCertificate=cmd /c echo scripts\Check-Certificate.ps1; exit($lastexitcode) | powershell.exe -command -