nagios

3rd-party Plugins

There are a variety of useful check plugins available asides from the stand Nagios plugin package. Most plug-ins can be found at NagiosExchange, a repository of plugins and addons.

Some of the specific plugins that are useful:

Technology:

NDOutils

The NDOUTILS addon is designed to store all configuration and event data from Nagios in a database. Storing information from Nagios in a database will allow for quicker retrieval and processing of that data and will help serve as a foundation for the development of a new PHP-based web interface in Nagios 3.0.

Prerequisites
MySQL must be installed. Having had nothing but grief getting DB::mysql to install with a source installation of MySQL 5.0x, the easiest thing to do was just install MySQL server via yum:

yum install mysql-server mysql-devel

That also took care of installing DB::mysql for Perl.

ndoutils Installation
Download the latest version of the NDOUTILS:

cd /extra/src
wget http://umn.dl.sourceforge.net/sourceforge/nagios/ndoutils-1.4b7.tar.gz
tar zxvf ndoutils-1.4b7.tar.gz
cd ndoutils-1.4b7

Technology:

NRPE

The NRPE addon is designed to allow you to execute Nagios plugins on remote Linux/Unix machines. The main
reason for doing this is to allow Nagios to monitor "local" resources (like CPU load, memory usage, etc.) on
remote machines. Since these public resources are not usually exposed to external machines, an agent like
NRPE must be installed on the remote Linux/Unix machines.

NRPE Installation
On the remote server, download the latest source tarball of the NRPE add-on (2.12 at time of writing):

Technology:

Automatic Startup

Control the running of your Nagios server using init scripts or daemontools.

Init Script
If you installed the included startup scripts, add them to the system services and have it automatically start at system boot:

chkconfig --add nagios
chkconfig nagios on

Verify your initial Nagios configuration:

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

And if there are no errors, you can control Nagios with:

/etc/rc.d/init.d/nagios {start|stop|restart|reload|force-reload|status}

or

service nagios {start|stop|restart|reload|force-reload|status}

Technology:

Web Interface

Apache VirtualHost Configuration

mkdir -p /var/websites/nagios/htdocs
mkdir -p /var/websites/nagios/logs

Add the following to /usr/local/apache2/conf/extra/http-vhost.conf:

# nagios Virtual Host Webinterface

ServerAdmin admin@yourdomain.com
DocumentRoot /var/websites/nagios/htdocs

ServerName nagios.yourdomain.com

ErrorLog /var/websites/nagios/logs/nagios-error.log
CustomLog /var/websites/nagios/logs/nagios-access.log combined

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

Technology:

Service and Servicegroups

Service definitions will be saved in /usr/local/nagios/etc/services.cfg.

By using templates, you can simplify the entries for individual services by not having repeated entries for common settings.

# Generic service definition template - This is NOT a real service, just a template!
define service{
name generic-service
check_period 24x7
max_check_attempts 4

Technology:

Timeperiods

Time Period definitions will be saved in /usr/local/nagios/etc/timeperiods.cfg.


define timeperiod{
timeperiod_name 24x7
alias 24 Hours A Day, 7 Days A Week
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}

define timeperiod{

Technology:

Hosts and Hostgroups

Host definitions will be saved in /usr/local/nagios/etc/hosts.cfg.


define host{
host_name Bogus-server
alias Bogus Server #1
address 192.168.1.12
check_command check-host-alive
max_check_attempts 5
check_period 24x7
process_perf_data 0
contact_groups admins
notification_interval 30
notification_period 24x7

Technology:

Contacts and Contactgroups

Contact definitions will be saved in /usr/local/nagios/etc/contacts.cfg. If you have a lot of contacts and groups, you might want to split the contact group definitions into a separate file: /usr/local/nagios/etc/contactgroups.cfg.


define contactgroup{
contactgroup_name admins
alias Administrators

Technology:

Advanced Configuration

Nagios configuration and Subversion
Using a version control system such as Subversion can make editing your configuration files more manageable. You'll be able to keep track of what revisions, roll back to old versions, edit the files using your favourite text editor, etc.
To start, your Nagios server will need to have the SVN client installed on it.

Technology:

Pages

Subscribe to RSS - nagios

Recent Updates

  • 2 years 2 weeks ago
  • 2 years 2 weeks ago
  • 2 years 2 weeks ago
    php 8.x
  • 2 years 2 weeks ago
    10.6.7
  • 2 years 2 weeks ago
    Drop Centos 5/6 stuff