<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:ns0 =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
font-family: Wingdings;
}
@font-face {
font-family: Tahoma;
}
@font-face {
font-family: Calibri;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
A:link {
mso-style-priority: 99
}
SPAN.MSOHYPERLINK {
mso-style-priority: 99
}
A:visited {
mso-style-priority: 99
}
SPAN.MSOHYPERLINKFOLLOWED {
mso-style-priority: 99
}
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.EmailStyle17 {
FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none; mso-style-type: personal
}
SPAN.EmailStyle18 {
COLOR: #1f497d; FONT-FAMILY: Calibri; mso-style-type: personal
}
SPAN.EmailStyle19 {
FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none; mso-style-type: personal
}
SPAN.EmailStyle21 {
FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none; mso-style-type: personal-reply
}
DIV.Section1 {
page: Section1
}
OL {
MARGIN-BOTTOM: 0cm
}
UL {
MARGIN-BOTTOM: 0cm
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=701293020-07122007><FONT face=Arial
color=#0000ff size=2>When you execute the script from the command line, what
values do you pass for $CONTACTS$, $NOTIFICATIONTYPE$, $HOSTADDRESS$ ?
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=701293020-07122007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=701293020-07122007><FONT face=Arial
color=#0000ff size=2>What happens when you pass null values? Possible that
somehow those are null in your config and the script is puking? Just kind of
musing there.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=701293020-07122007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=701293020-07122007><FONT face=Arial
color=#0000ff size=2>you could also try tuning up nagios debug logging a lot - i
believe that will trap and log the way nagios is calling your script
(??).</FONT></SPAN></DIV>
<DIV> </DIV><!-- Converted from text/plain format -->
<P><FONT size=2>-Matthew</FONT> </P>
<DIV> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
nagios-users-bounces@lists.sourceforge.net
[mailto:nagios-users-bounces@lists.sourceforge.net] <B>On Behalf Of </B>Keles,
Cem<BR><B>Sent:</B> Friday, December 07, 2007 1:28 PM<BR><B>To:</B> Nagios
Users mailinglist<BR><B>Subject:</B> Re: [Nagios-users] notification
command<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Thanks but I’ve tried
this already, no file created unfortunately. I’m sure Nagios doesnt run script
even the notification command is executed.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Yes I thought that
this was a script issue. But please note that this script works fine and sends
mail when executed on command line by Nagios user. So the differences between
command line and Nagios executed script are 2
things:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"><![if !supportLists]><FONT
face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><SPAN
style="mso-list: Ignore">-<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Arial color=blue
size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">It is
being executed by Nagios not manually.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"><![if !supportLists]><FONT
face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><SPAN
style="mso-list: Ignore">-<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face=Arial color=blue
size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I pass
some Nagios values to script as argument like $CONTACTS$, $NOTIFICATIONTYPE$,
$HOSTADDRESS$ etc.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
Boeckman, Matthew [mailto:mboeckman@servicemagic.com] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, December 07, 2007 9:59
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Keles, Cem; Valdinger,
Stephen (DOV, MSX); Nagios Users mailinglist<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [Nagios-users] notification
command</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I would echo the
earlier post - add a line like :</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">echo "I ran" >>
/some/log/file</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">to your wrapper and
something simlair to your PHP script. Sounds much more like an issue in the sh
script or PHP than a nagios issue. </SPAN></FONT><o:p></o:p></P>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></DIV>
<P><FONT face="Times New Roman" size=2><SPAN style="FONT-SIZE: 10pt"><!-- Converted from text/plain format -->-Matthew</SPAN></FONT>
<o:p></o:p></P>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></DIV>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><FONT face=Tahoma
size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
nagios-users-bounces@lists.sourceforge.net
[mailto:nagios-users-bounces@lists.sourceforge.net] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Keles, Cem<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, December 07, 2007 12:59
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Valdinger, Stephen
(DOV, MSX); Nagios Users mailinglist<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [Nagios-users]
notification command</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">In fact I’ve done
this like just in the beginning of script I’m using a /bin/mkdir command but
script doesn’t create this folder when used as nagios command. This means
that nagios never runs the shell script. But in nagios log I see that it is
called just after the state of check is
changed.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
Valdinger, Stephen (DOV, MSX) [mailto:svalding@doverchem.com] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, December 07, 2007 9:33
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Keles, Cem; Nagios
Users mailinglist<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B>
RE: [Nagios-users] notification command</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#1f497d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: Calibri">Php code….is
this launched from the web? Does mail get sent from Nagios typically?
If this is launched from the web, make sure apache has execute rights to the
script as well. <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#1f497d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: Calibri"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face=Calibri color=#17365d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #17365d; FONT-FAMILY: Calibri">Stephen
Valdinger<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#17365d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #17365d; FONT-FAMILY: Calibri">Dover Chemical
Corporation<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#17365d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #17365d; FONT-FAMILY: Calibri">MIS Helpdesk
Guru<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#17365d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #17365d; FONT-FAMILY: Calibri">330.365.3622<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#17365d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #17365d; FONT-FAMILY: Calibri">stephen.valdinger@doverchem.com<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#1f497d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: Calibri"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Calibri color=#1f497d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: Calibri">"If a man says
something in the woods and no woman hears him, is he still
wrong?"<o:p></o:p></SPAN></FONT></P></DIV>
<P class=MsoNormal><FONT face=Calibri color=#1f497d size=2><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: Calibri"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
Keles, Cem [mailto:Cem.Keles@eu.sony.com] <BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, December 07, 2007 2:27
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Nagios Users
mailinglist<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B>
[Nagios-users] notification command<o:p></o:p></SPAN></FONT></P></DIV></DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Hi,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I’ve written a
shell script which is calling a php code and I’m using this shell script as
a notification command.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">It runs fine when
tested on command line executed by both root and nagios user. But if used as
nagios notification command, I cant receive any
mail.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Nagios logs show
command is executed but in mail log I cant see any mail
sent.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Owner of script is
the nagios user. It is being called by /bin/sh, all arguments in it is being
exported. In nagios documentation it tells any command which can be run on
command line can be used as a nagios misc command but I couldn’t succeed
sending mails.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">What do you think
the problem is or in which log I can see why it doesn’t send
mails?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Any help will be
appreciated.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Thanks<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Cem<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><BR>************************************************************************<BR>The
information contained in this message or any of its attachments may be
confidential and is intended for the exclusive use of the addressee(s). Any
disclosure, reproduction, distribution or other dissemination or use of this
communication is strictly prohibited without the express permission of the
sender. The views expressed in this email are those of the individual and
not necessarily those of Sony or Sony affiliated companies. Sony email is
for business use only.<BR><BR>This email and any response may be monitored
by Sony to be in compliance with Sony’s global policies and
standards<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><BR>************************************************************************<BR>The
information contained in this message or any of its attachments may be
confidential and is intended for the exclusive use of the addressee(s). Any
disclosure, reproduction, distribution or other dissemination or use of this
communication is strictly prohibited without the express permission of the
sender. The views expressed in this email are those of the individual and
not necessarily those of Sony or Sony affiliated companies. Sony email is
for business use only.<BR><BR>This email and any response may be monitored
by Sony to be in compliance with Sony’s global policies and
standards<o:p></o:p></SPAN></FONT></P></BLOCKQUOTE></DIV><BR>************************************************************************<BR>The
information contained in this message or any of its attachments may be
confidential and is intended for the exclusive use of the addressee(s). Any
disclosure, reproduction, distribution or other dissemination or use of this
communication is strictly prohibited without the express permission of the
sender. The views expressed in this email are those of the individual and not
necessarily those of Sony or Sony affiliated companies. Sony email is for
business use only.<BR><BR>This email and any response may be monitored by Sony
to be in compliance with Sony’s global policies and
standards<BR></BLOCKQUOTE></BODY></HTML>