Hello Nagios Team
How to report number of CPU cores with check_xi_service_nsclient ?
Thank you
Number of CPU cores with CPULOAD (nsclient)
Re: Number of CPU cores with CPULOAD (nsclient)
You should be able to do this with a powershell script. You'll need to create it, and then modify your nsclient configuration to include that external script as a command.
Here's the one liner powershell script. Create a file called check_cpu_cores.ps1 and place it in the C:\Program Files\NSClient++\scripts\powershell\ directory.
Once you've created the file, open up your nsclient configuration and look for -
below that, add -
At this point you should be able to use the check_cpu_cores script. See an example output below -
Here's the one liner powershell script. Create a file called check_cpu_cores.ps1 and place it in the C:\Program Files\NSClient++\scripts\powershell\ directory.
Code: Select all
Get-WmiObject -class Win32_processor | findstr NumberOfCores
Code: Select all
[/settings/external scripts/scripts]
Code: Select all
;check_cpu_cores external script
check_cpu_cores = cmd /c echo scripts\powershell\check_cpu_cores.ps1; exit(0) | powershell.exe -command -
Code: Select all
[root@suse11 libexec]# ./check_nrpe -H 192.168.5.47 -c check_cpu_cores
NumberOfCores : 4
Former Nagios Employee
Re: Number of CPU cores with CPULOAD (nsclient)
Thank you, so either that or SNMP (which provides Cores information)rkennedy wrote:You should be able to do this with a powershell script. You'll need to create it, and then modify your nsclient configuration to include that external script as a command.
Here's the one liner powershell script. Create a file called check_cpu_cores.ps1 and place it in the C:\Program Files\NSClient++\scripts\powershell\ directory.Once you've created the file, open up your nsclient configuration and look for -Code: Select all
Get-WmiObject -class Win32_processor | findstr NumberOfCoresbelow that, add -Code: Select all
[/settings/external scripts/scripts]At this point you should be able to use the check_cpu_cores script. See an example output below -Code: Select all
;check_cpu_cores external script check_cpu_cores = cmd /c echo scripts\powershell\check_cpu_cores.ps1; exit(0) | powershell.exe -command -Code: Select all
[root@suse11 libexec]# ./check_nrpe -H 192.168.5.47 -c check_cpu_cores NumberOfCores : 4
- we could now close this one.
Re: Number of CPU cores with CPULOAD (nsclient)
Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.
Be sure to check out the Knowledgebase for helpful articles and solutions!