Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Nagios config export and install

Posted on 2013-12-24
22
Medium Priority
?
532 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 36

Accepted Solution

by:
Seth Simmons earned 2000 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 36

Assisted Solution

by:Seth Simmons
Seth Simmons earned 2000 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
Who's Defending Your Organization from Threats?

Protecting against advanced threats requires an IT dream team – a well-oiled machine of people and solutions working together to defend your organization. Download our resource kit today to learn more about the tools you need to build you IT Dream Team!

 

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 36

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 36

Expert Comment

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

Author Comment

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

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 36

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 36

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 36

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 36

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

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

578 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