Page 1 of 1
Windows NRPE commands for CPU monitoring
Posted: Mon Mar 12, 2018 1:22 pm
by dlukinski
Hello XI support
How to monitor CPU via NSclient with NRPE instead of NSclient commands?
Thank you
Re: Windows NRPE commands for CPU monitoring
Posted: Mon Mar 12, 2018 1:41 pm
by lmiltchev
There are usually some aliases for check_cpu, defined in the nsclient.ini file that you could use.
Example:
In the nsclient.ini:
Code: Select all
alias_cpu_all = check_cpu filter=none "warn=load > 80" "crit=load > 90" time=5m time=1m time=30s
Running a check from the CLI on the Nagios XI server:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c alias_cpu_all
OK: CPU load is ok.|'core 0 5m'=10%;80;90 'core 1 5m'=1%;80;90 'core 2 5m'=2%;80;90 'core 3 5m'=3%;80;90 'core 4 5m'=5%;80;90 'core 5 5m'=0%;80;90 'core 6 5m'=0%;80;90 'core 7 5m'=5%;80;90 'total 5m'=3%;80;90 'core 0 1m'=4%;80;90 'core 1 1m'=0%;80;90 'core 2 1m'=2%;80;90 'core 3 1m'=0%;80;90 'core 4 1m'=3%;80;90 'core 5 1m'=0%;80;90 'core 6 1m'=0%;80;90 'core 7 1m'=2%;80;90 'total 1m'=1%;80;90 'core 0 30s'=2%;80;90 'core 1 30s'=0%;80;90 'core 2 30s'=1%;80;90 'core 3 30s'=0%;80;90 'core 4 30s'=0%;80;90 'core 5 30s'=0%;80;90 'core 6 30s'=0%;80;90 'core 7 30s'=1%;80;90 'total 30s'=0%;80;90
As an alternative, you could use the "check_cpu" command (instead of using an alias, and "hardcoding" the args) and pass whatever arguments you need to.
Example:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_cpu -a filter=none "warn=load > 80" "crit=load > 90"
OK: CPU load is ok.|'core 0 5m'=10%;80;90 'core 1 5m'=0%;80;90 'core 2 5m'=3%;80;90 'core 3 5m'=1%;80;90 'core 4 5m'=4%;80;90 'core 5 5m'=0%;80;90 'core 6 5m'=0%;80;90 'core 7 5m'=4%;80;90 'total 5m'=3%;80;90 'core 0 1m'=5%;80;90 'core 1 1m'=0%;80;90 'core 2 1m'=2%;80;90 'core 3 1m'=0%;80;90 'core 4 1m'=2%;80;90 'core 5 1m'=0%;80;90 'core 6 1m'=0%;80;90 'core 7 1m'=2%;80;90 'total 1m'=1%;80;90 'core 0 5s'=5%;80;90 'core 1 5s'=0%;80;90 'core 2 5s'=3%;80;90 'core 3 5s'=0%;80;90 'core 4 5s'=2%;80;90 'core 5 5s'=0%;80;90 'core 6 5s'=0%;80;90 'core 7 5s'=3%;80;90 'total 5s'=1%;80;90
For more info on the check_cpu usage, please review the NSClient++ documentation here:
https://docs.nsclient.org/reference/win ... #check_cpu
Hope this helps. Thank you!
Re: Windows NRPE commands for CPU monitoring
Posted: Mon Mar 12, 2018 1:52 pm
by dlukinski
lmiltchev wrote:There are usually some aliases for check_cpu, defined in the nsclient.ini file that you could use.
Example:
In the nsclient.ini:
Code: Select all
alias_cpu_all = check_cpu filter=none "warn=load > 80" "crit=load > 90" time=5m time=1m time=30s
Running a check from the CLI on the Nagios XI server:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c alias_cpu_all
OK: CPU load is ok.|'core 0 5m'=10%;80;90 'core 1 5m'=1%;80;90 'core 2 5m'=2%;80;90 'core 3 5m'=3%;80;90 'core 4 5m'=5%;80;90 'core 5 5m'=0%;80;90 'core 6 5m'=0%;80;90 'core 7 5m'=5%;80;90 'total 5m'=3%;80;90 'core 0 1m'=4%;80;90 'core 1 1m'=0%;80;90 'core 2 1m'=2%;80;90 'core 3 1m'=0%;80;90 'core 4 1m'=3%;80;90 'core 5 1m'=0%;80;90 'core 6 1m'=0%;80;90 'core 7 1m'=2%;80;90 'total 1m'=1%;80;90 'core 0 30s'=2%;80;90 'core 1 30s'=0%;80;90 'core 2 30s'=1%;80;90 'core 3 30s'=0%;80;90 'core 4 30s'=0%;80;90 'core 5 30s'=0%;80;90 'core 6 30s'=0%;80;90 'core 7 30s'=1%;80;90 'total 30s'=0%;80;90
As an alternative, you could use the "check_cpu" command (instead of using an alias, and "hardcoding" the args) and pass whatever arguments you need to.
Example:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_cpu -a filter=none "warn=load > 80" "crit=load > 90"
OK: CPU load is ok.|'core 0 5m'=10%;80;90 'core 1 5m'=0%;80;90 'core 2 5m'=3%;80;90 'core 3 5m'=1%;80;90 'core 4 5m'=4%;80;90 'core 5 5m'=0%;80;90 'core 6 5m'=0%;80;90 'core 7 5m'=4%;80;90 'total 5m'=3%;80;90 'core 0 1m'=5%;80;90 'core 1 1m'=0%;80;90 'core 2 1m'=2%;80;90 'core 3 1m'=0%;80;90 'core 4 1m'=2%;80;90 'core 5 1m'=0%;80;90 'core 6 1m'=0%;80;90 'core 7 1m'=2%;80;90 'total 1m'=1%;80;90 'core 0 5s'=5%;80;90 'core 1 5s'=0%;80;90 'core 2 5s'=3%;80;90 'core 3 5s'=0%;80;90 'core 4 5s'=2%;80;90 'core 5 5s'=0%;80;90 'core 6 5s'=0%;80;90 'core 7 5s'=3%;80;90 'total 5s'=1%;80;90
For more info on the check_cpu usage, please review the NSClient++ documentation here:
https://docs.nsclient.org/reference/win ... #check_cpu
Hope this helps. Thank you!
Would this one work?
-a show-all -a 'warn=load>80' 'crit=load>90' show-all
Thanks
Re: Windows NRPE commands for CPU monitoring
Posted: Mon Mar 12, 2018 2:21 pm
by lmiltchev
Here's the output on my text box, when using the "--show-all" option:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_cpu -a 'warn=load>80' 'crit=load>90' show-all
OK: 5m: 3%, 1m: 1%, 5s: 0%|'total 5m'=3%;80;90 'total 1m'=1%;80;90 'total 5s'=0%;80;90
Note: I am using NSClient++ ver. 0.5.1.44.
Re: Windows NRPE commands for CPU monitoring
Posted: Mon Mar 12, 2018 3:33 pm
by dlukinski
lmiltchev wrote:Here's the output on my text box, when using the "--show-all" option:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_cpu -a 'warn=load>80' 'crit=load>90' show-all
OK: 5m: 3%, 1m: 1%, 5s: 0%|'total 5m'=3%;80;90 'total 1m'=1%;80;90 'total 5s'=0%;80;90
Note: I am using NSClient++ ver. 0.5.1.44.
Thank you.
Would it be ok to use 0.5.2.x ?
Re: Windows NRPE commands for CPU monitoring
Posted: Mon Mar 12, 2018 3:39 pm
by lmiltchev
Would it be ok to use 0.5.2.x ?
I don't see why not.
Let us know if you have any more questions or we can lock the thread. Thanks!
Re: Windows NRPE commands for CPU monitoring
Posted: Mon Mar 12, 2018 3:56 pm
by dlukinski
lmiltchev wrote:Would it be ok to use 0.5.2.x ?
I don't see why not.
Let us know if you have any more questions or we can lock the thread. Thanks!
Please lock