Nagios 4 Setup for our Environment
Nagios 4 Setup for our Environment
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
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?
Are you installing them from source, or a repository?
What operating system(s) are you installing them on?
Former Nagios Employee.
me.
me.
Re: Nagios 4 Setup for our Environment
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
Is it showing any errors or anything in the interface? What is the output that you are seeing?
Thank you
Thank you
Re: Nagios 4 Setup for our Environment
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.
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios 4 Setup for our Environment
To be clear...
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?
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?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.
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
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
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
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Nagios 4 Setup for our Environment
OK so I suspect your problem is just a matter of not understanding how Nagios works in the configs.
So this service:
By default this is defined as:
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:
And then your service definition would be something like:
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?
So this service:
uses the command "check_local_load".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
}
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 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$
}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
}Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nagios 4 Setup for our Environment
Oh Wow! How did i miss that!! That was a great help for me. Its working fine now. Thanks a lot, 