I got problem with sending messages:(

Витя Борисов vitya at vitya.net
Thu Dec 11 14:52:43 CET 2008


Hi there!
I got problem with sending messages. User nagios is capable of  
sending messages with assigned to him rights without any restrictions.

ns:~ # su - nagios
nagios at ns:~> /usr/bin/printf "test msg, yo!" | mailx -v -A myisp
vitya at xxx.yyy
warning: incomplete line - newline appended
warning: incomplete line - newline appended
Resolving host mail4.xxx.yyy . . . done.
Connecting to x.x.x.x . . . connected.
220 MAIL4.xxx.yyy ESMTP Server (Microsoft Exchange Internet Mail  
Service 5.5.2657.72) ready
EHLO ns.kgminsk
250-MAIL4.xxx.yyy Hello [x.x.x.x]
250-XEXCH50
250-HELP
250-ETRN
250-DSN
250-SIZE 2097152
250-AUTH LOGIN
250 AUTH=LOGIN
AUTH LOGIN
334 VXNlcm5hbWU6
Ym9yaXNvdnZ2
334 UGFzc3dvcmQ6
MTIz
235 LOGIN authentication successful
MAIL FROM: <vitya at xxx.yyy>
250 OK - mail from <vitya at xxx.yyy>
RCPT TO: <vitya at xxx.yyy>
250 OK - Recipient <VITYA at XXX.YYY>
DATA
354 Send data.  End with CRLF.CRLF
.
250 OK
QUIT
221 closing connection
nagios at ns:~>

Message is received by my email box.

From: Nagios robot <vitya at xxx.yyy>
To: vitya at xxx.yyy
Date: Thu, 11 Dec 2008 10:31:23 +0300
User-Agent: nail 11.25 7/29/05

test msg, yo!

File .mailrc is located in /home/nagios/ directory. User nagios has  
access to the directory.

account myisp{
set from="vitya at xxx.yyy (Nagios robot)"
set smtp=mail4.xxx.yyy
set smtp-auth=login
set smtp-auth-user=vitya
set smtp-auth-password=**************************
}

debug_verbosity=2 and debug_file=/var/opt/nagios/nagios.debug are  
included into nagios.cfg, following can be seen in /var/opt/nagios/ 
nagios.debug:

[1228980610.181330] [032.0] [pid=3041] Notification viability test  
passed.
[1228980610.181337] [032.1] [pid=3041] Current notification number: 2  
(incremented)
[1228980610.181343] [032.2] [pid=3041] Creating list of contacts to  
be notified.
[1228980610.181350] [032.1] [pid=3041] Host notification will NOT be  
escalated.
[1228980610.181360] [032.1] [pid=3041] Adding normal contacts for  
host to notification list.
[1228980610.181366] [032.2] [pid=3041] Adding individual contacts for  
host to notification list.
[1228980610.181371] [032.2] [pid=3041] Adding members of contact  
groups for host to notification list.
[1228980610.181391] [032.2] [pid=3041] Adding members of contact  
group 'l-admin' for host to notification list.
[1228980610.181397] [032.2] [pid=3041] Adding contact 'nagiosadmin'  
to notification list.
[1228980610.181414] [032.2] [pid=3041] ** Attempting to notifying  
contact 'nagiosadmin'...
[1228980610.181422] [032.2] [pid=3041] ** Checking host notification  
viability for contact 'nagiosadmin'...
[1228980610.181434] [032.2] [pid=3041] ** Host notification viability  
for contact 'nagiosadmin' PASSED.
[1228980610.181441] [032.2] [pid=3041] ** Notifying contact  
'nagiosadmin'
[1228980610.181461] [032.2] [pid=3041] Raw notification command: /usr/ 
bin/printf "%b" "***** Nagios *****\n\nNotification Type:  
$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:  
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | / 
usr/bin/nail -send -A myisp $CONTACTEMAIL$
[1228980610.181497] [032.2] [pid=3041] Processed notification  
command: /usr/bin/printf "%b" "***** Nagios *****\n\nNotification  
Type: RECOVERY\nHost: arm-dspg\nState: UP\nAddress: 192.168.0.12 
\nInfo: PING
OK - Packet loss = 0%, RTA = 0.79 ms\n\nDate/Time: Thu Dec 11  
10:30:10 MSK 2008\n" | /usr/bin/nail -send -A myisp vitya at xxx.yyy
[1228980614.724192] [032.2] [pid=3041] Calculating next valid  
notification time...
[1228980614.724236] [032.2] [pid=3041] Default interval: 120.000000
[1228980614.724258] [032.2] [pid=3041] Interval used for calculating  
next valid notification time: 120.000000
[1228980614.724282] [032.0] [pid=3041] 1 contacts were notified.   
Next possible notification time: Thu Dec 11 12:30:10 2008
[1228980614.724289] [032.0] [pid=3041] 1 contacts were notified.

Configuration file of box which lost connection is as follows:

# Last Modified: Чтв 07 Авг 2008 09:49:06

define host{
         use                     linux-arm
         host_name               arm-dspg
         alias                   ARM DSPG
         address                 192.168.0.12
         notification_options    s,d,u,r,f
         }

define service{
         use                             generic-service
         host_name                       arm-dspg
         service_description             PING
         check_command                   check_ping!100.0,20%!500.0,60%
         }

Finally, message is not received. What's the problem?

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
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