[racktables-users] Re: How to handle virtual machine's

On Tue, Feb 3, 2009 at 7:06 AM, Luis Fernando Lacayo
<lflacayo@xxxxxxxxxxxxx> wrote:
> Hey Frank,
>
> If you don't mind sharing how you integrated Nagios to your racktables, I
> would be very interested in hearing how you did that.
>

I also use data in racksheet to generate dhcp and nagios
configuration. I have 2 lame ass python scripts that are doing this.
Nothing fancy in there. To export data out of racksheet
and use it somewhere else the only "intelligence" you need can be
compressed in one or two mysql queries.
For Nagios I do two things (very inneficient :) ) :
1. get a list of hosts that are in some specific racks :
 query=""" SELECT RackObject.id, RackObject.name,
AttributeValue.string_value AS FQDN
                FROM AttributeValue,RackSpace,Rack,RackObject
                        WHERE AttributeValue.object_id=RackObject.id
                          AND AttributeValue.attr_id=3
                          AND RackObject.id=RackSpace.object_id
                          AND RackSpace.rack_id=Rack.id
                          AND ( Rack.name LIKE '_0_' OR Rack.name LIKE
'Virtual%')
                                ORDER BY FQDN

FQDN is a custom field , but you can use just the Object name
depending on your naming scheme.

2. iterate to the resulted host list and pick for each a custom
racksheet field  which maps to a nagios host template

query=""" SELECT Dictionary.dict_value AS NAGIOS_TEMPLATE FROM
Attribute, AttributeValue, Dictionary
                        WHERE AttributeValue.object_id
="""+str(host_list[name]['id'])+"""
                          AND Attribute.attr_id=AttributeValue.attr_id
                          AND Attribute.attr_name='nagios_template'
                          AND AttributeValue.uint_value=Dictionary.dict_key"""

For DHCP I use the following - the constraints are - a host should
have an ethernet interface, should have an IP address, have the the
ethernet interface plugged (linked) into something and it's located in
'x0x' racks ( we name our racks 101, 102 etc. ) :

query=""" SELECT RackObject.name, Port.id,
Port.l2address,AttributeValue.string_value AS FQDN
                FROM IPBonds,Port,AttributeValue,RackSpace,Rack,RackObject
                        WHERE Port.type=24
                          AND IPBonds.type='regular'
                          AND IPBonds.object_id=Port.object_id
                          AND AttributeValue.object_id=IPBonds.object_id
                          AND AttributeValue.attr_id=3
                          AND IPBonds.object_id=RackSpace.object_id
                          AND IPBonds.object_id=RackObject.id
                          AND RackSpace.rack_id=Rack.id
                          AND ( Rack.name LIKE '_0_' OR Rack.name LIKE
'Virtual%')
                          AND  ( SELECT count(*) FROM Link
                                        WHERE porta=Port.id OR
portb=Port.id) > 0
                                GROUP BY Port.l2address
                                ORDER BY IPBonds.ip,FQDN
       """
Hope this helps.

>
>
> On Tue, 2009-02-03 at 15:49 +0100, Frank Altpeter wrote:
>
> Hi there,
>
> on 2009-02-03 at 14:59:46 CET, Luis Fernando Lacayo wrote:
>> Well Said Dennis,
>>
>> But this software is like drugs, you want more and more sooner and
>> sooner...  I am pretty sure that I speak for a good portion of
>> RackTables users when I say that your hard work is very much
>> appreciated.
>
> Just to add my 2 cents, I also appreciate the work on RackTables a lot,
> and I really like that software a lot.
> I implemented RackTables at my previous company with great success,
> covering about 300 servers and managing a /22 IP network with it.
> After changing company about 6 months ago, the first thing I implemented
> here was also the RackTables system, currently with about 200 servers and
> a bunch of /20 networks, and my co-workers (including management) like it
> a lot, since it eases asset management a lot. Because of the clean and
> extensible structure of the RackTables database, I also managed to
> cross-reference and integrate nagios monitoring and bacula backup with our
> RackTables installation for automation based on entered data.
>
>
> So, even if it's a low-prio free-time project, you're doing great work
> here and the community is happy to use it.
>
>
> Le deagh dhùraghd,
>
>       Frank Altpeter
>
> --
> ______________________________________________________
>
> Luis Fernando Lacayo
> Chicago Public Schools
> Senior Unix Administrator
> ITS/ UNIX Infrastructure
> Office: 773-553-3835
> Cell: 773-203-4493
> lflacayo@xxxxxxxxxxxxx
> ______________________________________________________
>                "In God we trust, the rest we monitor ..."
>
>
>

Other related posts: