Monitoring AIX With Nagios
Monitoring AIX With Nagios
Monitoring AIX With Nagios
Purpose
This document describes how to monitor AIX servers using Nagios. The instructions were contributed by Joshua Whitaker, who
successfully configured Nagios to monitor AIX .! servers. Thanks Joshua"
Overview
These instructions cover how to install and use #re$com#iled binaries to monitor AIX .! using N%&'.
Download Pre-Compiled Binaries
(ou will need to download two #ackages of #re$com#iled binaries to your AIX server.
)irst download the #re$com#iled Nagios #lugin binaries for AIX .! from the following *%+,
htt#,--e.change.nagios.org-hostedfiles-AIX-ai.!/nr#e$nsca$#lugins.tg0
Ne.t download the #re$com#iled N%&' binaries from the following *%+,
htt#,--assets.nagios.com-downloads-nagios.i-agents-AIX$.!$nr#e$1.21$binaries.tar.g0
Create Directories
+ogin to your AIX server as the root user and run the following commands,
cd /usr/local
mkdir nagios
npac! Binaries
Ne.t un#ack the #re$com#iled #lugins and #lace the e.tracted files into the -usr-local-nagios directory using commands similar to the
following,
cd /tmp
tar xzf /path/to/aix53_nrpe-nsca-plugins.tgz
cd /tmp/nagios
cp -R * /usr/local/nagios
Ne.t, un#ack the #rec$om#iled N%&' binaries using commands similar to the following,
cd /tmp
tar xzf /path/to/AI-5.3-nrpe-!."!-#inaries.tar.gz
cp usr/local/nagios/#in/nrpe /usr/local/nagios/#in
cp usr/local/nagios/etc/nrpe.cfg /usr/local/nagios/etc
Page "
3o#yright 4 1522 Nagios 'nter#rises, ++3
%evision 2.5 6 January, 1527
Monitoring #I$ %ith &agios
&agios 'nterprises( ))C S* "-+++-&#,IOS-" %e-* www.nagios.com
P.O. Bo/ +"01
Saint Paul( M& 00"2+
S#
Int3l* 4" 50"-621-7"26 'mail* sales8nagios.com
9a/* 4" 50"-621-7"2:
Create &agios ser #nd ,roup
Ne.t, create a Nagios user and grou# on the AIX server.
*se the following command to create a new grou#,
mkgroup nagios
8ake a home directory for a Nagios user using the following command,
cd /users/
mkdir nagios
Ne.t, o#en u# smitty and add a new user with the name
nagios. +aunch smitty with the following command,
smitty user
9nce smitty o#enes, select #dd a user, and use the
following settings,
*ser NA8' : nagios
&rimary ;rou# : users
;rou# <'T : users(nagios
=98' directory : ;users;nagios
Set Permissions
3hange folder #ermissions so N%&' will o#erate #ro#erly, with the following command,
cho$n -R nagios.nagios /usr/local/nagios
>erify the #ermissions on the directory using the following commands,
cho$n /usr/local/nagios
ls -l
Page 6
3o#yright 4 1522 Nagios 'nter#rises, ++3
%evision 2.5 6 January, 1527
Monitoring #I$ %ith &agios
&agios 'nterprises( ))C S* "-+++-&#,IOS-" %e-* www.nagios.com
P.O. Bo/ +"01
Saint Paul( M& 00"2+
S#
Int3l* 4" 50"-621-7"26 'mail* sales8nagios.com
9a/* 4" 50"-621-7"2:
Specify &<P' Port &um-er
Ne.t, edit the -etc-services file to add a #ort number for N%&'.
To edit the file, use the following command,
%i /etc/ser%ices
Add a line to the file that looks e.actly like this,
nrpe 5&&&/tcp 'nrpe
<ave the file.
Configure &<P'
Ne.t, you?ll need to modify the N%&' configuration file to include any command definitions that should be used for monitoring. The
following command definitions #rovide an e.am#le of what can be added to the N%&' configuration.
command(check_users)*/usr/local/nagios/li#exec/check_users -$ 5 -c "+
command(check_load)*/usr/local/nagios/li#exec/check_load -$ "5,"+,5 -c 3+,!5,!+
command(check_zom#ie_procs)*/usr/local/nagios/li#exec/check_procs -$ 5 -c "+ -s -
command(check_total_procs)*/usr/local/nagios/li#exec/check_procs -$ "5+ -c !++
command(check_aix_ram)*/usr/local/nagios/li#exec/check_aix_ram .+ "++
command(check_aix_home)*/usr/local/nagios/li#exec/check_disk -$ /+ -c /5 -p /home
command(check_aix_root)*/usr/local/nagios/li#exec/check_disk -$ /+ -c /5 -p /
command(check_aix_%ar)*/usr/local/nagios/li#exec/check_disk -$ /+ -c /5 -p /%ar
command(check_aix_usr)*/usr/local/nagios/li#exec/check_disk -$ /+ -c /5 -p /usr
Important* The names of commands that you define in your N%&' config file are used later when you configure Nagios to monitor the
AIX server. If you change command names or add additional commands to the configuration file, you?ll need to modify the Nagios
configuration covered later in this document.
Configure &<P' 9or #utomatic Startup
Ne.t, configure N%&' to automatically start when the AIX server reboots. To do this, use the following command,
nohup /usr/local/nagios/#in/nrpe -c /usr/local/nagios/etc -n -d
(ou should get this re#onse,
Sending nohup output to nohup.out.
&ote* The -n flag s#ecifies that the N%&' server should run without <<+ su##ort. This reduces security of the N%&' daemon, but
dramatically increases #erformance under heavy server load and may be okay if your server is on an internal network #rotected by a
firewall.
Start &<P'
<tart N%&' using the following command,
/usr/local/nagios/#in/nrpe 0c /usr/local/nagion/etc/nrpe.cfg -n 0d
Page :
3o#yright 4 1522 Nagios 'nter#rises, ++3
%evision 2.5 6 January, 1527
Monitoring #I$ %ith &agios
&agios 'nterprises( ))C S* "-+++-&#,IOS-" %e-* www.nagios.com
P.O. Bo/ +"01
Saint Paul( M& 00"2+
S#
Int3l* 4" 50"-621-7"26 'mail* sales8nagios.com
9a/* 4" 50"-621-7"2:
Test =our &<P' Configuration
Test your AIX server to see if N%&' is running #ro#erly. To do this, use the following command,
ps -ef 1 grep nrpe
(ou should see something that looks like this,
nagios 111345 43675 /usr/local/nagios/bin/nrpe c /usr/local/nagios/etc/nrpe.cfg -n d
&ote* The out#ut you see may differ slightly, as the &I@ number will be different on your system.
Important* If you don?t see any out#ut when running the above command, it means something is wrong with your setu#" This may be
related to #roblems in your N%&' configuration file A-usr-local-nagios-etc-nr#e.cfgB.
&agios Configuration
9nce you are finished installing and configuring N%&' on the AIX server, you?ll need to modify the monitoring configuration on your
Nagios server.
The #rocess for configuring your monitoring setu# is determined by whether you are using Nagios XI or Nagios 3ore.
&agios $I Setup
If you are using Nagios XI, you can use the N%&' monitoring wi0ard
to configure monitoring of your server.
When you run the N%&' configuration wi0ard, sim#ly enter the I&
address of your server and select AIX as your o#erating system.
The N%&' wi0ard allows you to s#ecify which N%&' commands
should be e.ecuted and monitored and what dis#lay name Aservice
descri#tionB should be associated with each command.
The commands you enter in the wi0ard must corres#ond to the
command names that you defined in the N%&' configuration file on
your AIX server.
Page 1
3o#yright 4 1522 Nagios 'nter#rises, ++3
%evision 2.5 6 January, 1527
Monitoring #I$ %ith &agios
&agios 'nterprises( ))C S* "-+++-&#,IOS-" %e-* www.nagios.com
P.O. Bo/ +"01
Saint Paul( M& 00"2+
S#
Int3l* 4" 50"-621-7"26 'mail* sales8nagios.com
9a/* 4" 50"-621-7"2:
9nce you com#lete the wi0ard, Nagios XI will start
monitoring the AIX server. The screenshot to the right
shows an e.am#le of what the status screen looks like once
monitoring is u# and running.
&agios Core Setup
If you?re using Nagios 3ore, you?ll need to manually edit one or more configuration files to configure monitoring.
A command definition like the following needs to be setu# in one of your obCect configuration files,
define command2
command_name check_nrpe
command_line 3456R"3/check_nrpe -7 37859A::R6553 -c 3AR;"3
<
Ne.t, you?ll need to configure host and service definitions for monitoring the AIX server. The following definitions #rovide e.am#les of
how to configure monitoring of an AIX server with multi#le monitored services. These definitions should be modified to fit your setu#
and #laced in an obCect configuration file that Nagios 3ore #rocesses.
define host2
use linux-ser%er
host_name aixbox
address 192.168.5.24
<
define ser%ice2
use generic-ser%ice
host_name aix#ox
ser%ice_description =>4 ?8A:
check_command check_nrpe@check_load
<
define ser%ice2
use generic-ser%ice
host_name aix#ox
ser%ice_description RAA 45A;6
check_command check_nrpe@check_aix_ram
<
define ser%ice2
use generic-ser%ice
host_name aix#ox
ser%ice_description 7ome :irectorB Cree 5pace
check_command check_nrpe@check_aix_home
<
define ser%ice2
use generic-ser%ice
host_name aix#ox
ser%ice_description Root :irectorB Cree 5pace
check_command check_nrpe@check_aix_root
<
define ser%ice2
use generic-ser%ice
host_name aix#ox
ser%ice_description Dar :irectorB Cree 5pace
check_command check_nrpe@check_aix_var
<
Page 0
3o#yright 4 1522 Nagios 'nter#rises, ++3
%evision 2.5 6 January, 1527
Monitoring #I$ %ith &agios
&agios 'nterprises( ))C S* "-+++-&#,IOS-" %e-* www.nagios.com
P.O. Bo/ +"01
Saint Paul( M& 00"2+
S#
Int3l* 4" 50"-621-7"26 'mail* sales8nagios.com
9a/* 4" 50"-621-7"2:
define ser%ice2
use generic-ser%ice
host_name aix#ox
ser%ice_description 4sr :irectorB Cree 5pace
check_command check_nrpe@check_aix_usr
<
9nce you?re done editing the Nagios 3ore configuration files, don?t forget to restart Nagios 3ore using the following command,
ser%ice nagios restart
9inishing p
That?s it" If you followed all the ste#s in these instructions, you should have basic monitoring of AIX working.
Page 5
3o#yright 4 1522 Nagios 'nter#rises, ++3
%evision 2.5 6 January, 1527
Monitoring #I$ %ith &agios
&agios 'nterprises( ))C S* "-+++-&#,IOS-" %e-* www.nagios.com
P.O. Bo/ +"01
Saint Paul( M& 00"2+
S#
Int3l* 4" 50"-621-7"26 'mail* sales8nagios.com
9a/* 4" 50"-621-7"2: