Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
From the CLI
root@tgcs017:/usr/local/nagios/etc/objects# /usr/local/nagios/libexec/./check_nrpe -H xx.x.x.x -t 60 -c check_iis_conn -a 'TGCS014-N1' 'Default Web Site' '5' '10'
CONNECTIONS OK Default Web Site connections 0 |'connections'=0;5;10
From Powershell on the server
PS C:\program files\nsclient++\scripts\powershell> .\check_iis_connections.ps1 tgcs014-n1 'default web site' 5 9
CONNECTIONS OK default web site connections 0 | connections=0;5;9;
PS C:\program files\nsclient++\scripts\powershell>
root@tgcs017:/usr/local/nagios/etc/objects/windowsservers# /usr/local/nagios/libexec/./check_nrpe -H 10.2.8.28 -t 60 -c Check_iis_conn -a 'TGCS014-N1' 'Default Web Site' '5' '10'
CONNECTIONS OK Default Web Site connections 0 |'connections'=0;5;10
Also changed it to lower case in the cfg file still same error
made the change restarted the nscp service same results here is the details
OK
(for 0d 20h 41m 19s)
Status Information: C:Program FilesNSClient++scriptspowershellcheck_iis_connections.ps1 :
Cannot process argument transformation on parameter 'warning_value'. Cannot
convert value "$" to type "System.Int32". Error: "Input string was not in a
correct format."
At line:1 char:66
+ ... ershell\\check_iis_connections.ps1 "$ARG1$" "$ARG2$" "$ARG3$" "$ARG4$ ...
+ ~~~~~~~~
+ CategoryInfo : InvalidData: (:) [check_iis_connections.ps1], Pa
rameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,check_iis_c
onnections.ps1
Performance Data:
Current Attempt: 1/10 (HARD state)
Last Check Time: 06-06-2018 16:46:11
Check Type: ACTIVE
Check Latency / Duration: 0.000 / 0.707 seconds
Next Scheduled Check: 06-06-2018 17:46:11
Last State Change: 06-05-2018 20:06:22
Last Notification: N/A (notification 0)
Is This Service Flapping?
NO
(0.00% state change)
In Scheduled Downtime?
NO
Last Update: 06-06-2018 16:47:40 ( 0d 0h 0m 1s ago)
Active Checks:
ENABLED
Passive Checks:
ENABLED
Obsessing:
DISABLED
Notifications:
DISABLED
Event Handler:
ENABLED
Flap Detection:
ENABLED
Service Commands
Disable Active Checks Of This Service Disable active checks of this service
Re-schedule Next Service Check Re-schedule the next check of this service
Submit Passive Check Result For This Service Submit passive check result for this service
Stop Accepting Passive Checks For This Service Stop accepting passive checks for this service
Start Obsessing Over This Service Start obsessing over this service
Enable Notifications For This Service Enable notifications for this service
Send Custom Notification Send custom service notification
Schedule Downtime For This Service Schedule downtime for this service
Disable Event Handler For This Service Disable event handler for this service
Disable Flap Detection For This Service Disable flap detection for this service
Clear Flapping State For This Service Clear flapping state for this service
@kwhogster, I guess the goal is to find out how the plugin wants us to pass the parameters. Whether they should be separated by spaces, whether some flags should be before arguments and so on.
Can you run the plugin locally on the windows server using a PowerShell console with all the arguments and let us know if it works locally? If it does please copy the command and output. That way I will know how to adjust the nrpe command.
Can you also upload the plugin here? That way I can test it out.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
From the server using powershell as administrator
PS C:\program files\nsclient++\scripts\powershell> .\check_iis_connections.ps1 tgcs014-n1 'default web site' 5 9
CONNECTIONS OK default web site connections 0 | connections=0;5;9;
PS C:\program files\nsclient++\scripts\powershell>
Guess what I think might be it I then tried to run in power shell as the local user
PS C:\Users\sqladmin> cd "/program files/nsclient++/scripts/powershell"
PS C:\program files\nsclient++\scripts\powershell> .\check_iis_connections.ps1 tgcs014-n1 'default web site' 5 9
Get-Counter : The \\tgcs014-n1\Web Service(default web site)\Current Connections performance counter path is not
valid.
At C:\program files\nsclient++\scripts\powershell\check_iis_connections.ps1:40 char:12
+ $counter = Get-Counter "\\$server\Web Service($website)\Current Conne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Get-Counter], Exception
+ FullyQualifiedErrorId : CounterPathIsInvalid,Microsoft.PowerShell.Commands.GetCounterCommand
CONNECTIONS UNKNOWN default web site not found
PS C:\program files\nsclient++\scripts\powershell>
Bare i mind of have four other powershell scripts that work in nagios on this same server