One email notification per host for multiple services

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.
Locked
nabz889
Posts: 1
Joined: Wed Jul 11, 2012 3:22 pm

One email notification per host for multiple services

Post by nabz889 »

I am trying to find out a way to get one alert email from a host which lists all the services that have problems. This is better than receiving one email per service alert, which is filling up the inbox.

Have not found any notification macros for this. The $TOTALHOSTPROBLEMS$ or $TOTALSERVICEPROBLEMS$ macros give the TOTAL Nagios picture, but I want something like "total services per host with problems" and listing those services. So as an example:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Subject: ** PROBLEM Host Alert: Host_test services are 'CRITICAL,WARNING' **

Notification Type: PROBLEM

Host: Host_test
Address: 192.xxx.xxx.xx

The following services have problems:

Service 1: 'interface 1'
Description: Socket inaccessible
State: 'CRITICAL'
Duration:0d 2h 0m 31s

Service 2: 'interface 2'
Description: Plugin timed out
State: 'WARNING'
Duration:0d 2h 0m 34s

Service 3: 'interface 3'
Description: Plugin timed out
State: 'CRITICAL'
Duration:0d 2h 0m 35s
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Anybody know how to do this?

Thanks in advance.
Locked