forums.meulie.net

Changing e-mail alert attempt number

Hi all.

Essentially, I’m wanting to know if it’s possible to change the time nagios sends an e-mail alert from the first time something is unobtainable to the third time something is unobtainable.

The reason being that we essentially have these e-mails directed to a pager. When something is temporarily uncontactable at 2:00 in the morning (as it usually is. Comes back on the second attempt, though) it results in much irritation and lost sleep.

Any help is appreciated.

Nagios is not notifying until all attempts have failed. You must increase the max_check_attempts setting. At the first failed attempt, the status will change (either CRIT or WARN) but you won’t get notified until they all have failed. (sorry my indentation is gone despite use of the CODE tag)

define host { use _TMPL-H-BusinessCritical name TMPL-H-MTX-Routers_BC register 0 hostgroups MTX-Routers,ALL-Routers check_command check-host-alive max_check_attempts 5 check_period 24x7 contact_groups NG_Scheme_2_BusinessCritical }

Hope it helps
Clipper

Absolutely correct. If after 5 attempts the host will still not ping, then it will be critical and send out a notification. If 5 attempts is not long enough, then try 10. YOu may also want to tweak your check_commands, since they may be too tight. In the check_ping command for example, you could tweak the packet count too low and thus get criticals too often, so up the packet count.