ssax wrote:Did you already write the powershell script to perform the check?
Are you already checking these servers with NRPE at all?
You can go to Configure > Configuration Wizards > NRPE
- Display Name: Whatever you'd like
- Remote NRPE Command: check_pstate
- Command Args: 'your unique commandline details'
Then continue the wizard and let it apply config.
That should get you up and running.
Let us know the results.
i wrote the powershell script with my arg inline:
Code: Select all
Get-WmiObject Win32_Process -Filter "CommandLine like '%com.domain.reportgenerator.ReportGenerator%'"
on the windows host i edited the nsclient.ini:
Code: Select all
check_rgstate = cmd /c echo scripts\check_rgstate.ps1 "$ARG1$"; exit($lastexitcode) | powershell.exe -command -
and then on my nagios server (linux):
Code: Select all
define service {
use critical-service
hostgroup_name test_rptgen
service_description Process - ReportGen
check_command check_nrpe!check_rgstate!warn=2!crit=1
notifications_enabled 0
}
But running the check from the nagios server returns this:
Code: Select all
[root@nagiosServer services]# /lib/nagios/libexec/check_nrpe -H rptgen01 -c check_rgstate
__GENUS : 2
__CLASS : Win32_Process
__SUPERCLASS : CIM_Process
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_Process.Handle="5820"
__PROPERTY_COUNT : 45
__DERIVATION : {CIM_Process, CIM_LogicalElement,
CIM_ManagedSystemElement}
__SERVER : RPTGEN01
__NAMESPACE : root\cimv2
__PATH : \\RPTGEN01\root\cimv2:Win32_Process.Handle="5
820"
Caption : java.exe
CommandLine : java.exe -Xmx4096m
com.domain.reportgenerator.ReportGenerator
CreationClassName : Win32_Process
CreationDate : 20160616153524.495967-360
CSCreationClassName : Win32_ComputerSystem
CSName : RPTGEN01
Description : java.exe
ExecutablePath : C:\Pro
I even tried editing the powershell script to count and still no go.:
Code: Select all
(Get-WmiObject Win32_Process -Filter "CommandLine like '%com.domain.reportgenerator.ReportGenerator%'").count
any ideas what im doing wrong?