disk warning messages

Marc Powell marc at ena.com
Fri Jun 5 01:13:37 CEST 2009


On Jun 4, 2009, at 4:01 PM, Jeremiah Jester wrote:

> Hello,
>
> I'm trying to configure nagios to include the disk full percentage  
> in the subject line of the email notification. For example. Subject:  
> [Nagios] CRITICAL 99% Full on Server1
>
> My commands currently look something like this for checking disk  
> space.
>
> Anyone have any suggestions for me?


> # 'host-notify-by-email' command definition
> define command{
>         command_name    host-notify-by-email
>         command_line    /usr/bin/printf "Subject: [Nagios]  
> $SERVICESTATE$: $SERVICEDESC$ $HOSTNAME$\nFrom: nagios@$HOSTNAME 
> $.mascorp.com\n\n ***** Nagios *****\n\nNotification Type:  
> $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:  
> $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | / 
> usr/sbin/exim "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
>         }

This is a host notification, not a service notification so I can't  
show you *exactly* what to do but I'll give you the example for the  
above and let you extrapolate --

         command_line    /usr/bin/printf "Subject: [Nagios]  
$SERVICESTATE$: $SERVICEDESC$ $HOSTNAME$\nFrom: nagios@$HOSTNAME 
$.mascorp.com\n\n ***** Nagios *****\n\nNotification Type:  
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:  
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | / 
usr/sbin/exim "[Nagios] $HOSTSTATE$ $HOSTOUTPUT$" $CONTACTEMAIL$
         }

Note the change after '|/usr/sbin/exim'. That's where the Subject is  
specified. For a service notification, you'd use $SERVICE*$ instead of  
$HOST*$. You may not need $HOSTSTATE$ depending on if the plugin  
includes the CRITICAL text already.

--
Marc

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list