Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update daemons state is not correct (missing daemons) #59

Open
mohierf opened this issue Feb 7, 2017 · 7 comments
Open

Update daemons state is not correct (missing daemons) #59

mohierf opened this issue Feb 7, 2017 · 7 comments
Labels
Milestone

Comments

@mohierf
Copy link
Contributor

mohierf commented Feb 7, 2017

When alignakdaemon is updated, there are several problems:

  1. all the daemons are not considered
  2. some daemons are _sub_realm and some others are not ...

As an example:

[
    {
        "_id": "5894fcbe6376e9aea4223464",
        "_realm": "5894fb9d6376e9aea42231ef",
        "_sub_realm": false,
        "address": "127.0.0.1",
        "alive": true,
        "last_check": 1486462940,
        "name": "scheduler-north",
        "passive": false,
        "port": 17768,
        "reachable": true,
        "spare": false,
        "type": "scheduler"
    },
    {
        "_id": "5894fcbe6376e9aea32233b8",
        "_realm": "5894fb9d6376e9aea42231ef",
        "_sub_realm": false,
        "address": "127.0.0.1",
        "alive": true,
        "last_check": 1486462940,
        "name": "poller-north",
        "passive": false,
        "port": 17771,
        "reachable": true,
        "spare": false,
        "type": "poller"
    },
    {
        "_id": "5894fcbe6376e9aea32233ba",
        "_realm": "5894fb076376e9ab7e669699",
        "_sub_realm": true,
        "address": "127.0.0.1",
        "alive": true,
        "last_check": 1486462940,
        "name": "receiver-master",
        "passive": false,
        "port": 7773,
        "reachable": true,
        "spare": false,
        "type": "receiver"
    },
    {
        "_id": "5894fcbe6376e9aea32233bb",
        "_realm": "5894fb9d6376e9aea42231ef",
        "_sub_realm": true,
        "address": "127.0.0.1",
        "alive": true,
        "last_check": 1486462940,
        "name": "receiver-north",
        "passive": false,
        "port": 17773,
        "reachable": true,
        "spare": false,
        "type": "receiver"
    },
    {
        "_id": "5894fcbe6376e9aea32233bc",
        "_realm": "5894fb9d6376e9aea42231ef",
        "_sub_realm": false,
        "address": "127.0.0.1",
        "alive": true,
        "last_check": 1486462940,
        "name": "broker-north",
        "passive": false,
        "port": 17772,
        "reachable": true,
        "spare": false,
        "type": "broker"
    },
    {
        "_id": "5894fcbe6376e9aea32233bd",
        "_realm": "5894fb076376e9ab7e669699",
        "_sub_realm": true,
        "address": "127.0.0.1",
        "alive": true,
        "last_check": 1486462940,
        "name": "broker-master",
        "passive": false,
        "port": 7772,
        "reachable": true,
        "spare": false,
        "type": "broker"
    }
]

Note missing daemons are: poller-master, scheduler-master, reactionner-master
Note Also note that the arbiter is missing completely.

Relates to #53.

@algorys
Copy link

algorys commented Feb 7, 2017

Seems related to this issue:

e.g.: On demo site:

from alignak_backend_client.client import Backend
backend = Backend('http://demo.alignak.net:6000')
backend.login('northman', 'north')
daemons = backend.get('alignakdaemon')
for daemon in daemons['_items']:
    print(daemon['name'])

will ouput:

arbiter-master
scheduler-north
poller-north
receiver-master
receiver-north
broker-master
broker-north

So Reactionners are missing.

@mohierf mohierf modified the milestone: Version 1.0 Feb 28, 2017
@mohierf
Copy link
Contributor Author

mohierf commented Feb 28, 2017

Fixed with today's alignak merged modifications

@mohierf mohierf closed this as completed Feb 28, 2017
@algorys
Copy link

algorys commented Sep 12, 2017

@mohierf I've tested on demo server and problem persists...

from alignak_backend_client.client import Backend
backend = Backend('http://demo.alignak.net:6000')
backend.login('southman', 'south')
daemons = backend.get('alignakdaemon')
for daemon in daemons['_items']:
    print(daemon['name'])

# Output
scheduler-south
scheduler-south-east
poller-south-east
poller-south
broker-master
broker-south-east
broker-south

Here with southman, Receivers are missing too (so with Arbiters and Reactionners).

@mohierf
Copy link
Contributor Author

mohierf commented Sep 12, 2017

Hmmm ... ok. When the alignakdaemon items are updated most of them are _sub_realm False and some of them are _sub_realm True

For instance the broker-master status is in the realm All and has a _sub_realm=True. As of it, it should be visible from a user located in a sub realm, like the Southman user ... and it is ok!

What drives this _sub_realm property set or unset:

  • If the daemon has an empty realm_name property, and if it only has one realm, the _sub_realm is not set
  • else, the _sub_realm property of the daemon status is set as True if the daemon has the manage_sub_realm property set.

I do not really understand the logic behind this choice 😑 @ddurieux On my own, I would have set this property as True for all the daemons. As such, any user, whatever its realm, is able to see that the whole Alignak daemons are ok or not!

@mohierf mohierf reopened this Sep 12, 2017
@algorys
Copy link

algorys commented Sep 13, 2017

As such, any user, whatever its realm, is able to see that the whole Alignak daemons are ok or not!

I'm agree with that.

@ddurieux
Copy link
Contributor

@mohierf I think _sub_realm sould be true only if the daemons has manage_sub_realms to true

@mohierf
Copy link
Contributor Author

mohierf commented Sep 16, 2017

Ok, you think so, but why? Why restricting the view of the daemons state to the users that are not in the realm? If you do not want to make them visible, how the user can be informed that the monitoring system is well and running ?

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

No branches or pull requests

3 participants