<html>
<head>
</head>
<body>
Save yourself more clutter:<br>
<br>
define command {<br>
    command_name    check_http_port<br>
    command_line       $USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$<br>
}<br>
<br>
then in your service definitions, the check_command line can be:<br>
    check_command    check_http_port!80<br>
or<br>
    check_command    check_http_port!8000<br>
<br>
or whatever port you want to check.  Now you only have one entry in the checkcommands.cfg
and the same number of entries you would have in the services.cfg.<br>
<br>
-Russell<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:8lb4fmllhm001@sneakemail.com">8lb4fmllhm001@sneakemail.com</a> wrote:<br>
<blockquote type="cite" cite="mid:666418513.1029948492464.JavaMail.root@monkey">
  <pre wrap="">Max, you're making it unnecessarily hard on yourself.<br><br>What you need to do is tweak the checkcommands.cfg to allow you to poke at different http ports.  You tweak services.cfg to leverage these new definitions.  Take a look at what I'm doing, as a baseline.<br><br>In my checkcommands.cfg:<br><br># 'check_http' command definition<br>define command{<br>        command_name    check_http<br>        command_line    $USER1$/check_http -H $HOSTADDRESS$<br>        }<br><br># 'check_http_8000' command definition<br>define command{<br>        command_name    check_http_8000<br>        command_line    $USER1$/check_http -H $HOSTADDRESS$ -p 8000<br>        }<br><br># 'check_http_8080' command definition<br>define command{<br>        command_name    check_http_8080<br>        command_line    $USER1$/check_http -H $HOSTADDRESS$ -p 8080<br>        }<br><br>And in my services.cfg:<br><br>define service{<br>        name                            icmp<br>        use     

                        generic-service<br>        service_description             PING<br>        is_volatile                     0<br>        check_period                    24x7<br>        max_check_attempts              3<br>        normal_check_interval           5<br>        retry_check_interval            1<br>        notification_interval           60<br>        notification_period             24x7<br>        notification_options            c,r<br>        check_command                   check_ping!100.0,20%!500.0,60%<br>        register                        0<br>        }<br><br>define service{<br>        name                            http<br>        use                             icmp<br>        service_description             HTTP<br>        notification_options            w,u,c,r<br>        check_command                   check_http<br>        register                        0<br>        }<br><br>define service{<br>        name                            http_

8000<br>        use                             http<br>        service_description             HTTP_8000<br>        notification_options            w,u,c,r<br>        check_command                   check_http_8000<br>        register                        0<br>        }<br><br>define service{<br>        name                            http_8080<br>        use                             http<br>        service_description             HTTP_8080<br>        notification_options            w,u,c,r<br>        check_command                   check_http_8080<br>        register                        0<br>        }<br><br>And further down in services.cfg:<br><br>define service{<br>        host_name                       host1,host7<br>        use                             http<br>        contact_groups                  unix-admins<br>        }<br><br>define service{<br>        host_name                       host2,host8,host9<br>        use                             http_8000

<br>        contact_groups                  linux-admins<br>        }<br><br>define service{<br>        host_name                       host3,host10<br>        use                             http_8080<br>        contact_groups                  unix-admins<br>        }<br><br>(Hostnames changed, just cuz.)<br><br>Does this help?  This should save you *lots* of clutter.<br><br>Bonus:  If you use hostgroups, you can save more keystrokes by specifying "hostgroup_name" and the name(s) of the hostgroup(s) instead of using "host_name" with a long list of hosts.  (You'll need to have that defined in hostgroups.cfg first.)<br><br><br>Max Clark wrote:<br></pre>
  <blockquote type="cite">
    <pre wrap="">I am a brand new nagios user and so far have been able to <br>configure and<br>use the program without too much difficulty. I am trying to configure<br>http service checks for a series of virtual hosts on my web servers.<br>What is the best way to do this?<br><br>From my understanding I need to create a host, customize the <br>check_http<br>in check commands like (create check_http_vhost1 - check_http -H<br><a class="moz-txt-link-abbreviated" href="http://www.host1.com">www.host1.com</a>, check_http_vhost2 - check_http -H <br><a class="moz-txt-link-abbreviated" href="http://www.host2.com">www.host2.com</a>, etc...),<br>and define services where I correlate the service to the host.<br><br>Is there a better way to do this?<br></pre>
    </blockquote>
    <pre wrap=""><!----><br><br>-----------------------------------------------------<br>Protect yourself from spam, use <a class="moz-txt-link-freetext" href="http://sneakemail.com">http://sneakemail.com</a><br><br><br>-------------------------------------------------------<br>This sf.net email is sponsored by: OSDN - Tired of that same old<br>cell phone?  Get a new here for FREE!<br><a class="moz-txt-link-freetext" href="https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390">https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390</a><br>_______________________________________________<br>Nagios-users mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br><a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br><br><br></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="$mailwrapcol">-- 
Russell Scibetti
Quadrix Solutions, Inc.
<a class="moz-txt-link-freetext" href="http://www.quadrix.com">http://www.quadrix.com</a>
(732) 235-2335, ext. 7038
</pre>
    <br>
    </body>
    </html>