Hello,
Im testing this check:
https://exchange.nagios.org/directory/P ... ck/details
And i get this error:
Cannot process argument
transformation on parameter 'critical'. Cannot convert value "$" to type "System.Int32". Error: "Input string was not
in a correct format."
At line:1 char:42
+ scripts\check_certificate_expiration.ps1 $ARG1$; exit $LastExitCode
+ ~~~~~~
+ CategoryInfo : InvalidData: (:) [check_certificate_expiration.ps1], ParameterBindingArgumentTransformat
ionException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,check_certificate_expiration.ps1
If i try with -w and -c we got this other error:
/check_centreon_nrpe: invalid option -- 'w'
Any idea ?
Thanks,
Error checking .ps1 to check certificate expiration date
Re: Error checking .ps1 to check certificate expiration date
I'd guess the arguments were incorrect but it's a script so you can make it print more to give you more clues.
Re: Error checking .ps1 to check certificate expiration date
If i run the script on a windows server works corretly, it must be some incompatibility with nagios/linux.
I will continue looking for information.
Thanks.
I will continue looking for information.
Thanks.
Re: Error checking .ps1 to check certificate expiration date
The arguments were probably wrong, but as it's a script, you can always make it print more information.
run 3
run 3
Re: Error checking .ps1 to check certificate expiration date
This is the help, just two arguments, c and w
if ($help)
{
Write-Output ""
Write-Output "---------------------------------------------"
Write-Output "nm-check-certificate-expiration.ps1 v.$scriptversion"
Write-Output "---------------------------------------------"
Write-Output ""
Write-Output "Options:"
Write-Output "-c or -critical (number)"
Write-Output "-h or -help display help"
Write-Output "-w or -warning (number)"
Write-Output ""
Write-Output "Example:"
Write-Output ".\nm-check-certificate-expiration.ps1 -c 4 -w 10"
Write-Output ""
Write-Output "For more information visit:"
Write-Output "http://networklore.com/nelmon/"
Write-Output "http://networklore.com/windows-certificate-expiration/"
Write-Output ""
exit $returnStateUnknown
}
Re: Error checking .ps1 to check certificate expiration date
Regarding the "-w" and "-c" options, it seems that they are not recognized by the check_centreon_nrpe command. Double-check the command's syntax and options to ensure you are using the correct parameters.
Re: Error checking .ps1 to check certificate expiration date
Post the service defined, the command on the nagios host to run it, and the command defined on the host where it runs along with the agent used to run it.
It seems evident that along the line there's a syntax error.
It seems evident that along the line there's a syntax error.