Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_cpu_info

Rating
0 votes
Favoured:
0
Current Version
1.0
Compatible With
  • Nagios 4.x
Owner
License
GPL
Hits
12505
Files:
FileDescription
check_cpu_info: Nagios Plugin
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This plugin is successfully tested on Ubuntu server-client environment. This script, written in bash is intended for getting total CPU use in percentage along with four important CPU usage information like User, System,Idle and IOwait. By default it will give us warning and critical at 95% and 98% total CPU usages respectively. You can specify the warning and critical point later while creating command.
Testing script locally (after downloading script make sure script is in executable mode)

user@localhost$ chmod +x check_cpu_info
user@localhost$ ./check_cpu_info
[CPU_INFO: 2.90% ] User: 0.00% - System: 2.90% - Idle: 97.10% - IOwait: 0.00% | - Nice: 0.00% - Hardware_interrupts: 0.00% - Software_interrupts: 0.00% - Steal: 0.00%

---------===========---------

Getting remote CPU information for remote client using nrpe. Note that information like nice, hi, si and steal are disable on display.

1. On Server:
1.1. define service
root@server#vim /usr/local/nagios/etc/servers/clients.cfg
define service {
use generic-service
host_name
service_description CPU INFO
check_command check_nrpe_cpu
notifications_enabled 0
}

1.2. define command
root@server#vim /usr/local/nagios/etc/objects/commands.cfg
define command {
command_name check_nrpe_cpu
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_cpu
register 1
}
#/etc/init.d/nagios restart

NOTE: Make sure you have /usr/local/nagios/libexec/check_nrpe file. Sometimes it is located under /usr/lib/nagios/plugins/check_nrpe. In that case copy the file to previous location.

2. On Client: (move check_cpu_info plugin inside /usr/lib/nagios/plugins/)
root@client#vim /etc/nagios/nrpe.cfg
command[check_cpu]=/usr/lib/nagios/plugins/check_cpu_info -w 80 -c 90
#/etc/init.d/nagios-nrpe-server restart