monitor cpu utilization
monitor cpu utilization
Hi
Is it possible to monitor CPU utilization with nagios.
Regards
Rahul
Is it possible to monitor CPU utilization with nagios.
Regards
Rahul
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: monitor cpu utilization
Yes it is, on what device are you looking to monitor CPU Utilization on? A Windows server, Linux server...etc?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: monitor cpu utilization
You can definitely do this, the easiest way would be through NRPE. Please take a look at these pieces of documentation:
Overview: http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
This document will walk you through how to install NRPE on the Linux remote host, and how to set up a service configuration, and check command to check this host for it's CPU load. If you need additional guidance let us know!
Overview: http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
This document will walk you through how to install NRPE on the Linux remote host, and how to set up a service configuration, and check command to check this host for it's CPU load. If you need additional guidance let us know!
Re: monitor cpu utilization
I have already setup nagios,nrpe and I'm monitoring the cpu load.
What I need to monitor is the %CPU utilization and also be able to graph it using something like pnp4nagios, nagiosgraph or cacti.
Regards
Rahul
What I need to monitor is the %CPU utilization and also be able to graph it using something like pnp4nagios, nagiosgraph or cacti.
Regards
Rahul
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: monitor cpu utilization
Have you taken a look at integrating this plugin with your NRPE setup?:
http://exchange.nagios.org/directory/Pl ... ts/details
This provides a number of useful stats other than the standard Linux Load collection. You would simply place this plugin on the remote host, set up a command definition in the NRPE.cfg file on that server, and then call that command from the Nagios server using check_nrpe.
http://exchange.nagios.org/directory/Pl ... ts/details
This provides a number of useful stats other than the standard Linux Load collection. You would simply place this plugin on the remote host, set up a command definition in the NRPE.cfg file on that server, and then call that command from the Nagios server using check_nrpe.
Re: monitor cpu utilization
I get the error NRPE: Unable to read output on the nagios web console
I placed the plugin in the folder /usr/local/nagios/libexec/
I placed the below command def in nrpe.cfg
command[check_cpu_utilization]=/usr/local/nagios/libexec/check_linux_stats.pl -C -w 90 -c 100 -s 5
Are there any perl modules that need to be installed
I placed the plugin in the folder /usr/local/nagios/libexec/
I placed the below command def in nrpe.cfg
command[check_cpu_utilization]=/usr/local/nagios/libexec/check_linux_stats.pl -C -w 90 -c 100 -s 5
Are there any perl modules that need to be installed
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: monitor cpu utilization
You may want to place $ARG1$ and $ARG2$ for example, in the -w and -c sections of the remote server's command definition to save some time if you decide to change the warning and critical values in the future, though, as you have it defined now, how are you calling the plugin from Nagios? From the command line? It is recommended to first test it from the command line and then add it into your configuration files to make sure it works before the final configuration steps.
Re: monitor cpu utilization
Just to clarify - you placed the plugin and defined the command on the remote server, correct?I placed the plugin in the folder /usr/local/nagios/libexec/
I placed the below command def in nrpe.cfg
command[check_cpu_utilization]=/usr/local/nagios/libexec/check_linux_stats.pl -C -w 90 -c 100 -s 5
Are there any perl modules that need to be installed
Try running it locally to make sure it works (before you even try using it with NRPE):
Code: Select all
./check_linux_stats.pl -CCode: Select all
yum install perl-Sys-Statistics-Linux -yBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: monitor cpu utilization
Thank you Guys
Worked after doing #yum install perl-Sys-Statistics-Linux -y
Also made a small change in the script check_linux_stats.pl
my $perfdata .= "|"
."user=$cpu->{user}% "
."system=$cpu->{system}% "
."iowait=$cpu->{iowait}% "
."InUse=$cpu_used%;$o_warning;$o_critical";
print "CPU $status : InUse $cpu_used% $perfdata";
so that it will return cpu used as opposed to %idle
Worked after doing #yum install perl-Sys-Statistics-Linux -y
Also made a small change in the script check_linux_stats.pl
my $perfdata .= "|"
."user=$cpu->{user}% "
."system=$cpu->{system}% "
."iowait=$cpu->{iowait}% "
."InUse=$cpu_used%;$o_warning;$o_critical";
print "CPU $status : InUse $cpu_used% $perfdata";
so that it will return cpu used as opposed to %idle