Virtual Services???

Jason Lancaster jlancaster at affinity.com
Fri May 9 21:01:27 CEST 2003


Virtual Services???Miguel,
I don't think you can effectively do EXACTLY what you want within Nagios.

If I understand you correctly and I needed to do the same I would do one of the following:
- 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.
- 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:
    ./check_http_cluster --warn1 critical2 1.1.1.1,1.1.1.2,1.1.1.3
    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.

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.

-Jason
  ----- Original Message ----- 
  From: Miguel A. Torres 
  To: Jason Lancaster ; nagios-users at lists.sourceforge.net 
  Sent: Friday, May 09, 2003 12:34
  Subject: RE: [Nagios-users] Virtual Services???


  Hello Jason, 

  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:

  I have 3 servers with apache:

  define host{
    host_name server1
    address 1.1.1.1
  }
    
  define host{
    host_name server2
    address 1.1.1.2
  }

  define host{
    host_name server3
    address 1.1.1.3
  }
   ========================
  define service{
    host_name server1
    service_description HTTP check
  }

  define service{
    host_name server2
    service_description HTTP check
  }
    
  define service{
    host_name server3
    service_description HTTP check
  }

  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:

      - If only one web server turn to critical state ------> OK
      - If more than one server turn to critical state ------> WARNING
      - If all de web servers turn to critical state ----------> CRITICAL

  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)

  Do you understand what I mean by virtual host now??

  thanks a lot.



   -----Mensaje original-----
  De: Jason Lancaster [mailto:jlancaster at affinity.com]
  Enviado el: viernes, 09 de mayo de 2003 17:47
  Para: Miguel A. Torres; nagios-users at lists.sourceforge.net
  Asunto: Re: [Nagios-users] Virtual Services???


    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:

    define service{
        host_name www.domain.com
        service_description HTTP check
    }

    ...but have this issue it's results to more than one host. If you try and define that service to check host www.domain.com twice, you will get an error. Therefore, you need 2 hosts defined in your hosts.cfg like:

    define host{
      host_name www.domain.com.internal
      address 127.0.0.1
    }

    define host{
      host_name www.domain.com.virtual
      address 127.0.0.1
    }

    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.

    define service{
        host_name www.domain.com.internal
        service_description HTTP check
    }

    define service{
        host_name www.domain.com.virtual
        service_description HTTP check
    }

    Hope this helps!

    -Jason
      ----- Original Message ----- 
      From: Miguel A. Torres 
      To: nagios-users at lists.sourceforge.net 
      Sent: Friday, May 09, 2003 10:40
      Subject: [Nagios-users] Virtual Services???


      Hello, 

      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:

      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. 

      My question is:    Is it possible with nagios? 

      Thanks and excuse my poor english. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20030509/b29b66c2/attachment.html>


More information about the Users mailing list