How to monitor Oracle Database through nagios


check_oracle_health is a plugin to check various parameters of an Oracle database. This perl plugin has to be installing it on running oracle linux server.

Following steps will guide you to install some prerequisites perl packages.

[root@linux01 ~]# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.

cpan[1]> install DBI

cpan[2]> install DBD::Oracle

cpan[3]> install Bundle::CPAN

Download and install monitoring plugin

[root@linux01 ~]# cd /tmp && wget http://labs.consol.de/download/shinken-nagios-plugins/check_oracle_health-1.7.6.1.tar.gz

[root@linux01 ~]# check_oracle_health-1.7.6.1.tar.gz

[root@linux01 ~]# tar xvf check_oracle_health-1.7.6.1.tar.gz

[root@linux01 ~]# cd check_oracle_health-1.7.6.1

[root@linux01 ~]# ./configure

[root@linux01 ~]# make

[root@linux01 ~]# make install

Preparation of the database

In order to be able to collect the needed information from the database a database user with specific privileges is required:

CREATE USER nagios IDENTIFIED BY oradbmon;
GRANT CREATE SESSION TO nagios;
GRANT SELECT any dictionary TO nagios;
GRANT SELECT ON V_$SYSSTAT TO nagios;
GRANT SELECT ON V_$INSTANCE TO nagios;
GRANT SELECT ON V_$LOG TO nagios;
GRANT SELECT ON SYS.DBA_DATA_FILES TO nagios;
GRANT SELECT ON SYS.DBA_FREE_SPACE TO nagios;


— if somebody still uses Oracle 8.1.7…

GRANT SELECT ON sys.dba_tablespaces TO nagios;
GRANT SELECT ON dba_temp_files TO nagios;
GRANT SELECT ON sys.v_$Temp_extent_pool TO nagios;
GRANT SELECT ON sys.v_$TEMP_SPACE_HEADER TO nagios;
GRANT SELECT ON sys.v_$session TO nagios;

Examples

nagios$ check_oracle_health --connect bba --mode tnsping
OK - connection established to bba.

nagios$ check_oracle_health --mode connection-time
OK - 0.17 seconds to connect |
connection_time=0.1740;1;5

nagios$ check_oracle_health --mode sga-data-buffer-hit-ratio
CRITICAL - SGA data buffer hit ratio 0.99% |
sga_data_buffer_hit_ratio=0.99%;98:;95:

For more details please visit the below link.

http://labs.consol.de/lang/en/nagios/check_oracle_health/

Nagios migration to a new Linux server


Here we are going to see the steps to migrate the nagios core from one linux server to another with different architecture.

While transferring all of the existing data, defined hosts, services, email alert scripts and Pnp4nagios data.

Step 1: Build the NEW server

Install fresh CentOS linux on a new server and configure the essential daemons (ssh/network).

Step 2: Install Nagios

After completing the linux installation, we need to install Nagios Core 3.5.1 in new server with necessary configuration.

Once Nagios setup completed, please make sure the dameons are running and able to open it up in web browser.

Step 3: Transfer configuration files

For example, the new server hostname/IPAddress is testserver/192.168.1.10

[root@server.local ~]# scp /usr/local/nagios/etc/*.cfg testserver:/usr/local/nagios/etc/

[root@server.local ~]# scp /usr/local/nagios/etc/objects/*.cfg testserver:/usr/local/nagios/etc/objects/

[root@server.local ~]# scp /etc/httpd/conf.d/nagios.conf testserver:/etc/httpd/conf.d/

Step 4: Check Nagios configuration

Run the below command to check whether newly migrated nagios server is working fine.

[root@testserver ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If you see 0 warnings and 0 errors then we are good on this migration.

Total Warnings: 0
Total Errors: 0

Step 5: Pnp4nagios migration

Please check my previous post to migrate the pnp4nagios from one linux server to another.

Great day, Thanks 🙂

Convert pnp4nagios graph data from one linux machine to another


Following steps used to convert pnp4nagios data between linux servers (32 bit to 64 bit)

Step 1: Check whether rrdtool is installed on source machine

[root@server.local ~]# which rrdtool
/usr/bin/rrdtool

If rrdtool package is not installed then please install using below commands

[root@server.local ~]# yum install rrdtool

Step 2: Convert RRD data to XML

[root@server.local ~]# /usr/bin/rrdtool dump stats.rrd stats.xml

Step 3: Transfer XML file

Transfer the XML files to the destination machine (using scp/rsync commands)

[root@server.local ~]# scp stats.xml root@client.local:/usr/local/pnp4nagios/var/perfdata/testserver/

Step 4: Convert XML file to RRD

On destination machine convert the XML file back to RRD with RRDtool command

[root@client.local ~]# /usr/bin/rrdtool restore stats.xml stats.rrd

[root@client.local ~]# chown -R nagios:nagios /usr/local/pnp4nagios/var/perfdata

Step 5: Restart nagios and apache services

[root@client.local ~]# /etc/init.d/nagios restart
[root@client.local ~]# /etc/init.d/httpd restart

That’s it.

If you want to convert large no. of rrd file to xml then please make use of the below commands

[root@server.local ~]# for i in `find -name "*.rrd"`; do rrdtool dump $i > $i.xml; done

[root@client.local ~]# for i in `find -name "*.xml"`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done

Pnp4nagios – Graph Report Setup


It is an addon for the Nagios Network Monitoring System. PNP provides easy to use, easy to configure RRDTools based performance charts feeded by the performance data output of the Nagios Plugins.

Prerequsties:
rrdtool
php5
php-gd

Step 1: Installation of RRDTOOL

We can install RRDTool using two methods.

Method 1: Using Complie

[root@server.local ~]# cd /opt/
[root@server.local ~]# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.1.tar.gz
[root@server.local ~]# tar -zxvf rrdtool-1.3.1.tar.gz
[root@server.local ~]# export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
[root@server.local ~]# ./configure
Sample output:
config.status: executing default-1 commands
config.status: executing intltool commands
config.status: executing default commands
config.status: executing po/stamp-it commands
checking in... and out again
ordering CD from http://tobi.oetiker.ch/wish .... just kidding ;-)
----------------------------------------------------------------
Config is DONE!
With MMAP IO: yes
Static programs: no
Perl Modules: perl_piped perl_shared
Perl Binary: /usr/bin/perl
Perl Version: 5.8.8
Perl Options: PREFIX=/usr/local/rrdtool-1.3.1 LIB=/usr/local/rrdtool-1.3.1/lib/perl/5.8.8
Ruby Modules:
Ruby Binary: no
Ruby Options: sitedir=$(DESTDIR)NONE/lib/ruby
Build Tcl Bindings: no
Build Python Bindings: yes
Build rrdcgi: yes
Build librrd MT: yes
Link with libintl: yes
Libraries: -lxml2 -lcairo -lcairo -lcairo -lm -lcairo -lpng12 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0

-- Tobi Oetiker
----------------------------------------------------------------
Now compile and install RRDTool on RHEL:

[root@server.local ~]# make
[root@server.local ~]# make install
[root@server.local ~]# cd /usr/local/
[root@server.local ~]# ln -s rrdtool-1.3.1/ rrdtool/
[root@server.local ~]# cd rrdtool
[root@server.local ~]# ls -l

How do I verify my installation?

Now RRDtool is installed and ready to use. You can go to /usr/local/rrdtool/share/rrdtool/examples/ directory and run them to see if your installation has been successful or not:

[root@server.local ~]# cd /usr/local/rrdtool/share/rrdtool/examples/
[root@server.local ~]# ./stripes.pl
[root@server.local ~]# ls -l
[root@server.local ~]# cp stripes.png /var/www/html/

Fire a web browser and see a graph for yourself by typing the following url:

http://localhost/stripes.png

Method 2: Using Yum

[root@server.local ~]# vi /etc/yum.repos.d/dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1

[root@server.local ~]# yum install rrdtool

Step 2: Installation of pnp4nagios

Ref: http://docs.pnp4nagios.org/pnp-0.6/config & http://docs.pnp4nagios.org/pnp-0.6/install

[root@server.local ~]# cd /tmp/
[root@server.local ~]# wget http://sourceforge.net/projects/pnp4nagios/files/PNP-0.6/pnp4nagios-0.6.19.tar.gz/download
[root@server.local ~]# cd pnp4nagios-0.6.19
[root@server.local ~]# ./configure --with-rrdtool=/usr/local/rrdtool-1.2.xx/bin/rrdtool
[root@server.local ~]# make all
[root@server.local ~]# make install
[root@server.local ~]# make install-config
[root@server.local ~]# make install-webconf
[root@server.local ~]# make install-init
[root@server.local ~]# ldconfig

Step 3: Configuration of pnp4nagios with NPCD method

[root@server.local ~]# vi /usr/local/nagios/etc/nagios.cfg

Change process performance data

process_performance_data=1

Add the below lines after process data

# service performance data
#
service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$

service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file

#
# host performance data starting with Nagios 3.0
#
host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file

[root@server.local ~]# vi /usr/local/nagios/etc/objects/commands.cfg

Add the below lines in EOF

define command{
command_name process-service-perfdata-file
command_line bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
}
define command{
command_name process-host-perfdata-file
command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$
}

[root@server.local ~]# cd /usr/local/pnp4nagios/etc/
[root@server.local ~]# mv process_perdata.cfg-sample process_perdata.cfg
[root@server.local ~]# mv npcd.cfg-sample npcd.cfg

Restart the Apache/httpd server

[root@server.local ~]#/etc/init.d/httpd restart

Step 4: Check pnp4nagios

http://IP/pnp4nagios “use nagiosadmin account”

Note: At bottom of the page, if you get no error message and status in green then everything should be fine.

Step 5: Rename the Php installation file

[root@server.local ~]# cd /usr/local/pnp4nagios/share
[root@server.local ~]# mv install.php install.php_bak20121124

Step 6: Start the NPCD service

[root@server.local ~]# /usr/local/pnp4nagios/bin/npcd -d -f /usr/local/pnp4nagios/etc/npcd.cfg
[root@server.local ~]# /etc/init.d/npcd status

Add the script in /etc/rc.local

[root@server.local ~]# vi /etc/rc.local

Add the below line in EOF

/usr/local/pnp4nagios/bin/npcd -d -f /usr/local/pnp4nagios/etc/npcd.cfg

Step 7: Integrate Nagios with pnp4nagios

[root@server.local ~]# vi /usr/local/nagios/etc/objects/templates.cfg

Add the below lines in EOF

define host {
name host-pnp
register 0
action_url /nagios/pnp/index.php?host=$HOSTNAME$
}

define service {
name srv-pnp
register 0
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
}

[root@server.local ~]# vi /usr/local/nagios/etc/objects/localhost.cfg # Not needed

define host{
use linux-server,host-pnp
host_name localhost
alias localhost
address 127.0.0.1
}

define service{
use local-service,srv-pnp
host_name localhost
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}

Like that you can add other peripherals also. ie.,linux servers, windows servers, switches, printers

Creating Custom Template in pnp4nagios

Some time need to create custom template in pnp4nagios for some command which behave differently when execute on remote host as the appearance of graphs depends on the check command used. eg check_nrpe

Example:

define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

This would lead to a call of the check_nrpe.php template even when the monitored host would use a completely different plugin which is called via NRPE, eg

In service definition

define service{
use local-service,srv-pnp
host_name SomeHost
service_description Current Load
check_command check_nrpe!check_load
}

This will lead to call to check_nrpe command and it will use the default.php PNP template which may or may not give the graph as required.

Solution: Custom Template

1. Define new command in nagios/commands.cfg

define command{
command_name check_nrpe_load
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

2. Modify the service command for the host to use the new command

define service{
use local-service,srv-pnp
host_name SomeHost
service_description Current Load
check_command check_nrpe_load!check_load
}

Reload Nagios so that it start using the new check command.

At this point everything will be working just as before,

Pnp4nagios configuration

1. Define a check command /usr/local/pnp4nagios/etc/check_commands/check_nrpe_load.cfg (with the same name as the check command in above example)

Tip: Just copy the sample command definition /usr/local/pnp4nagios/etc/check_commands/check_nwstat.cfg-sample eg

[root@server.local ~]# cd /usr/local/pnp4nagios/etc/check_commands

[root@server.local ~]# cp check_nwstat.cfg-sample check_nrpe_load.cfg

For more detail on custom command refer to http://docs.pnp4nagios.org/pnp-0.6/tpl_custom

2. Define a customer template for check_nrpe_load

In the above example if check_nrpe_load.cfg have

CUSTOM_TEMPLATE = 0,1 the it will results in ? “check_nrpe_load_check_load.php”

Create a custom template in /usr/local/pnp4nagios/share/templates (pnp4nagios first look for template in this direcotry then fallback to other directories http://docs.pnp4nagios.org/pnp-0.6/tpl)

Note: Or you can just create a symbolic link to existing template that come with pnp4nagios installation eg …

[root@server.local ~]# ln -s ../templates.dist/check_load.php check_nrpe_load_check_load.php

Here is the sample template for check_load on remote hosts that will plot graph of 1M and 15 minute graph for a host,

[root@server.local ~]# cd /usr/local/pnp4nagios/share/templates

[root@server.local ~]# vi check_nrpe_load_check_load.php (template name should match with the custom command definition in our example check_nrpe_load_check_load.php)

Note: For more template use /usr/local/pnp4nagios/share/template.dist/

NRPE(Nagios Remote Plugin Executor) Installation and Setup


Nagios Server:

Hostname: server.local
IP Address: 192.168.1.5

Nagios Client:

Hostname: client.local
IP Address: 192.168.1.6

Step 1: Create Nagios user account on remote server to be monitored

[root@client.local ~]# useradd nagios
[root@client.local ~]# passwd nagios

Step 2: Download and Install Nagios Plugins

[root@client.local ~]# mkdir -p /opt/Nagios/Nagios_Plugins
[root@client.local ~]# cd /opt/Nagios/Nagios_Plugins
[root@client.local ~]# tar xzf nagios-plugins-1.4.13.tar.gz
[root@client.local ~]# cd nagios-plugins-1.4.13

Compile and Configure Nagios Plugins

** You need the openssl-devel package installed to compile plugins with ssl support. **

[root@client.local ~]# yum -y install openssl-devel

Step 3: Install Plugins

[root@client.local ~]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
[root@client.local ~]# make
[root@client.local ~]# make install

The permissions on the plugin directory and the plugins will need to be changed to nagios user

[root@client.local ~]# chown nagios.nagios /usr/local/nagios
[root@client.local ~]# chown -R nagios.nagios /usr/local/nagios/libexec
[root@client.local ~]# yum install xinetd

Step 4: Download and Install NRPE Daemon

[root@client.local ~]# mkdir -p /opt/Nagios/Nagios_NRPE
[root@client.local ~]# cd /opt/Nagios/Nagios_NRPE
[root@client.local ~]# tar -xzf nrpe-2.12.tar.gz
[root@client.local ~]# cd nrpe-2.12
[root@client.local ~]# ./configure --enable-ssl --enable-command-args

[enable ssl is to ensure data can be send on ssl port and command args enables nrpe daemon to receive arguments from Nagios server]

[root@client.local ~]# ./configure --enable-command-args

[disable ssl and command args enables nrpe daemon to receive arguments from Nagios server]

General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios

[root@client.local ~]# make all
[root@client.local ~]# make install-plugin
[root@client.local ~]# make install-daemon
[root@client.local ~]# make install-daemon-config
[root@client.local ~]# make install-xinetd

Step 5: Post NRPE Configuration

Edit Xinetd NRPE entry

[root@client.local ~]# vi /etc/xinetd.d/nrpe

only_from = 127.0.0.1

Edit services file entry

Add entry for nrpe daemon

[root@client.local ~]# vi /usr/local/nagios/etc/nrpe.cfg

allowed_host = 127.0.0.1

dont_blame_nrpe = 1 [this is to enable args passing to nrpe from nagios server]

Add the below lines in EOF

command[check_ping]=/usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $ARG3$
command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
command[check_cpu]=/usr/local/nagios/libexec/check_linux_stats.pl -C -w $ARG1$ -c $ARG2$ -s $ARG3$
command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
command[check_mem]=/usr/local/nagios/libexec/check_linux_stats.pl -M -w $ARG1$ -c $ARG2$
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
command[check_diskio]=/usr/local/nagios/libexec/check_linux_stats.pl -I -w $ARG1$ -c $ARG2$ -p $ARG3$
command[check_network]=/usr/local/nagios/libexec/check_linux_stats.pl -N -w $ARG1$ -c $ARG2$ -p $ARG3$

[root@client.local ~]# vi /etc/services

Add this line in EOF

nrpe 5666/tcp # NRPE

[root@client.local ~]# chkconfig xinetd on
[root@client.local ~]# /etc/init.d/xinetd restart

Step 6: Test NRPE Daemon running and listening on port 5666

[root@client.local ~]# netstat -at |grep nrpe

Output should be:

tcp 0 0 *:nrpe *.* LISTEN

[root@client.local ~]# /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12

Open Port 5666 on Firewall

Make sure to open port 5666 on the firewall of the remote server so that the Nagios monitoring server can access the NRPE daemon.

[root@client.local ~]# iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 5666 -j ACCEPT

Save the new iptables rule so it will survive machine reboots.

[root@client.local ~]# /etc/init.d/iptables save

Step 7: Nagios Monitoring Host Server Setup

From here onwards, we need to work on Nagios server (server.local/192.168.1.5)

[root@server.local ~]# tar -xzf nrpe-2.12.tar.gz
[root@server.local ~]# cd nrpe-2.12
[root@server.local ~]# ./configure
[root@server.local ~]# make all
[root@server.local ~]# make install-plugin

Step 8: Test Connection to NRPE daemon on Remote Server

[root@server.local ~]# /usr/local/nagios/libexec/check_nrpe -H
NRPE v2.12

Step 9: Create NRPE Command Definition

[root@server.local ~]# vi /usr/local/nagios/etc/objects/commands.cfg

Add the following:

###############################################################################
# NRPE CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$
}

###############################################################################
# Service CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################

define command{
command_name check_ping
command_line /usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p $ARG3$
}

define command{
command_name check_users
command_line /usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
}

define command{
command_name check_cpu
command_line /usr/local/nagios/libexec/check_linux_stats.pl -C -w $ARG1$ -c $ARG2$ -s $ARG3$
}

define command{
command_name check_load
command_line /usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
}

define command{
command_name check_mem
command_line /usr/local/nagios/libexec/check_linux_stats.pl -M -w $ARG1$ -c $ARG2$
}

define command{
command_name check_disk
command_line /usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}

define command{
command_name check_diskio
command_line /usr/local/nagios/libexec/check_linux_stats.pl -I -w $ARG1$ -c $ARG2$ -p $ARG3$
}

define command{
command_name check_network
command_line /usr/local/nagios/libexec/check_linux_stats.pl -N -w $ARG1$ -c $ARG2$ -p $ARG3$
}

Step 10: Create Linux Object template

In order to be able to add the remote linux machine to Nagios we need to create an object template file adn add some object definitions.

Create new linux-server object template file:

[root@server.local ~]# vi /usr/local/nagios/etc/objects/linux-server.cfg

Add the following and replace the values “host_name” “alias” “address” with the values that match your setup:

** The “host_name” you set for the “define_host” section must match the “host_name” in the “define_service” section **

define host{
name linux-server ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0 ; DONT REGISTER THIS - ITS A TEMPLATE
}

define host{
use linux-server ; Inherit default values from a template
host_name client.local ; The name we're giving to this server
alias Test Server ; A longer name for the server
address 192.168.1.6 ; IP address of the server
}
define service{
use generic-service
host_name client.local
service_description Current Users
check_command check_nrpe!check_users!10!15
}
define service{
use generic-service
host_name client.local
service_description CPU Average
check_command check_nrpe!check_cpu!90!100!5
}
define service{
use generic-service
host_name client.local
service_description Load Average
check_command check_nrpe!check_load!4.0,3.0,2.0!7.0,6.0,5.0
}
define service{
use generic-service
host_name client.local
service_description Memory Average
check_command check_nrpe!check_mem!99,50!100,50
}
define service{
use generic-service
host_name client.local
service_description Disk Usage
check_command check_nrpe!check_disk!80%!90%!/
}
define service{
use generic-service
host_name client.local
service_description Disk IO Stats
check_command check_nrpe!check_diskio!100,70!150,100!sda3
}
define service{
use generic-service
host_name client.local
service_description N/w Bandwidth
check_command check_nrpe!check_network!30000!45000!eth1
}

Step 11: Activate the linux-box-remote.cfg template

[root@server.local ~]# vi /usr/local/nagios/etc/nagios.cfg

And add:

cfg_file=/usr/local/nagios/etc/objects/linux-server.cfg

Change the ownership for the new cfg file

[root@server.local ~]#chown nagios:nagios linux-server.cfg

Verify Nagios Configuration Files:

[root@server.local ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Total Warnings: 0
Total Errors: 0
Restart Nagios:

[root@server.local ~]# /etc/init.d/nagios reload

Check Nagios Monitoring server that the remote linux box was added and is being monitored.