Solved

Nagios config export and install

Posted on 2013-12-24
22
445 Views
Last Modified: 2014-01-13
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
Comment
Question by:lhrslsshahi
  • 10
  • 9
  • 3
22 Comments
 
LVL 34

Accepted Solution

by:
Seth Simmons earned 500 total points
Comment Utility
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
 

Author Comment

by:lhrslsshahi
Comment Utility
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
 
LVL 34

Assisted Solution

by:Seth Simmons
Seth Simmons earned 500 total points
Comment Utility
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
 

Author Comment

by:lhrslsshahi
Comment Utility
I will give it a go and come back to you.
0
 
LVL 18

Expert Comment

by:Sanga Collins
Comment Utility
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
 

Author Comment

by:lhrslsshahi
Comment Utility
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
 
LVL 34

Expert Comment

by:Seth Simmons
Comment Utility
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
 

Author Comment

by:lhrslsshahi
Comment Utility
@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
 
LVL 34

Expert Comment

by:Seth Simmons
Comment Utility
it's essentially monitoring itself?
0
 

Author Comment

by:lhrslsshahi
Comment Utility
That's correct
0
 
LVL 34

Expert Comment

by:Seth Simmons
Comment Utility
ok...is this plugin in question going through nrpe?  how is it configured?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:lhrslsshahi
Comment Utility
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
 
LVL 18

Expert Comment

by:Sanga Collins
Comment Utility
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
 
LVL 34

Expert Comment

by:Seth Simmons
Comment Utility
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
 

Author Comment

by:lhrslsshahi
Comment Utility
Thanks guys however it was working before, is there any logs I can check to see whats causing the problem?
0
 
LVL 34

Expert Comment

by:Seth Simmons
Comment Utility
there won't be anything in the nagios log except for that out of bounds error
which service check is failing?
0
 

Author Comment

by:lhrslsshahi
Comment Utility
How do I check which service check is failing?
0
 
LVL 34

Expert Comment

by:Seth Simmons
Comment Utility
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
 

Author Comment

by:lhrslsshahi
Comment Utility
Service - Uptime
Status   - Critical

Thanks
0
 
LVL 34

Expert Comment

by:Seth Simmons
Comment Utility
what is the command defined in the config for that item?
check the command and verify the path and file is correct
0
 
LVL 18

Expert Comment

by:Sanga Collins
Comment Utility
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
 

Author Comment

by:lhrslsshahi
Comment Utility
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

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

So, you're experiencing issues on your network and you've decided that you need to perform some tests to determine whether your cabling is good.  You're likely thinking that you may need to spend money which you probably don't have on hiring/purchas…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now