Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

agents with conflicting group membership #143

Open
namachieli opened this issue Apr 19, 2017 · 3 comments
Open

agents with conflicting group membership #143

namachieli opened this issue Apr 19, 2017 · 3 comments

Comments

@namachieli
Copy link

Looks like agents that match the criteria for multiple groups (one by subnet, the other by name) will flap between those groups.

You can see below the agent flip-flops between the groups "poc" and "poc2"


toddserver@toddserver$ todd groups
UUID            GROUP NAME
970cd6779780    poc2

toddserver@toddserver$ todd groups
UUID            GROUP NAME
970cd6779780    poc

toddserver@toddserver$ todd groups
UUID            GROUP NAME
970cd6779780    poc2

toddserver@toddserver$ todd objects group
LABEL   TYPE    SPEC
poc2    group   {poc2 [map[within_subnet:10.17.0.0/16]]}
poc     group   {poc [map[hostname:toddclient1]]}

toddserver@toddserver$ todd agents 970cd6779780
Agent UUID:  970cd67797805126393e808f8a9a5615292d06915720060d019299366ea428c8
Expires:  22s
Collector Summary: get_addresses, get_hostname
Facts:
{
    "Addresses": [
        "127.0.0.1",
        "::1",
        "10.17.9.50",
        "fe80::a00:27ff:fe46:e395",
        "172.17.0.1",
        "172.18.0.1",
        "fe80::42:23ff:feec:25ce",
        "fe80::2028:aaff:fe9a:9363",
        "fe80::bcdd:87ff:fe4c:dfd8",
        "fe80::1008:aaff:fe15:8f22",
        "fe80::94b5:55ff:fe92:a369"
    ],
    "Hostname": [
        "toddclient1"
    ]
}

Fix: Preferring a most specific match over a least specific, where hostname is preferred over all. In the case of an exact match conflict (like hostnames in two groups), prefer not changing group membership, requiring the admin to remediate.

Feature Request: Multi-group membership :)

@Mierdin
Copy link
Member

Mierdin commented Apr 19, 2017

Yes, this isn't ideal behavior. I think it's a bug worth looking into, and I gave this the feature request label to also consider multi-group membership, as that's not the current design. In fact, I was considering hierarchical membership before, but that was put on the back burner. Thanks for reporting this!

@namachieli
Copy link
Author

You bet. I'm just discovering this tool, and i expect I will have many more FR/Bug reports :)

Thank you for building this framework, it does (i believe) exactly what i needed with out needing to build the hard part!

@manojkal
Copy link

@Mierdin I am trying to setup todd project on Centos 7. I configured todd agent and todd server. But when i am trying to access todd agents i am getting the below error. Could you please help.

docker run --rm toddproject/todd todd agents
Get http://localhost:8080/v1/agent: dial tcp [::1]:8080: getsockopt: connection refused

Todd Server Log:
DEBU[0010] Loaded assets: map[factcollectors:map[get_addresses:630e6d795ee363e3741e0eba74350645c8ea1896bb1a4cb1c7f18c71fdee6462 get_hostname:e3dd6bd5888c29046bafcf013c258bbc32e4ff3c502a45b1ea5a125894db98a2] testlets:map[http:9bbb9448e6dfa8f0f09c70871f73a1176a3f2f95a3aeae940c3cd0079cbd5426 iperf:ff8ddea702fcf07bbabf3f6e78943d8be339626573931e5dcc5ef1bd8521d134]]
INFO[0010] Beginning group calculation
INFO[0010] Getting /todd/agents' key value
WARN[0010] Agent list empty when queried
INFO[0010] Accessing objects at/todd/objects/group/
WARN[0010] ToDD object store empty when queried
DEBU[0010] Setting '/todd/groupmap' key
INFO[0010] Updated group map in etcd: {}
DEBU[0015] Loaded assets: map[factcollectors:map[get_addresses:630e6d795ee363e3741e0eba74350645c8ea1896bb1a4cb1c7f18c71fdee6462 get_hostname:e3dd6bd5888c29046bafcf013c258bbc32e4ff3c502a45b1ea5a125894db98a2] testlets:map[http:9bbb9448e6dfa8f0f09c70871f73a1176a3f2f95a3aeae940c3cd0079cbd5426 iperf:ff8ddea702fcf07bbabf3f6e78943d8be339626573931e5dcc5ef1bd8521d134]]

Todd Agent logs:
ERRO[0007] Error gathering facts: executing "/opt/todd/agent/assets/factcollectors/get_addresses": fork/exec /opt/todd/agent/assets/factcollectors/get_addresses: exec format error
DEBU[0007] Asset found locally: get_addresses (with hash e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
ERRO[0007] Error gathering facts: executing "/opt/todd/agent/assets/factcollectors/get_addresses": fork/exec /opt/todd/agent/assets/factcollectors/get_addresses: exec format error
DEBU[0007] Asset found locally: get_addresses (with hash e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
ERRO[0007] Error gathering facts: executing "/opt/todd/agent/assets/factcollectors/get_addresses": fork/exec /opt/todd/agent/assets/factcollectors/get_addresses: exec format error
DEBU[0007] Asset found locally: get_addresses (with hash e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
root@9e2a7f79add1:/opt/todd/agent/assets/factcollectors# cd

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants