Re: [Nagios-users] nagios 3.0.5 email notifications fail {Spam?}

2009-01-13 Thread alex alex
Ok, my mistake. I can clearly see that I put all options in notification
template, including "n " from "none" so none of the notifications were sent.
Stupid me!
Thanks all,

Alex

On Tue, Jan 13, 2009 at 10:47 AM, alex alex  wrote:

> Hi again.
> I have bad news(for me,at least). I remove the flap announcements and
> notifications are not working. Here's the debug log for nagios:
>
> [1231835680.728809] [032.2] [pid=14526] ** Checking host notification
> viability for contact 'user'...
> [1231835680.728838] [032.2] [pid=14526] We shouldn't notify this contact
> about DOWN states.
> [1231835680.728858] [032.0] [pid=14526] No contacts were notified.  Next
> possible notification time: Thu Jan  1 02:00:00 1970
> [1231835680.728873] [032.0] [pid=14526] 0 contacts were notified.
>
>
> So it seems that the contacts didn't inherited the template???  were found.
> Again, my configs read:
>
> # contactgroups admins
> define contactgroup {
> contactgroup_name   admins
> alias   admins
> members nagios,user
> }
> #contact template
> define contact {
> namegeneric_contact
> host_notification_period24din24_7din7
> service_notification_period 24din24_7din7
> host_notification_options   d,u,r,n,f
> service_notification_optionsu,c,w,r,n,f
> host_notification_commands  notify-host-by-email
> service_notification_commands   notify-service-by-email
> register0
> }
> define contact {
> contact_nameuser
> use generic_contact
> alias   utilizator_generic
> email   s...@localhost
> }
>
> define host {
> host_name   host1
> alias   host1
> address 192.168.1.1
> use generic_host_tpl
> }
> define host {
> namegeneric_host_tpl
> process_perf_data   1
> retain_status_information   1
> retain_nonstatus_information1
> active_checks_enabled   1
> passive_checks_enabled  1
> check_period24din24_7din7
> obsess_over_host0
> check_freshness 1
> freshness_threshold 0
> check_command   is_icmp_alive
> max_check_attempts  1
> event_handler_enabled   0
> notifications_enabled   1
> notification_interval   5
> notification_period 24din24_7din7
> notification_optionsd,u,r,f
> stalking_optionsd,o,u
> register0
> action_url/nagios/pnp/index.php?host=$HOSTNAME$
>
> }
>
>
>
>
>
>
>
>
> On Mon, Jan 12, 2009 at 3:49 PM, Marc Powell  wrote:
>
>>
>> On Jan 12, 2009, at 5:44 AM, alex alex wrote:
>> > Notification: FLAPPINGSTOP
>> > Host: host1
>> > State: UP
>> > Or for a service
>>
>> > Notification Type: FLAPPINGSTOP
>> >
>> > Service: is_alive
>> > Host: host1
>> > Is it the right behaviour (to put flapping instead up/down if the
>> > flapping is enabled) ?
>>
>> Yes, if the host or service were in a flapping state, which these
>> were. flapping is different than a normal up/down and that
>> notification type is provided should you want or need to make that
>> distinction. If you'd rather just receive up/down notifications,
>> disable notifications for flapping.
>>
>> > Anyhow, some notifications are sent and that's the main good news. I
>> > think from now only some small changes must be done in my configs to
>> > tune the uinstallation.
>>
>> Good =)
>>
>> --
>> Marc
>>
>>
>>
>> --
>> Check out the new SourceForge.net Marketplace.
>> It is the best place to buy or sell services for
>> just about anything Open Source.
>> http://p.sf.net/sfu/Xq1LFB
>> ___
>> Nagios-users mailing list
>> Nagios-users@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:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, 

Re: [Nagios-users] nagios 3.0.5 email notifications fail {Spam?}

2009-01-13 Thread Joerg Linge
alex alex schrieb:
> Hi again.
> I have bad news(for me,at least). I remove the flap announcements and 
> notifications are not working. Here's the debug log for nagios:
> 
> [1231835680.728809] [032.2] [pid=14526] ** Checking host notification 
> viability for contact 'user'...
> [1231835680.728838] [032.2] [pid=14526] We shouldn't notify this contact 
> about DOWN states.
> [1231835680.728858] [032.0] [pid=14526] No contacts were notified.  Next 
> possible notification time: Thu Jan  1 02:00:00 1970
> [1231835680.728873] [032.0] [pid=14526] 0 contacts were notified.
> 
> 
> So it seems that the contacts didn't inherited the template???  were 
> found. Again, my configs read:
> 
> # contactgroups admins
> define contactgroup {
> contactgroup_name   admins
> alias   admins
> members nagios,user
> }
> #contact template
> define contact {
> namegeneric_contact
> host_notification_period24din24_7din7
> service_notification_period 24din24_7din7
> host_notification_options   d,u,r,n,f
> service_notification_optionsu,c,w,r,n,f
> host_notification_commands  notify-host-by-email
> service_notification_commands   notify-service-by-email
> register0
> }


Do you realy want to use "service_notification_options n"?

http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#contact


If you specify n (none) as an option, the contact will not receive any type of 
service notifications. 


Cheers Joerg

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] nagios 3.0.5 email notifications fail {Spam?}

2009-01-13 Thread alex alex
Hi again.
I have bad news(for me,at least). I remove the flap announcements and
notifications are not working. Here's the debug log for nagios:

[1231835680.728809] [032.2] [pid=14526] ** Checking host notification
viability for contact 'user'...
[1231835680.728838] [032.2] [pid=14526] We shouldn't notify this contact
about DOWN states.
[1231835680.728858] [032.0] [pid=14526] No contacts were notified.  Next
possible notification time: Thu Jan  1 02:00:00 1970
[1231835680.728873] [032.0] [pid=14526] 0 contacts were notified.


So it seems that the contacts didn't inherited the template???  were found.
Again, my configs read:

# contactgroups admins
define contactgroup {
contactgroup_name   admins
alias   admins
members nagios,user
}
#contact template
define contact {
namegeneric_contact
host_notification_period24din24_7din7
service_notification_period 24din24_7din7
host_notification_options   d,u,r,n,f
service_notification_optionsu,c,w,r,n,f
host_notification_commands  notify-host-by-email
service_notification_commands   notify-service-by-email
register0
}
define contact {
contact_nameuser
use generic_contact
alias   utilizator_generic
email   s...@localhost
}

define host {
host_name   host1
alias   host1
address 192.168.1.1
use generic_host_tpl
}
define host {
namegeneric_host_tpl
process_perf_data   1
retain_status_information   1
retain_nonstatus_information1
active_checks_enabled   1
passive_checks_enabled  1
check_period24din24_7din7
obsess_over_host0
check_freshness 1
freshness_threshold 0
check_command   is_icmp_alive
max_check_attempts  1
event_handler_enabled   0
notifications_enabled   1
notification_interval   5
notification_period 24din24_7din7
notification_optionsd,u,r,f
stalking_optionsd,o,u
register0
action_url/nagios/pnp/index.php?host=$HOSTNAME$
}








On Mon, Jan 12, 2009 at 3:49 PM, Marc Powell  wrote:

>
> On Jan 12, 2009, at 5:44 AM, alex alex wrote:
> > Notification: FLAPPINGSTOP
> > Host: host1
> > State: UP
> > Or for a service
>
> > Notification Type: FLAPPINGSTOP
> >
> > Service: is_alive
> > Host: host1
> > Is it the right behaviour (to put flapping instead up/down if the
> > flapping is enabled) ?
>
> Yes, if the host or service were in a flapping state, which these
> were. flapping is different than a normal up/down and that
> notification type is provided should you want or need to make that
> distinction. If you'd rather just receive up/down notifications,
> disable notifications for flapping.
>
> > Anyhow, some notifications are sent and that's the main good news. I
> > think from now only some small changes must be done in my configs to
> > tune the uinstallation.
>
> Good =)
>
> --
> Marc
>
>
>
> --
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> ___
> Nagios-users mailing list
> Nagios-users@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:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] nagios 3.0.5 email notifications fail {Spam?}

2009-01-12 Thread Marc Powell

On Jan 12, 2009, at 5:44 AM, alex alex wrote:
> Notification: FLAPPINGSTOP
> Host: host1
> State: UP
> Or for a service

> Notification Type: FLAPPINGSTOP
>
> Service: is_alive
> Host: host1
> Is it the right behaviour (to put flapping instead up/down if the  
> flapping is enabled) ?

Yes, if the host or service were in a flapping state, which these  
were. flapping is different than a normal up/down and that  
notification type is provided should you want or need to make that  
distinction. If you'd rather just receive up/down notifications,  
disable notifications for flapping.

> Anyhow, some notifications are sent and that's the main good news. I  
> think from now only some small changes must be done in my configs to  
> tune the uinstallation.

Good =)

--
Marc


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] nagios 3.0.5 email notifications fail {Spam?}

2009-01-12 Thread alex alex
Hi again,
Yes, there is another template named generic-contact but it's identical to
the generic (excepting the name).
But here's a good news: I have some notifications (finnaly, it seems that
the notification works). And the bad news is that I get only emails like:

"

Return-Path: 
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.14.1/8.14.1) with ESMTP id n0CAArp4003801
for ; Mon, 12 Jan 2009 12:10:53 +0200
Received: (from nag...@localhost)
by localhost.localdomain (8.14.1/8.14.1/Submit) id n0CAArxq003799
for nag...@localhost; Mon, 12 Jan 2009 12:10:53 +0200
Date: Mon, 12 Jan 2009 12:10:53 +0200
From: nag...@localhost.localdomain
Message-Id: <200901121010.n0caarxq003...@localhost.localdomain>
To: nag...@localhost.localdomain

Subject: ** $ Host Alert: host1 is UP **

* Nagios *

Notification: FLAPPINGSTOP
Host: host1
State: UP
Address: 172.30.129.67
Info: PING OK - Packet loss = 0%, RTA = 11.74 ms

Date/Time: Sun Jan 11 15:10:11 EET 2009"


Or for a service
"
Subject: ** FLAPPINGSTOP Service Alert: host1/is_alive is OK **

* Nagios *

Notification Type: FLAPPINGSTOP

Service: is_alive
Host: host1
Address: 172.24.14.242
State: OK

Date/Time: Mon Jan 12 12:10:53 EET 2009

Additional Info:

PING OK - Packet loss = 0%, RTA = 131.99 ms


"

Is it the right behaviour (to put flapping instead up/down if the flapping
is enabled) ? The thresholds for flapp are set at 25% and 50%.

Anyhow, some notifications are sent and that's the main good news. I think
from now only some small changes must be done in my configs to tune the
uinstallation.

Thank you again,

Alex

On Sat, Jan 10, 2009 at 1:11 AM, Marc Powell  wrote:

>
> On Jan 9, 2009, at 11:26 AM, alex alex wrote:
>
> > Hi again,
> > I've just disabled events handler. I think youwere right. The dead
> > emails were from events handler, not from notifications. No new
> > notifications failed in letter.dead It seems that in event handler,
> > the $CONTACTEMAIL$ is not set.
> > But now, even stranger, no notification is sent. I mean I enabled
> > debug in nagios.cfg and the result is:
> > [1231482452.131909] [032.0] [pid=16674] ** Host Notification Attempt
> > ** Host: 'h
> > ost1', Type: 0, Options: 0, Current State: 1, Last Notification: Thu
> > Jan  1
> >  02:00:00 1970
> > [1231482452.132086] [032.0] [pid=16674] Notification viability test
> > passed.
> > [1231482452.132104] [032.1] [pid=16674] Current notification number:
> > 1 (incremen
> > ted)
> > [1231482452.132127] [032.1] [pid=16674] Host notification will NOT
> > be escalated.
> > [1231482452.132241] [032.1] [pid=16674] Adding normal contacts for
> > host to notif
> > ication list.
> > [1231482452.132504] [032.0] [pid=16674] No contacts were notified.
> > Next possibl
> > e notification time: Thu Jan  1 02:00:00 1970
> > [1231482452.132524] [032.0] [pid=16674] 0 contacts were notified.
> > Now more than ever I don't understand why no contacts were notified!
> > It can mean that normal contacts doesn't exist?
> >
>
>  From a previous e-mail --
>
> define contact {
> contact_namenagios
> use generic-contact
> alias   nagios
> email   nag...@localhost
> }
>
> define contact {
> namegeneric
> host_notification_period24din2_7din7
> service_notification_period 24din2_7din7
> host_notification_options   d,u,r,n,f
> service_notification_optionsu,c,w,r,n,f
> host_notification_commands  notify-host-by-email
> service_notification_commands   notify-service-by-email
> register0
> }
>
> Your contact 'nagios' uses a template named 'generic-contact'. Do the
> host and service_notification_periods in that template include the
> time when the notification above was supposed to go out? The contact
> template you provided is named 'generic' not 'generic-contact' so
> there must be another template that needs to be looked at.
>
> --
> Marc
>
>
>
> --
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> ___
> Nagios-users mailing list
> Nagios-users@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
>
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB_

Re: [Nagios-users] nagios 3.0.5 email notifications fail {Spam?}

2009-01-09 Thread Marc Powell

On Jan 9, 2009, at 11:26 AM, alex alex wrote:

> Hi again,
> I've just disabled events handler. I think youwere right. The dead  
> emails were from events handler, not from notifications. No new  
> notifications failed in letter.dead It seems that in event handler,  
> the $CONTACTEMAIL$ is not set.
> But now, even stranger, no notification is sent. I mean I enabled  
> debug in nagios.cfg and the result is:
> [1231482452.131909] [032.0] [pid=16674] ** Host Notification Attempt  
> ** Host: 'h
> ost1', Type: 0, Options: 0, Current State: 1, Last Notification: Thu  
> Jan  1
>  02:00:00 1970
> [1231482452.132086] [032.0] [pid=16674] Notification viability test  
> passed.
> [1231482452.132104] [032.1] [pid=16674] Current notification number:  
> 1 (incremen
> ted)
> [1231482452.132127] [032.1] [pid=16674] Host notification will NOT  
> be escalated.
> [1231482452.132241] [032.1] [pid=16674] Adding normal contacts for  
> host to notif
> ication list.
> [1231482452.132504] [032.0] [pid=16674] No contacts were notified.   
> Next possibl
> e notification time: Thu Jan  1 02:00:00 1970
> [1231482452.132524] [032.0] [pid=16674] 0 contacts were notified.
> Now more than ever I don't understand why no contacts were notified!  
> It can mean that normal contacts doesn't exist?
>

 From a previous e-mail --

define contact {
 contact_namenagios
 use generic-contact
 alias   nagios
 email   nag...@localhost
}

define contact {
 namegeneric
 host_notification_period24din2_7din7
 service_notification_period 24din2_7din7
 host_notification_options   d,u,r,n,f
 service_notification_optionsu,c,w,r,n,f
 host_notification_commands  notify-host-by-email
 service_notification_commands   notify-service-by-email
 register0
}

Your contact 'nagios' uses a template named 'generic-contact'. Do the  
host and service_notification_periods in that template include the  
time when the notification above was supposed to go out? The contact  
template you provided is named 'generic' not 'generic-contact' so  
there must be another template that needs to be looked at.

--
Marc


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] nagios 3.0.5 email notifications fail

2009-01-09 Thread alex alex
Hi again,
I've just disabled events handler. I think youwere right. The dead emails
were from events handler, not from notifications. No new notifications
failed in letter.dead It seems that in event handler, the $CONTACTEMAIL$ is
not set.
But now, even stranger, no notification is sent. I mean I enabled debug in
nagios.cfg and the result is:

[1231482452.131909] [032.0] [pid=16674] ** Host Notification Attempt **
Host: 'h
ost1', Type: 0, Options: 0, Current State: 1, Last Notification: Thu Jan  1
 02:00:00 1970
[1231482452.132086] [032.0] [pid=16674] Notification viability test passed.
[1231482452.132104] [032.1] [pid=16674] Current notification number: 1
(incremen
ted)
[1231482452.132127] [032.1] [pid=16674] Host notification will NOT be
escalated.
[1231482452.132241] [032.1] [pid=16674] Adding normal contacts for host to
notif
ication list.
[1231482452.132504] [032.0] [pid=16674] No contacts were notified.  Next
possibl
e notification time: Thu Jan  1 02:00:00 1970
[1231482452.132524] [032.0] [pid=16674] 0 contacts were notified.

Now more than ever I don't understand why no contacts were notified! It can
mean that normal contacts doesn't exist?




>
> > So I guess that nagios is not getting right the  $CONTACTEMAIL$
> > macro substitution.
> >
> > I don't know exactly the inner works that means that if it's correct
> > to define a host and use a template for providing the contact group
> > and from the contact group nagios can extract the email addresses
> > and put them in $CONTACTEMAIL$
>
> I expect this to work fine.
>
> > Also, the services are not notified also; the same happens (the
> > email sustituted from $CONTACTEMAIL$ seems to be $???).
>
> I suspect that the more likely reason is that nagios is not replacing
> $CONTACTEMAIL$ with it's proper value before passing it on to the
> shell for some strange reason. The shell then interprets '$CONTACTEMAIL
> $' as a null shell variable of '$CONTACTEMAIL' followed by a literal
> '$' so you end up with the results your seeing (you could see this by
> enabling debug mode). The question is why nagios isn't doing the
> substitution properly. The most likely cause is that the macro is
> mistyped but that really doesn't look like the case.
>
> Actually, now that I'm reviewing your original posting. I'm exactly
> sure that nagios isn't performing the subtitution at all. In your host
> template (and probably service template), you specify the notification
> commands as event_handlers. This is not a correct use of event
> handlers as the $CONTACTEMAIL$ macro (and others) are not valid for
> them. Disable event_handler_enabled and remove event_handler and you
> should be fixed. The notifications will still go out through the
> normal notification process.
>
> --
> Marc
>
>
>
> --
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> ___
> Nagios-users mailing list
> Nagios-users@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
>
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] nagios 3.0.5 email notifications fail

2009-01-09 Thread Marc Powell

On Jan 9, 2009, at 8:42 AM, alex alex wrote:

> I will try to see the error in command. I already use a modified  
> command
>
>  define command {
> command_namenotify-host-by-email
> command_line   /usr/bin/printf "%b"  
> "Host: $HOSTNAME$\n $CONTACTEMAIL$\n" |cat >>/tmp/testfile
> }
>
>
> and I get in the log file just:
>
> Host: host1
>  $
> Host: host1
>  $
> Host: host1
>  $

Interesting...

> So I guess that nagios is not getting right the  $CONTACTEMAIL$  
> macro substitution.
>
> I don't know exactly the inner works that means that if it's correct  
> to define a host and use a template for providing the contact group  
> and from the contact group nagios can extract the email addresses  
> and put them in $CONTACTEMAIL$

I expect this to work fine.

> Also, the services are not notified also; the same happens (the  
> email sustituted from $CONTACTEMAIL$ seems to be $???).

I suspect that the more likely reason is that nagios is not replacing  
$CONTACTEMAIL$ with it's proper value before passing it on to the  
shell for some strange reason. The shell then interprets '$CONTACTEMAIL 
$' as a null shell variable of '$CONTACTEMAIL' followed by a literal  
'$' so you end up with the results your seeing (you could see this by  
enabling debug mode). The question is why nagios isn't doing the  
substitution properly. The most likely cause is that the macro is  
mistyped but that really doesn't look like the case.

Actually, now that I'm reviewing your original posting. I'm exactly  
sure that nagios isn't performing the subtitution at all. In your host  
template (and probably service template), you specify the notification  
commands as event_handlers. This is not a correct use of event  
handlers as the $CONTACTEMAIL$ macro (and others) are not valid for  
them. Disable event_handler_enabled and remove event_handler and you  
should be fixed. The notifications will still go out through the  
normal notification process.

--
Marc


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] nagios 3.0.5 email notifications fail

2009-01-09 Thread alex alex
ok, I get the service and not the host email from dead.letter. My mistake.
Here's the host one:

>From nagios Fri Jan  9 16:12:31 2009
Return-Path: 
Received: (from nag...@localhost)
by localhost.localdomain (8.14.1/8.14.1/Submit) id n09ECVcx011087
for $; Fri, 9 Jan 2009 16:12:31 +0200
Date: Fri, 9 Jan 2009 16:12:31 +0200
From: nagios
Message-Id: <200901091412.n09ecvcx011...@localhost.localdomain>
To: $
Subject: ** $ Host Alert: host1 is DOWN **

* Nagios *

Notification:



I will try to see the error in command. I already use a modified command

 define command {
command_namenotify-host-by-email
command_line   /usr/bin/printf "%b" "Host:
$HOSTNAME$\n $CONTACTEMAIL$\n" |cat >>/tmp/testfile
}


and I get in the log file just:

Host: host1
 $
Host: host1
 $
Host: host1
 $


So I guess that nagios is not getting right the  $CONTACTEMAIL$ macro
substitution.

I don't know exactly the inner works that means that if it's correct to
define a host and use a template for providing the contact group and from
the contact group nagios can extract the email addresses and put them in
$CONTACTEMAIL$

Also, the services are not notified also; the same happens (the email
sustituted from $CONTACTEMAIL$ seems to be $???).

Thank you,

Alex




On Fri, Jan 9, 2009 at 3:30 PM, Marc Powell  wrote:

>
> On Jan 9, 2009, at 4:52 AM, alex alex wrote:
>
> > Subject: **  Service Alert: ITM_M._Ciuc/is_alive is OK **"
>
> This is a service alert.
>
> > Somehow it seems that no user address is found (or the address $ is
> > used ). Also, the mail log says the same thing:
>
>
> >
> > define contact {
> > [snip]
> > host_notification_commands  notify-host-by-email
> > service_notification_commands   notify-service-by-email
> > register0
> > }
> >
> > define command {
> > command_namenotify-host-by-email
>
> This is not the commnad{} used for service alerts (look for notify-
> service-by-email). My expectation is that you have a typo at or near
> $CONTACTEMAIL$ there.
>
> --
> Marc
>
>
>
> --
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> ___
> Nagios-users mailing list
> Nagios-users@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
>
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] nagios 3.0.5 email notifications fail

2009-01-09 Thread Marc Powell

On Jan 9, 2009, at 4:52 AM, alex alex wrote:

> Subject: **  Service Alert: ITM_M._Ciuc/is_alive is OK **"

This is a service alert.

> Somehow it seems that no user address is found (or the address $ is  
> used ). Also, the mail log says the same thing:


>
> define contact {
> [snip]
> host_notification_commands  notify-host-by-email
> service_notification_commands   notify-service-by-email
> register0
> }
>
> define command {
> command_namenotify-host-by-email

This is not the commnad{} used for service alerts (look for notify- 
service-by-email). My expectation is that you have a typo at or near  
$CONTACTEMAIL$ there.

--
Marc


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Nagios-users mailing list
Nagios-users@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


[Nagios-users] nagios 3.0.5 email notifications fail

2009-01-09 Thread alex alex
Hi all,
I have nagios 3.0.5 installed and it seems that it is working ok but no
notifications are sent. Instead, in /home/nagios/dead.letter the messages
keep arriving. The problem seems to be due to mail headers :

"From nagios Fri Jan  9 09:38:31 2009
Return-Path: 
Received: (from nag...@localhost)
by localhost.localdomain (8.14.1/8.14.1/Submit) id n097cVWc011912
for $; Fri, 9 Jan 2009 09:38:31 +0200
Date: Fri, 9 Jan 2009 09:38:31 +0200
From: nagios
Message-Id: <200901090738.n097cvwc011...@localhost.localdomain>
To: $
Subject: **  Service Alert: ITM_M._Ciuc/is_alive is OK **"

Somehow it seems that no user address is found (or the address $ is used ).
Also, the mail log says the same thing:

Jan  9 12:33:14 localhost sendmail[11185]: n09AXEi5011185: from=nagios,
size=276, class=0, nrcpts=1,
msgid=<200901091033.n09axei5011...@localhost.localdomain>,
relay=nag...@localhost
Jan  9 12:33:14 localhost sendmail[11186]: n09AXE29011186:
<$...@localhost.localdomain>... User unknown
Jan  9 12:33:14 localhost sendmail[11185]: n09AXEi5011185: to=$,
ctladdr=nagios (514/514), delay=00:00:00, xdelay=00:00:00, mailer=relay,
pri=30276, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jan  9 12:33:14 localhost sendmail[11186]: n09AXE29011186:
from=, size=276, class=0, nrcpts=0,
proto=ESMTP, daemon=Daemon0, relay=localhost.localdomain [127.0.0.1]

Do you encounter such behaviour?

Some relevant config files are as below:


define host {
host_name   host1
alias   host1
address 172.30.129.67
use generic_business_hour
}

#generic_business_hour
define host {
namegeneric_business_hour
process_perf_data   1
retain_status_information   1
flap_detection_enabled  1
retain_nonstatus_information1
active_checks_enabled   1
passive_checks_enabled  1
check_period9la18
obsess_over_host0
check_freshness 1
freshness_threshold 0
check_command   is_icmp_alive
max_check_attempts  3
event_handler_enabled   1
event_handler   notify-host-by-email
notifications_enabled   1
notification_interval   15
notification_period 9to18
notification_optionsd,u,r,f
stalking_optionsd,o,u
contact_groups  admins
register0
action_url/nagios/pnp/index.php?host=$HOSTNAME$
}

# contactgroups admins
define contactgroup {
contactgroup_name   admins
alias   admins
members nagios,user
}


define contact {
contact_namenagios
use generic-contact
alias   nagios
email   nag...@localhost
}

define contact {
namegeneric
host_notification_period24din2_7din7
service_notification_period 24din2_7din7
host_notification_options   d,u,r,n,f
service_notification_optionsu,c,w,r,n,f
host_notification_commands  notify-host-by-email
service_notification_commands   notify-service-by-email
register0
}

define command {
command_namenotify-host-by-email
command_line/usr/bin/printf "%b" "* Nagios
*\n\nNotification: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:
$LONGDATETIME$\n" | /bin/mail -s "** $NOTIFFICATIONTYPE$ Host Alert:
$HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}

Thank you,
Alex
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
Nagios-users mailing list
Nagios-users@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