NAGIOS INSTALLATION GUIDE FOR OPENSOLARIS

Downloading OpenSolaris Nagios Packages


The Nagios packages are in the OpenSolaris contrib repository.


You can install these packages either using the pkg command or via
the package manager, you can go to the /contrib
repository's catalog
page
and click on the 'install' link for the package(s) that you
want to install.


To set up /contrib as a valid publisher for use with the package
manager or the pkg command, do the following as a user with the root
role (or Software Installation profile):


pfexec pkg set-publisher -O http://pkg.opensolaris.org/contrib
contrib


Or you can add /contrib via the package manager through the File
-> Manage Repositories pull down. If installing from the "install"
link at http://pkg.opensolaris.org/contrib/en/catalog.shtml 
the package manager will automatically add /contrib to the list of
publishers.


To install packages using pkg, do the following:


pfexec pkg refresh
pfexec pkg install <package name
>


Each monitored OpenSolaris system must have the nrpe and
nagios-plugins packages installed.


The monitoring host must have the nagios package installed.



Other Nagios Installation Details


Make sure that each monitored host has the SUNWcryr and SUNWcryx
packages installed to allow for full encryption. Without those packages nrpe cannot negotiate a working key length properly (it defaults to 256 bit keys which it cannot generate without the extra packages). http://www.sun.com/download/index.jsp?cat=Security&tab=3&subcat=Cryptography%20%26%20Encryption




Editing the nrpe Configuration File


Each monitored host must have the /usr/nagios/etc/nrpe.cfg
file customized based on the local configuration.


There are 3 sets of parameters to be considered:


1. # ALLOWED HOST ADDRESSES


# allowed_hosts is an optional comma-delimited list of IP
address or hostnames that are allowed to communicate with the nrpe
daemon. The default value for this parameter is:


allowed_hosts=127.0.0.1


This default value allows the nrpe daemon to respond only to the
local host. Other systems attempting to communicate with nrpe will be
ignored.


2. Two other variables identify the effective user and
effective group that nrpe will run as.


nrpe_user=nagios


nrpe_group=nagios


These values must correspond to a user and group defined on the
local machine. The nrpe package install does NOT automatically create
user and group nagios, so the system administrator must either create
them or must set these parameters to a user and a group which do
exist. Use these commands to create group and user nagios:


groupadd nagios


useradd -d /export/home/nagios -g nagios -m nagios


3. COMMAND DEFINITIONS


Command definitions define the commands that the nrpe daemon will
run on this host. Definitions are in the following format:


command[<command_name>]=<command_line>


When the daemon receives a request to return the results of
<command_name> it will execute the command specified by the
<command_line> argument.


The command line cannot contain macros - it must be typed exactly
as it should be executed.


Note: Any plugins used in the command lines must reside on the
machine that this daemon is running on. The examples below assume
that you have plugins installed in the /usr/nagios/libexec directory.



command[check_users]=/usr/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/nagios/libexec/check_load -w 15,10,5 -c
30,25,20
command[check_hda1]=/usr/nagios/libexec/check_disk -w 20% -c 10%
-p /dev/hda1
command[check_zombie_procs]=/usr/nagios/libexec/check_procs -w 5
-c 10 -s Z
command[check_total_procs]=/usr/nagios/libexec/check_procs -w 150
-c 200
command[check_total_procs]=/usr/nagios/libexec/check_solaris_procs
150 200
command[check_swap]=/usr/nagios/libexec/check_solaris_swap 100000
50000

Issue the following command on each monitored host to start nrpe
running as a daemon:

/usr/nagios/bin/nrpe -c /usr/nagios/etc/nrpe.cfg -d


To start up nrpe in a non-global Solaris 10 zone, either
configure and build
with


LDFLAGS="-R/usr/sfw/lib",
or add /usr/sfw/lib to the runtime linker search path. See crle(1).


Editing the Nagios Configuration Files


The host on which Nagios (the monitor) is installed must have the
following files customized based on the local configuration:


/usr/nagios/etc/objects/commands.cfg


/usr/nagios/etc/objects/localhost.cfg


Two Solaris specific scripts have been written and are distributed
as part of the OpenSolaris nagios plugins package. These scripts
enable monitoring of the number of processes and amount of swap space
on the (Open)Solaris system. The scripts are named
check_solaris_procs and check_solaris_swap. Due to differences in
command implementation, the Linux scripts to check processes and swap
space do not run on Solaris.


To monitor the number of processes on a Solaris system, replace
these lines in the commands.cfg file:


command_name check_local_procs
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s
$ARG3$


with:


command_name check_local_procs
command_line $USER1$/check_solaris_procs 250 400





Similarly, the lines to define the command to check swap space are
changed to:


command_name check_local_swap
command_line $USER1$/check_solaris_swap


Verify that your changes to these files are syntactically correct
by running this command:


/usr/nagios/bin/nagios -v /usr/nagios/etc/nagios.cfg


( Output should end with " Things look okay ..." )



Starting the Nagios Monitor


Once the commands.cfg and localhost.cfg file are modified to
specify the hosts and commands to be monitored, you start the Nagios
monitor with:


/usr/nagios/bin/nagios /usr/nagios/etc/nagios.cfg -d &


For more information, check:


http://nagios.sourceforge.net/docs/3_0/quickstart.html


Observing the Results


Open source Nagios addons have been written to graphically display
the results of the monitoring and to store the information in
various databases, including MySQL and RRD.


The basic output of the Nagios monitor can be viewed by regularly
checking the output of the status.dat file using this command:


grep plugin_output /usr/nagios/var/status.dat | grep -v long


All lines should contain "OK". The lines you see may
look like this:


plugin_output=PING OK - Packet loss = 0%, RTA = 0.09 ms
plugin_output=OK - load average: 0.00, 0.00, 0.00
plugin_output=USERS OK - 4 users currently logged in
plugin_output=PING OK - Packet loss = 0%, RTA = 0.09 ms
plugin_output=DISK OK - free space: / 47829 MB (91%
inode=99%):
plugin_output=OK - 134 processes


These output lines correspond to status checks on ping, load,
number of users, ping (remote monitored host), free disk space, and
number of processes.


A CGI based web interface may also be installed to provide a
graphic display of the parameter statuses for each monitored host.


This provides you with a basic view of Nagios capabilities. A
number of books have been written on the subject of configuring and
expanding Nagios, and a large and vibrant Nagios user community
exists.


Consult nagios.org as a starting point for expanding your
understanding of this popular network monitoring tool.







Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

wjaiken

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today