On Mon, Jan 10, 2011 at 8:33 AM, Rajesh Kumar <span dir="ltr"><<a href="mailto:ras.kumar01@gmail.com">ras.kumar01@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font face="Times New Roman" size="3">Hi All</font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><span><font face="Times New Roman" size="3"> </font></span></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>I have installed Nagios Core in my CentOS but not able to configure port based check_http. We are using several port in apache-tomcat in remote server. We can able to configure default port 80. I have to need to configure server port of 8082, 8084 …<span> </span>could you assist me port based configure on nagios. This is my cfg <span> </span>file of check_http.</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"> </font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font face="Times New Roman" size="3">define host{</font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>use<span> </span>linux-server</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>host_name<span> </span>USSERVER</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>alias<span> </span>USSERVER</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>address<span> </span><a href="http://saas-testing.com" target="_blank">saas-testing.com</a></font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>}</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font face="Times New Roman" size="3">define service{</font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>use<span> </span>generic-service</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>host_name<span> </span>USSERVER</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>service_description<span> </span>HTTP</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>check_command<span> </span>check_http</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>check_interval<span> </span>3</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>check_period<span> </span><span> </span>24x7</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>retry_interval<span> </span>2</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>max_check_attempts<span> </span>2</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>notification_interval<span> </span>5</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>notification_period<span> </span>workhours</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>notification_options<span> </span>w,c,u,r</font></font></p>
<p style="margin: 0in 0in 0pt;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span> </span>notifications_enabled<span> </span>1</font></font></p>
<div><span style="font-family: 'Times New Roman'; font-size: 12pt;"><span> </span>}</span></div>
<div><span style="font-family: 'Times New Roman'; font-size: 12pt;"></span> </div>
<div><span style="font-family: 'Times New Roman'; font-size: 12pt;">Regards</span></div>
<div><span style="font-family: 'Times New Roman'; font-size: 12pt;"></span> </div>
<div><span style="font-family: 'Times New Roman'; font-size: 12pt;">B.Rajeshkumar</span></div>
</blockquote></div><br>Your check command definition (which you didn't attach) should look something like:<br><br>define command{<br> command_name check_http<br> command_line $USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$<br>
}<br><br>Then the check_command argument in your service definition, if you were checking port 80, would look like:<br><br><font size="3"><font face="Times New Roman">check_command<span> </span>check_http!80<br>
<br>If you want to check other ports, then you'll have to create a different service for each port you want to check.<br></font></font><br>-- <br>James Moseley<br><br>