Regional Nagios Server

by mike on March 11, 2010

Regional Nagios Server  Set Up
The major goal of the  regional server is to distribute the results of all service checks to the central server.  The regional Nagios machines must use OCSP and OCHP in order to send the proper updates to the central server.

Part One: Passive Checks Course
Part Two: Central Server
Part Three: Regional Server

Nagios Training Course
Nagios Manual

The blue represents the regional server so that it is transferring the information that it collects from the servers, routers and switches it is monitoring to the central Nagios server.  The same settings for NSCA that you did for passive checks will have to be set up for this server and you will need to use the same password and encryption scheme as on the central server.  See that link as it has not been repeated here.

The default nagios.cfg  has these settings.
obsess_over_services=0
#ocsp_command=somecommand
obsess_over_hosts=0
#ochp_command=somecommand

Change the nagios.cfg settings to those below.  The timeout prevents your Nagios server from spending too much time on one command.
obsess_over_services=1
ocsp_command=service_check
ocsp_timeout=5

obsess_over_hosts=1
ochp_command=host_check
ohcp_timeout=5

You will need to create two scripts in the /usr/lib/nagios/plugins/eventhandlers/distributed-monitoring directory.  This script is key to transferring the  proper information to your central server.

#!/bin/bash
# Service Check

CMD=”/usr/sbin/send_nsca”
CFG=”/etc/nagios/send_nsca.cfg”
HOST=$1
SRV=$2
RESULT=$3
OUTPUT=$4

/bin/echo -e  “$HOST\t$SRV\t$RESULT\t$OUTPUT\n” | $CMD -H nagios -c $CFG

nagios is = to your central Nagios server

#!/bin/bash
# Host Check

CMD=”/usr/sbin/send_nsca”
CFG=”/etc/nagios/send_nsca.cfg”
HOST=$1
RESULT=$2
OUTPUT=$3

/bin/echo -e  “$HOST\t$RESULT\t$OUTPUT\n” | $CMD -H nagios -c $CFG

chmod 755 service_check
chmod 755 host_check

Create a file called misccommands.cfg in the /etc/nagios/objects directory so you can add the new commands.

define command{
command_name   service_check
command_line   $USER1$/eventhandlers/distributed-monitoring/service_check $HOSTNAME$ ‘$SERVICEDEC$’ $SERVICESTATEID$ ‘$SERVICEOUTPUT$’

define command{
command_name   host_check
command_line   $USER1$/eventhandlers/distributed-monitoring/host_check $HOSTNAME$ $SERVICESTATEID$ ‘$SERVICEOUTPUT$’

Be sure to add this line to your nagios.cfg file.

cfg_file=/etc/nagios/objects/misccommands.cfg

  • Share/Bookmark

{ 0 comments }

Nagios: Central Monitoring

March 3, 2010

Distributed Monitoring
This is part two of a three part series on distributed monitoring. You can use passive service and host checks to allow non-central Nagios servers to collect data from a network of machines and then transfer that information to a central Nagios server.  The transfer of information is done using NSCA so that the [...]

Read the full article →

Backup MX with Postfix

March 1, 2010

Build a Backup MX
The primary goal of a backup machine for Postfix is that if the first one fails, mail will be collected by the secondary mail server until the primary mail server is back online.  When you build the Backup MX  be sure  to install all of the necessary applications to scan for [...]

Read the full article →

Kerberos Server Set Up

February 22, 2010

Kerberos provides a secure network authentication model using secret-key cryptography.  Kerberos can be used with multiple services to offer superior authentication security.
On a Centos system you can review a list of possible programs that are listed for kerberos with yum.
yum list | grep krb5
You will see by default the workstation is installed so it can [...]

Read the full article →

NIS Clients

February 19, 2010

Set Up NIS Clients
The NIS Server-Client relationship requires that you set up a client in order to work with the NIS server.  This will enable you to login on the client from a user and password located on the database of the NIS server.  The client machine will first look in the /etc/passwd file and [...]

Read the full article →

NIS Server Config

February 17, 2010

The Network Information Service distributes information on the network that must be shared between the Linux machines.  Sun Microsystems developed a system known as Yellow Pages (YP) that eventually became known as NIS.  The original YP is added to most commands for NIS ypserver, ypbind, and yppasswd.  Typically NIS is used to distribute information about [...]

Read the full article →