Solved

Nagios config export and install

Posted on 2013-12-24
22
489 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 9
  • 3
22 Comments
 
LVL 35

Accepted Solution

by:
Seth Simmons earned 500 total points
ID: 39738830
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
ID: 39738832
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 35

Assisted Solution

by:Seth Simmons
Seth Simmons earned 500 total points
ID: 39738834
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
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 

Author Comment

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

Expert Comment

by:Sanga Collins
ID: 39740189
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
ID: 39756467
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 35

Expert Comment

by:Seth Simmons
ID: 39756932
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
ID: 39757283
@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 35

Expert Comment

by:Seth Simmons
ID: 39757325
it's essentially monitoring itself?
0
 

Author Comment

by:lhrslsshahi
ID: 39757351
That's correct
0
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39757784
ok...is this plugin in question going through nrpe?  how is it configured?
0
 

Author Comment

by:lhrslsshahi
ID: 39757797
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
ID: 39757803
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 35

Expert Comment

by:Seth Simmons
ID: 39757918
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
ID: 39757950
Thanks guys however it was working before, is there any logs I can check to see whats causing the problem?
0
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39758405
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
ID: 39769376
How do I check which service check is failing?
0
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39769401
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
ID: 39769508
Service - Uptime
Status   - Critical

Thanks
0
 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39770089
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
ID: 39771239
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
ID: 39776592
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

624 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