<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Virtual Services???</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Miguel,</FONT></DIV>
<DIV><FONT face=Arial size=2>I don't think you can effectively do EXACTLY what 
you want within Nagios.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If I understand you correctly and I needed to do 
the same I would do one of the following:</FONT></DIV>
<DIV><FONT face=Arial size=2>- I'd then make server1 dependent on server2, 
server2 dependent on server1, server 3 dependent on server2, etc. The 
behavior might not be exactly what you need but it could suffice.</FONT></DIV>
<DIV><FONT face=Arial size=2>- Create a check_http_cluster service check which 
could be a perl script that executes check_http for each host you specify in an 
argument and then prints out statistics. This wouldn't be a really complicated 
check to write, you'd execute it something like this:</FONT></DIV>
<DIV><FONT face=Arial size=2>    ./check_http_cluster --warn1 
critical2 1.1.1.1,1.1.1.2,1.1.1.3</FONT></DIV>
<DIV><FONT face=Arial size=2>    This would then execute 
check_http on 1.1.1.1, 1.1.1.2 and 1.1.1.3 (you could specify many more ip's 
too) returning its results to check_http_cluster. The warn1 would give a warning 
if there was one or more errors, critical2 would give critical if there were 2 
or more errors.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I don't really think the perl script would be worth 
writing so I'd just use dependencies. There might be a better way... but that's 
how I'd do it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>-Jason</FONT></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=matorres@prisacom.com href="mailto:matorres@prisacom.com">Miguel A. 
  Torres</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=jlancaster@affinity.com 
  href="mailto:jlancaster@affinity.com">Jason Lancaster</A> ; <A 
  title=nagios-users@lists.sourceforge.net 
  href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, May 09, 2003 12:34</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Nagios-users] Virtual 
  Services???</DIV>
  <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003>Hello Jason, </SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003>Thanks for your quickly answer. I think that you 
  don't undertand what I mean by a "virtual service". I`m try to explain it 
  better with a example:</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=037330616-09052003>I 
  have 3 servers with apache:</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><SPAN class=037330616-09052003>
  <DIV><FONT face=Arial color=#0000ff size=2>define host{<BR>  
  host_name <SPAN class=037330616-09052003>server</SPAN><SPAN 
  class=037330616-09052003>1</SPAN></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT face=Arial color=#0000ff 
  size=2>  address <SPAN 
  class=037330616-09052003>1.1.1.1</SPAN><BR>}</FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2> </FONT><SPAN 
  class=037330616-09052003><FONT face=Arial color=#0000ff 
  size=2> </FONT></DIV>
  <DIV>
  <DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial>define host{<BR>  
  host_name <SPAN 
  class=037330616-09052003>server2</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT size=2><FONT face=Arial><FONT 
  color=#0000ff>  address <SPAN 
  class=037330616-09052003>1.1.1.2</SPAN></FONT></FONT><BR><FONT face=Arial 
  color=#0000ff>}</FONT></FONT></DIV>
  <DIV></SPAN><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
  <DIV><SPAN class=037330616-09052003><FONT face=Arial color=#0000ff size=2>
  <DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial>define host{<BR>  
  host_name <SPAN 
  class=037330616-09052003>server3</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT size=2><FONT face=Arial><FONT 
  color=#0000ff>  address <SPAN 
  class=037330616-09052003>1.1.1.3</SPAN></FONT></FONT><BR><FONT face=Arial 
  color=#0000ff>}</FONT></FONT></DIV> ========================</FONT></SPAN><SPAN 
  class=037330616-09052003></DIV>
  <DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial>define <SPAN 
  class=037330616-09052003>service</SPAN>{<BR>  host_name <SPAN 
  class=037330616-09052003>server</SPAN><SPAN 
  class=037330616-09052003>1</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT face=Arial color=#0000ff 
  size=2>  <SPAN class=037330616-09052003>service_description HTTP 
  check</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN>}</FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
  <DIV><SPAN class=037330616-09052003>
  <DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial>define <SPAN 
  class=037330616-09052003>service</SPAN>{<BR>  host_name <SPAN 
  class=037330616-09052003>server2</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT size=2><FONT 
  color=#0000ff><FONT face=Arial>  <SPAN 
  class=037330616-09052003>service_description HTTP 
  check</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT face=Arial color=#0000ff 
  size=2>}</FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2> </FONT><FONT face=Arial 
  color=#0000ff size=2><SPAN class=037330616-09052003> </DIV>
  <DIV>
  <DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial>define <SPAN 
  class=037330616-09052003>service</SPAN>{<BR>  host_name <SPAN 
  class=037330616-09052003>server3</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT size=2><FONT 
  color=#0000ff><FONT face=Arial>  <SPAN 
  class=037330616-09052003>service_description HTTP 
  check</SPAN></FONT></FONT></FONT></DIV>
  <DIV><SPAN class=037330616-09052003></SPAN><FONT face=Arial color=#0000ff 
  size=2>}</FONT></DIV></SPAN></FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003>These services are in diferent hosts and serve 
  the same URL's, they are in balancing. Now I want to define a "virtual host" 
  that group these 3 services. The "virtual host" should be configured with 
  this rules:</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003>    - If only one web server turn to 
  critical state ------> OK</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003>    - If more than one server turn to 
  critical state ------> WARNING</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003>    - If all de web servers 
  turn to critical state ----------> CRITICAL</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=037330616-09052003>I 
  don`t know how to configure the "virtual host" and if it is 
  possible. Note: The "virtual hosts" should not be associated to a host 
  (if it was possible)</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=037330616-09052003>Do 
  you understand what I mean by virtual host now??</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003>thanks a lot.</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=037330616-09052003></SPAN></FONT> </DIV>
  <DIV></SPAN><FONT face=Arial color=#0000ff 
  size=2> </FONT></SPAN></SPAN><FONT face=Tahoma size=2>-----Mensaje 
  original-----<BR><B>De:</B> Jason Lancaster 
  [mailto:jlancaster@affinity.com]<BR><B>Enviado el:</B> viernes, 09 de mayo de 
  2003 17:47<BR><B>Para:</B> Miguel A. Torres; 
  nagios-users@lists.sourceforge.net<BR><B>Asunto:</B> Re: [Nagios-users] 
  Virtual Services???<BR><BR></DIV></DIV></DIV></DIV>
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"></FONT>
    <DIV><FONT face=Arial size=2>I'm not really understanding what you mean by a 
    virtual service. What I was able to get out of this email was that you want 
    to define a service such as check_http to check the same "host" multiple 
    times, for example:</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>define service{</FONT></DIV>
    <DIV><FONT face=Arial size=2>    host_name <A 
    href="http://www.domain.com">www.domain.com</A><BR>    
    service_description HTTP check</FONT></DIV>
    <DIV><FONT face=Arial size=2>}</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>...but have this issue it's results to more 
    than one host. If you try and define that service to check host <A 
    href="http://www.domain.com">www.domain.com</A> twice, you will get an 
    error. Therefore, you need 2 hosts defined in your hosts.cfg 
    like:</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>define host{<BR>  host_name <A 
    href="http://www.domain.com.internal">www.domain.com.internal</A><BR>  
    address 127.0.0.1<BR>}</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV>
    <DIV><FONT face=Arial size=2>define host{<BR>  host_name <A 
    href="http://www.domain.com.virtual">www.domain.com.virtual</A><BR>  
    address 127.0.0.1<BR>}</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>Then define a service to check_http for each of 
    these hosts, and you'll be ok. Just make sure check_http uses the ip address 
    and not the hostname.</FONT></DIV></DIV>
    <DIV><FONT face=Arial size=2>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>define service{</FONT></DIV>
    <DIV><FONT face=Arial size=2>    host_name <A 
    href="http://www.domain.com.internal">www.domain.com.internal</A><BR>    
    service_description HTTP check</FONT></DIV>
    <DIV><FONT face=Arial size=2>}</FONT></DIV>
    <DIV> </DIV>
    <DIV>
    <DIV><FONT face=Arial size=2>define service{</FONT></DIV>
    <DIV><FONT face=Arial size=2>    host_name <A 
    href="http://www.domain.com.virtual">www.domain.com.virtual</A><BR>    
    service_description HTTP check</FONT></DIV>
    <DIV><FONT face=Arial size=2>}</FONT></DIV></DIV></FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>Hope this helps!</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT> </DIV>
    <DIV><FONT face=Arial size=2>-Jason</FONT></DIV>
    <BLOCKQUOTE dir=ltr 
    style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
      <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
      <DIV 
      style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
      <A title=matorres@prisacom.com href="mailto:matorres@prisacom.com">Miguel 
      A. Torres</A> </DIV>
      <DIV style="FONT: 10pt arial"><B>To:</B> <A 
      title=nagios-users@lists.sourceforge.net 
      href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</A> 
      </DIV>
      <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, May 09, 2003 
10:40</DIV>
      <DIV style="FONT: 10pt arial"><B>Subject:</B> [Nagios-users] Virtual 
      Services???</DIV>
      <DIV><BR></DIV><!-- Converted from text/rtf format -->
      <P><FONT face=Arial size=2>Hello,</FONT> </P>
      <P><FONT face=Arial size=2>I'm configuring nagios to monitoring a lot of 
      services. I need to group many services in a "Virtual service" who it is 
      not associated to a host. For example:</FONT></P>
      <P><FONT face=Arial size=2>I have 3 machines with webs servers, so I have 
      configured 3 independent services associated with it`s respective host. 
      Now I want to configure a "virtual service" who include those 3 services. 
      I have been reading all the documentation for nagios and I don`t find how 
      can I make it. </FONT></P>
      <P><FONT face=Arial size=2>My question is:    Is it 
      possible with nagios?</FONT> </P>
      <P><FONT face=Arial size=2>Thanks and excuse my poor english.</FONT> 
    </P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>