<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:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Comic Sans MS";
panose-1:3 15 7 2 3 3 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:933123568;
mso-list-type:hybrid;
mso-list-template-ids:1823478524 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level4
{mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level7
{mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</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>Hi,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>we are in the process of configuring Nagios monitoring tool
in distribution model.<o:p></o:p></p>
<p class=MsoNormal>So I have configured nsca daemon on centrol server and
send_nsca on distributed server.<o:p></o:p></p>
<p class=MsoNormal><b>Versions : Nagios 3.0.3, nsca 2.7.2 – I hope these
are latest versions.<o:p></o:p></b></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>
</span></span><![endif]>Daemon configured fine and listening requests.<o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>
</span></span><![endif]>Send_nsca also working great if I ran stand alone on
distribution server . Example<o:p></o:p></p>
<p class=MsoListParagraph><span style='font-size:10.0pt;font-family:"Courier New"'>./send_nsca
-H 10.1.1.216 -c /usr/local/nagios/etc/send_nsca.cfg abc.baytree.com
'Current Users’ 0 'User count OK’</span><o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>But when I configure ocsp_command is not working. Nagios.log
shows follows<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>============================================<o:p></o:p></p>
<p class=MsoNormal>[1219176254] Warning: Attempting to execute the command
"/usr/local/nagios/libexec/eventhandlers/send_service_check
abc.baytree.com 'Current Users' 0 'USERS OK - 11 users currently logged
in'" resulted in a return code of 127. Make sure the script or
binary you are trying to execute actually exists...<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>===============================================<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Please help me if I am missing anything here.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>My ocsp entries Nagios.cfg – distributed server<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>obsess_over_services=1<o:p></o:p></p>
<p class=MsoNormal>obsess_over_hosts=1<o:p></o:p></p>
<p class=MsoNormal>ocsp_command=send_service_check<o:p></o:p></p>
<p class=MsoNormal>ochp_command=send_host_check<o:p></o:p></p>
<p class=MsoNormal>ocsp_timeout=5<o:p></o:p></p>
<p class=MsoNormal>ochp_timeout=5<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>================================================<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>commands.cfg<o:p></o:p></p>
<p class=MsoNormal>define command{<o:p></o:p></p>
<p class=MsoNormal>command_name
send_service_check<o:p></o:p></p>
<p class=MsoNormal>command_line
$USER1$/eventhandlers/send_service_check $HOSTNAME$ '$SERVICEDESC$'
$SERVICESTATEID$ '$SERVICEOUTPUT$'<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>=======================================================<o:p></o:p></p>
<p class=MsoNormal>Code – Shell script<o:p></o:p></p>
<p class=MsoNormal>/usr/local/nagios/libexec/eventhandles/
send_service_check <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>#!/bin/bash<o:p></o:p></p>
<p class=MsoNormal># Script : send_service_check<o:p></o:p></p>
<p class=MsoNormal>#PRINTF="/usr/bin/printf"<o:p></o:p></p>
<p class=MsoNormal>CMD="/usr/local/nagios/bin/send_nsca"<o:p></o:p></p>
<p class=MsoNormal>CFG="/usr/local/nagios/etc/send_nsca.cfg"<o:p></o:p></p>
<p class=MsoNormal>HOST=$1<o:p></o:p></p>
<p class=MsoNormal>SRV=$2<o:p></o:p></p>
<p class=MsoNormal>RESULT=$3<o:p></o:p></p>
<p class=MsoNormal>OUTPUT=$4<o:p></o:p></p>
<p class=MsoNormal>#<o:p></o:p></p>
<p class=MsoNormal>/bin/echo
"$1","$2","$3","$4" | $CMD -H 10.1.1.216
-c $CFG -d ","<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Comic Sans MS"'>Thank
you</span><span style='font-size:10.0pt;font-family:"Comic Sans MS"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Comic Sans MS";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Comic Sans MS";
color:purple'>Murali Edula</span><span style='font-size:12.0pt;font-family:
"Comic Sans MS";color:purple'><o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>