I am new to nagios and we have a small issue I need to ask assistance with. Many of the machines that we monitor can go unresponsive for a bit when some very intensive cpu tasks are run. This makes nagios send warnings and alerts while these hosts are busy reporting things like 'ping timeout' or 'zombie processes' and even swap space warnings, but in actuality there is not a problem.

Is there a way to configure nagios to not send such alerts, but check x number of times over a period of time and only then send an alert at the end of that time if the server in question has not recovered?.

Looking at the commands.cfg file, I see entries like this:

define command{
        command_name    check_local_swap
        command_line    $USER1$/check_swap -w $ARG1$ -c $ARG2$

How could I modify this example to accomplish what I want above.



First, you could alter the parameters of the check(s) in question by adjusting the check_command directive(s):

For example:

    check_command           check_nrpe!check_zombie_procs!1 5

If you want to tolerate more zombie processes, just increase the numbers.

Once you have the thresholds adjusted to your liking, you could further prune spurious alerts by increasing max_check_attempts.

For example:

max_check_attempts      3

This allows the host/service to enter a "soft" non-OK state pending two further checks; you'll be alerted on the third.

See also: Nagios State Types, Nagios Object Definitions

  • is this done on the client or on the nagio servers nrpe.cfg file?
    – DRH
    Aug 31 '12 at 23:20
  • It depends how you have NRPE configured. Hard-coding the parameters in nrpe.cfg on the clients is more secure, but less flexible. Allowing client NRPE daemons to take remote arguments is more flexible, but less secure. You can tell which method is in use at your site by examining the dont_blame_nrpe option in the client nrpe.cfg files, or just looking to see where the parameters are set. Sep 1 '12 at 0:36
  • Can I have a quick explanation on what this actually does: check_nrpe!check_zombie_procs!1 5. What does the !1 5 represent. What is the difference when it is defined as such; check_nrpe!check_load!30
    – DRH
    Sep 5 '12 at 16:28
  • Sure. check_nrpe!check_zombie_procs!1 5 invokes the local check_nrpe command and instructs it to connect to the remote NRPE agent and run the check_zombie_procs command with arguments 1 and 5. The check_zombie_procs command on the remote machine runs check_procs -w $ARG1$ -c $ARG2$ -s Z, so the 1 and the 5 are used as the warning and critical zombie-process thresholds, respectively. Sep 14 '12 at 21:11
  • In your example, check_nrpe!check_load!30 invokes the local check_nrpe command and instructs it to connect to the remote NRPE agent and run the check_load command with a single argument of 30. What this actually accomplishes depends on the value of command[check_load] on the remote machine. At my site, the check_load command calls the check_load plugin with two arguments, in order to specify both the warning threshold and the critical threshold. Sep 14 '12 at 21:18

I think you may be talking about the "flapping" problem.

Check out this page about handling flapping under Nagios:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.