RES: RES: Notification alerts customization
bcotta at unimedbh.com.br
bcotta at unimedbh.com.br
Mon Sep 20 19:05:40 CEST 2004
Hi,
I understand what did you see, but how can I associate the hosts.cfg with
misccommands.cfg?
I will try to explain:
In all servers that I have in my hosts.cfg, I d like to put a additional
information in each server. I think that I will create a variable (see * in
hosts.cfg) and in this variable I will put some information so solve the
problem and another informations.
Hosts.cfg
# 'server01' host definition
define host{
use generic-host ; Name of host
template to use
host_name server01
alias Servidor
parents switch-1
address 172.26.1.159
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
* additional_information Server to control the Internet Access
}
And in this below, What can I do to put a variable?
Misccommands.cfg
# 'notify-by-email' command definition
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" |
/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$ **" $CONTACTEMAIL$
}
I think that the Harper Mann write I can do this so easy, but it?s not
pratical.
Regards,
--
Breno Andrade Cotta
bcotta at unimedbh.com.br
Network Administrator
Fone: (31) 9977-2841 - (31) 3229-6273
-----Mensagem original-----
De: Andreas Ericsson [mailto:ae at op5.se]
Enviada em: segunda-feira, 20 de setembro de 2004 13:10
Para: nagios-users at lists.sourceforge.net
Assunto: Re: RES: [Nagios-users] Notification alerts customization
bcotta at unimedbh.com.br wrote:
> Hi all,
>
> I think that I?d like to do the same thing below.
> I?d like to customize mail notification, like that:
>
> ***** Nagios *****
>
> Notification Type: PROBLEM
> Host: server01
> State: DOWN
> Address: 172.26.1.159
> Info: CRITICAL - Plugin timed out after 10 seconds
>
> Date/Time: Tue Sept 21 09:38:45 GMT 2004
>
> Additional Info: Service Description!, What can I do to solve the
problem!,
No problem. Just write your own notification script. I've written three
myself.
> Which service stop if this server stop...... .
>
A bit trickier. The only possible solution I see so far is to grep, sed
and gawk your way through the config files, provided you haven't pulled
it into a database ofcourse.
>
> Regards,
> --
> Breno Andrade Cotta
> bcotta at unimedbh.com.br
> Network Administrator
> Fone: (31) 9977-2841 - (31) 3229-6273
>
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
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
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
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