<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="http://schemas.microsoft.com/office/2004/12/omml">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[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>
<!--a:link
{mso-style-priority: 99
;}
span.MSOHYPERLINK
{mso-style-priority: 99
;}
a:visited
{mso-style-priority: 99
;}
span.MSOHYPERLINKFOLLOWED
{mso-style-priority: 99
;}
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal;
font-family:Arial;
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.EmailStyle18
{mso-style-type:personal;
font-family:Calibri;
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal;
font-family:Arial;
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:Arial;
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:1495024673;
mso-list-type:hybrid;
mso-list-template-ids:-1707159126 140641232 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Arial;
mso-fareast-font-family:"Times New Roman";}
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 link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:blue'><span style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>It is
being executed by Nagios not manually.<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:blue'><span style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;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 size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>I would echo the earlier post - add a line
like :</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>echo "I ran" >>
/some/log/file</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'><!-- Converted from text/plain format -->-Matthew</span></font>
<o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<blockquote style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;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 size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>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 size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><font size=2 color="#17365d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#17365D'>Stephen Valdinger<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#17365d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#17365D'>Dover Chemical
Corporation<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#17365d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#17365D'>MIS Helpdesk Guru<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#17365d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#17365D'>330.365.3622<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#17365d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#17365D'>stephen.valdinger@doverchem.com<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>"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 size=2 color="#1f497d" face=Calibri><span
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;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 size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Hi,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>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 size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Any help will be appreciated.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Thanks<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Cem<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><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 size=3 face="Times New Roman"><span style='font-size:
12.0pt'><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>
</body>
</html>