Methods for monitoring remote systems with Nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
itIsMrKevin
Posts: 28
Joined: Tue Oct 23, 2012 1:28 pm

Methods for monitoring remote systems with Nagios

Post by itIsMrKevin »

Hi,

We are running Nagios Core 3.2.3 on a machine running CentOS 5.9. Nagios is currently monitoring about 15 systmes. I am not sure which method Nagios is using to monitor the remote system (i.e. nrpe, check_by_ssh, etc..)

Can someone please tell me how I can find out which method Nagios is using? Either by checking on the host machine with Nagios Core installed on it or on any of the remote machines.

Thanks.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Methods for monitoring remote systems with Nagios

Post by sreinhardt »

You can just look at the configuration files on the nagios server. Depending on how your configs are setup you may be able to look at /usr/local/nagios/etc/services/[hostname].cfg or it may be in just a hosts.cfg or services.cfg file. The most simple route might be to run a command like below:

Code: Select all

grep -iR '[hostname]' /usr/local/nagios/etc
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Methods for monitoring remote systems with Nagios

Post by abrist »

Check the config files for the service checks. They should have a directive named "check_command". This command should dictate the method of monitoring.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
itIsMrKevin
Posts: 28
Joined: Tue Oct 23, 2012 1:28 pm

Re: Methods for monitoring remote systems with Nagios

Post by itIsMrKevin »

Hi sreinhardt,

for running "grep -iR '[hostname]' /usr/local/nagios/etc", would I use the hostname of the Nagios Core server or the hostname of each of the remote servers?
Last edited by itIsMrKevin on Wed Sep 11, 2013 3:38 pm, edited 1 time in total.
itIsMrKevin
Posts: 28
Joined: Tue Oct 23, 2012 1:28 pm

Re: Methods for monitoring remote systems with Nagios

Post by itIsMrKevin »

Hi abrist,

What are the name(s) of the config file(s) for the service checks and where would I find them?

Thanks.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Methods for monitoring remote systems with Nagios

Post by abrist »

itIsMrKevin wrote:Hi abrist,
What are the name(s) of the config file(s) for the service checks and where would I find them?
This is actually completely up to admin implementing nagios core. Some will put them right in the host config files, while other will separate them by hostname but place them in a different directory. Start by searching the directories:

Code: Select all

/usr/local/nagios/etc
/usr/local/nagios/etc/objects
/usr/local/nagios/etc/hosts
/usr/local/nagios/etc/services
This is about all we can do as there is no "standard", universally accepted organizational scheme for the object files.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
itIsMrKevin
Posts: 28
Joined: Tue Oct 23, 2012 1:28 pm

Re: Methods for monitoring remote systems with Nagios

Post by itIsMrKevin »

Hi arbist,

I have been looking at the config file. I don't see where it actually names if we are using the nrpe plugin or the check_by_ssh plugin.

For example it has the following entry below:
# HTTP Services #####

define service {
use generic-service
host_name !localhost
hostgroup group1,group2
service_description HTTP Test
check_command check_http
}

When I logged into the Nagios GUI, I confirmed that all of the machines in group1 and group2 are being monitored by our the HTTP test. However, this definition does not tell me how Nagios is reaching all of the machines in group1 and group2. I still don't know if it is reaching them by using nrpe plugin, check_by_ssh plugin, or any other plugin to reach those machines.

I was hoping someone could answer the questions I have below:

1) Is there anywhere in this configuration file or any other configuration file where we would tell it to
(a) maybe use the check_by_ssh plugin to remotely monitor all machines
or
(b) possibly use the check_by_ssh plugin to remotely monitor machine1 and machine2 while using the nrpe plugin to remotely monitor machine3 and machine4.

2) Are there any other plugins besides check_by_ssh and nrpe that can be used on Nagios Core 3.X to monitor remote machines

Thanks again for any help you can give me.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Methods for monitoring remote systems with Nagios

Post by sreinhardt »

1) You can use any configuration of the plugins that you mentioned or many others. Nagios core will not restrict what you use, and you can do this as many different ways as you would like.

2) There are many, nrds, nrdp, nsca, nsclient\check_nt, wmi, snmp, etc. Virtually every plugin is used within nagios is to monitor machines other than the nagios server. It is simply a question of how you would like to monitor.

As for determining how you are monitoring things. Presently you are just creating an http connection from the nagios server to the remote machine. The command portion using check_http says that you are doing this locally on your nagios machine and not using check_by_ssh or nrpe.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
itIsMrKevin
Posts: 28
Joined: Tue Oct 23, 2012 1:28 pm

Re: Methods for monitoring remote systems with Nagios

Post by itIsMrKevin »

sreinhardt,

Thanks for that useful information
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Methods for monitoring remote systems with Nagios

Post by slansing »

Can we help you with anything else on this topic?
Locked