Page 1 of 1

Nagios 4 Setup for our Environment

Posted: Fri Oct 09, 2015 12:51 pm
by manu.rtr
I am setting up Nagios 4 for our environment. I am new to nagios-4 hope the configuration is similar to nagios3 as i have worked more on older versions of nagios. I have almost completed the setup. I just noticed that whenever load goes high or changes in other metrics, it not being updated on the Nagios UI. I have installed nagios 4 and nagios plugins 2.0 on master and nrpe-2.15 on clients. I didn't find check_nrpe on nagios master. As far as i know nagios executes check_nrpe with proper arguments, Clients receives command to be executed and client will execute the command and get a result and send back to Nagios. It get backs the result from check_nrpe. So I tried installing nagios-nrpe-plugin on nagios master but while installing i found that it also installs nagios3 which is not required in my case. Am not sure if the issue is related to check_nrpe or something else. Can you please help me out with this. Thanks in advance.

Re: Nagios 4 Setup for our Environment

Posted: Fri Oct 09, 2015 1:03 pm
by hsmith
Can I get a little information about how you are trying to install these?

Are you installing them from source, or a repository?

What operating system(s) are you installing them on?

Re: Nagios 4 Setup for our Environment

Posted: Fri Oct 09, 2015 1:30 pm
by manu.rtr
Thanks for the quick reply smith! I am using debian 7.9 wheezy. I am using tar ball for the installation, Please find the link below that i followed to setup Nagios https://assets.nagios.com/downloads/nag ... Source.pdf

Re: Nagios 4 Setup for our Environment

Posted: Fri Oct 09, 2015 2:23 pm
by ssax
Is it showing any errors or anything in the interface? What is the output that you are seeing?

Thank you

Re: Nagios 4 Setup for our Environment

Posted: Sat Oct 10, 2015 7:12 am
by manu.rtr
The Setup is completed. I don't see any errors as such. Everything looks fine. If i run the load command /usr/local/nagios/libexec/check_load -w xx -c xx through CLI gives the correct output. But nagios UI is not being updated with the latest values.

Re: Nagios 4 Setup for our Environment

Posted: Sat Oct 10, 2015 8:53 am
by jdalrymple
To be clear...
manu.rtr wrote: If i run the load command /usr/local/nagios/libexec/check_load -w xx -c xx through CLI gives the correct output. But nagios UI is not being updated with the latest values.
Running check_load from the command line will not update Nagios - you'll have to define some services that will handle running the plugin for you. I'm assuming that's done, and perhaps you're talking about the built in services?

Assuming you've taken the above comment into account - if you look at the details of the service is the next run date in the future or past? If you look at the opening Nagios screen does it indicate that the process is running with a green check marK?

Re: Nagios 4 Setup for our Environment

Posted: Sat Oct 10, 2015 3:06 pm
by manu.rtr
Current Status: OK (for 0d 0h 17m 47s)
Status Information: OK - load average: 0.01, 0.03, 0.09
Performance Data: load1=0.010;5.000;10.000;0; load5=0.030;4.000;6.000;0; load15=0.090;3.000;4.000;0;
Current Attempt: 1/3 (HARD state)
Last Check Time: 10-10-2015 19:58:12
Check Type: ACTIVE
Check Latency / Duration: 0.000 / 0.002 seconds
Next Scheduled Check: 10-10-2015 20:08:12
Last State Change: 10-10-2015 19:40:27


This is what the status is being displayed. Just found that Nagios server is not picking up clients value but adding its own load values.
root@ip-xx-xx-xx-xx:~# uptime
19:57:40 up 17 days, 10:32, 5 users, load average: 0.01, 0.03, 0.09

Service defined for load

define service{
use generic-service
host_name devops100,door
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
Host Definition:
define host {
use linux-server
host_name devops10
alias devops-test
address 10.11.x.xx
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
notifications_enabled 1
}
Have configures clients and have added nagios server's IP under allowedhosts.

[email protected]:~# /usr/local/nagios/libexec/check_nrpe -H 10.11.x.xx
NRPE v2.13

Re: Nagios 4 Setup for our Environment

Posted: Mon Oct 12, 2015 12:53 am
by Box293
OK so I suspect your problem is just a matter of not understanding how Nagios works in the configs.

So this service:
manu.rtr wrote:define service{
use generic-service
host_name devops100,door
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
uses the command "check_local_load".

By default this is defined as:

Code: Select all

define command{
        command_name    check_local_load
        command_line    $USER1$/check_load -w $ARG1$ -c $ARG2$
        }
So clearly what is happening here is that the service is just checking the load of the local nagios server, the command itself does not have an argument like -H which tells it to request a remote host to execute the check.

So you need to define an NRPE command like:

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
And then your service definition would be something like:

Code: Select all

define service{
use generic-service
host_name devops100,door
service_description Current Load
check_command check_nrpe!check_load!-a 5.0,4.0,3.0 10.0,6.0,4.0
}
The check_load command would be defined on your NRPE listener on the client in the file /usr/local/nagios/etc/nrpe.cfg or /usr/local/nagios/etc/nrpe/common.cfg.

Does this help?

Re: Nagios 4 Setup for our Environment

Posted: Tue Oct 13, 2015 2:37 am
by manu.rtr
Oh Wow! How did i miss that!! That was a great help for me. Its working fine now. Thanks a lot, :)