• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

Nagios config export and install

Hi I have built a new RHEL 5.4VM and need to install Nagios 3.2.x core.  How can I export the configuration settings from the old Nagios VM?  What are the important files for Nagios and Apache?
0
lhrslsshahi
Asked:
lhrslsshahi
  • 10
  • 9
  • 3
2 Solutions
 
Seth SimmonsSr. Systems AdministratorCommented:
the configuration files would be under /usr/local/nagios/etc and etc/objects

for apache, copy your httpd.conf file and nagios.conf in the conf.d folder

might be slightly different depending on how you installed the components
you want to install everything first then copy your configuration files over
0
 
lhrslsshahiAuthor Commented:
Is there a lot of work involved with installing nagios and getting it up and running?  Do you have any good links you can share?

Thanks
0
 
Seth SimmonsSr. Systems AdministratorCommented:
nagios documentation is a good start

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

http://nagios.sourceforge.net/docs/nagioscore/3/en/toc.html

it's not too difficult though if you never used it before there is a bit of a learning curve
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
lhrslsshahiAuthor Commented:
I will give it a go and come back to you.
0
 
Sanga CollinsSystems AdminCommented:
When building a replacement server I literally just copied /usr/local/nagios/etc to the new server. 90% of my settings came up fine and I then tuned the remaining anomalies.
0
 
lhrslsshahiAuthor Commented:
Nagios is now online thanks for all your help, have taken a while back to you guys as I had surgery done!

Only problem I have is I get the following for error (Return code of 127 is out of bounds - plugin may be missing)

The Linux VM that has this problem is also the Nagios monitoring host and remote host not entirely sure what I need to do in regards get the NRPE Addon configuration.

I have no problems monitoring other remote hosts it just can't monitor itself!
0
 
Seth SimmonsSr. Systems AdministratorCommented:
that error means a command is defined for an executable that is missing

are the nagios plugins installed?
if not, run this:

cd /tmp
wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Open in new window


or, for nrpe:

cd /tmp
wget http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar zxf nrpe-2.15.tar.gz
cd nrpe-2.15
./configure
make all

Open in new window

0
 
lhrslsshahiAuthor Commented:
@Seth

This has already been done and I had no problems with this, is there special configuration required if the nagios monitoring host and remote host are the same VM?
0
 
Seth SimmonsSr. Systems AdministratorCommented:
it's essentially monitoring itself?
0
 
lhrslsshahiAuthor Commented:
That's correct
0
 
Seth SimmonsSr. Systems AdministratorCommented:
ok...is this plugin in question going through nrpe?  how is it configured?
0
 
lhrslsshahiAuthor Commented:
Its configured through NRPE addon and it was configured with similar code snippets as above.  NRPE add on monitoring host functionality works as it's successfully monitoring other hosts which are configured with NRPE addon remote host.
0
 
Sanga CollinsSystems AdminCommented:
Instead of using NRPE to monitor the nagios host. You can use the example config files for monitoring local host. Usually those are installed with a fresh nagios instance and have all the monitoring parameters already setup. Here are the examples that came with my nagios install. Just call them from a service defenition.

################################################################################
#
# SAMPLE SERVICE CHECK COMMANDS
#
# These are some example service check commands.  They may or may not work on
# your system, as they must be modified for your plugins.  See the HTML 
# documentation on the plugins for examples of how to configure command definitions.
#
# NOTE:  The following 'check_local_...' functions are designed to monitor
#        various metrics on the host that Nagios is running on (i.e. this one).
################################################################################

# 'check_local_disk' command definition
define command{
        command_name    check_local_disk
        command_line    $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
        }


# 'check_local_load' command definition
define command{
        command_name    check_local_load
        command_line    $USER1$/check_load -w $ARG1$ -c $ARG2$
        }


# 'check_local_procs' command definition
define command{
        command_name    check_local_procs
        command_line    $USER1$/check_procs -C $ARG1$ -w $ARG2$ -c $ARG3$ -s $ARG4$
        }
		

# 'check_local_users' command definition
define command{
        command_name    check_local_users
        command_line    $USER1$/check_users -w $ARG1$ -c $ARG2$
        }


# 'check_local_swap' command definition
define command{
	command_name	check_local_swap
	command_line	$USER1$/check_swap -w $ARG1$ -c $ARG2$
	}


# 'check_local_mrtgtraf' command definition
define command{
	command_name	check_local_mrtgtraf
	command_line	$USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
	}

Open in new window

0
 
Seth SimmonsSr. Systems AdministratorCommented:
since it's local, you don't need to use nrpe locally; it's fine for the remote hosts
you can define the commands for the local host using the direct commands - in other words, instead of having check_nrpe!command -arg1 ,etc. just use check_disk or whatever one it is with it's respective parameters
0
 
lhrslsshahiAuthor Commented:
Thanks guys however it was working before, is there any logs I can check to see whats causing the problem?
0
 
Seth SimmonsSr. Systems AdministratorCommented:
there won't be anything in the nagios log except for that out of bounds error
which service check is failing?
0
 
lhrslsshahiAuthor Commented:
How do I check which service check is failing?
0
 
Seth SimmonsSr. Systems AdministratorCommented:
look at the nagios interface
it will have the service description on the same line as the status where it says it's out of bounds
0
 
lhrslsshahiAuthor Commented:
Service - Uptime
Status   - Critical

Thanks
0
 
Seth SimmonsSr. Systems AdministratorCommented:
what is the command defined in the config for that item?
check the command and verify the path and file is correct
0
 
Sanga CollinsSystems AdminCommented:
also check if the command in libexec has an extension.

For example I have "check_disk_snmp.pl" the command definition must also have the extension (.pl). This has caught me off guard a few times and leads to plugin out-of-bounds error message
0
 
lhrslsshahiAuthor Commented:
The below did the trick

vim /etc/xinetd.d

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream
        port            = 5666
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = no
        only_from       = 192.168.20.11


Changed from 127.0.0.1 to 192.168.20.11

Thanks for all your help Seth
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 10
  • 9
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now