Page 2 of 2

Re: Smart way to configure same service checks for multiple

Posted: Thu Dec 06, 2018 9:01 am
by junkertf
Hello,

I had tried to manage the configuration i wrote in the last days, but i had the difficulties with the instance name passing. The reason is than some servers running multiple instances so i cannot pass free variable at host object side because it will be more than one....

My plan was/is that i create the config so way that i populate with hosts the hostgroups named with the matching instance names only in the everyday operation, and if the instance is moving from other node than i must only switch nodes in hostgroup.

So way i planed to create the service that at service (or template) level any settings is static (or it is coming from some buildt in variable), its mean that the service become the instance name from host/hostgroup variable but because the multi-instance presence on host side these theory is wrong. So i must create only the ammount of checks what i want to monitor/collect performance data.

To clarify i planed the following config
1 hostgroup for every instance i want monitor (calling : HG_INSTANCE) - these count is cca 40 pcs.
1 host running multiple instances, so it is possible that one node goes into N pcs. HG_INSTANCE hostgroup.
M pcs service for monitor metrics (where i somehow (free variable or buildt in standard marco become the instance name from the HG)

I thought that N count of service will be enough for that pourpose and i not need to configure N metrics multiple with M pcs instance service count for that, but currently not found any other choice for that, or i just not goes to the right viewpoint to creating the structure of the service. I am right or is there a more simply way?


Best regards,

Ferenc

Re: Smart way to configure same service checks for multiple

Posted: Thu Dec 06, 2018 1:47 pm
by npolovenko
@junkertf, What if you create duplicate hosts for servers that have multiple instances running(1 host for each instance). Then put each host in a hostgroup corresponding to the instance name. Define the instance name under free variable for each host. Set up services for each metric that use a free variable with the instance name that will get inherited from each host. Assign these services to host groups.

Re: Smart way to configure same service checks for multiple

Posted: Thu Dec 06, 2018 2:51 pm
by junkertf
Hello,

It is possible, but in that case we lost the possiblity to see the services at the original host services.
I think the so way created hosts can be parented or dependent to original hosts, but how about if we migrating/deleting the newly created hosts parent/dependent host to a new host, then we must handle the "cloned" instancenamed hosts also....

So if no other possibility then the last question is which is the more less painfull regarding the configuration size? The more service or the more hosts?

Thank you, best regards,

Ferenc

Re: Smart way to configure same service checks for multiple

Posted: Thu Dec 06, 2018 4:22 pm
by npolovenko
@junkertf
It is possible, but in that case we lost the possiblity to see the services at the original host services.
True, but how would you differentiate which services belong to which instance if they were all under the same host config? It makes sense to have two "duplicate" hosts because that's how you'd know that these are 2 instances with their respective services.

Not sure I understand why you want to create parent-child relationships between duplicate hosts that carry multiple instances? I feel like that would just complicate the setup.
So if no other possibility then the last question is which is the more less painfull regarding the configuration size? The more service or the more hosts?
The configuration will take up the same space. Also, dependencies don't make configuration smaller for Nagios. In the objects.cache/retention.dat file Nagios will "translate" services with assigned hostgroups, and create separate service configs for each host in a hostgroup. This is what will happen "underneath the hood". With that said, I think it will be easier to visualize different instances by having more hosts(duplicate hosts for servers with multiple instances).

Re: Smart way to configure same service checks for multiple

Posted: Fri Dec 07, 2018 4:21 am
by junkertf
Hello,
True, but how would you differentiate which services belong to which instance if they were all under the same host config? It makes sense to have two "duplicate" hosts because that's how you'd know that these are 2 instances with their respective services.
Currently seems no way for it. But it is differrent from the everyday maintenance and service-host-count ammount/configuration architecture complexity viewpoint.

It could be come from hostgroup data's for example $HOSTGROUPNOTES$, but these is hard because the order of the hosts hostgroups these variable is not an asurrance :)

Maybe it can be add a free variable to hostgroups also, then it could be used at service level (like templates)... Actually these would be more nice... and give more latency to the configuration :)
Or it can be a stornger connection bethween the configuration created. For example a caller service hostgroup-data would be preferred..

okay, i arrange the adviceses with the colleagues, come back shortly!

Best regards,

Ferenc

Re: Smart way to configure same service checks for multiple

Posted: Fri Dec 07, 2018 5:13 pm
by npolovenko
@junkertf, Currently hostgroups don't support free variables, but it's a good idea ;).
Sounds good!

Re: Smart way to configure same service checks for multiple

Posted: Mon Dec 10, 2018 7:49 am
by junkertf
Hello,

I had arranged the configuration with the colleague. Currently we will use the solution described by you in mixed way until not possible to use on e constant oppurtunity.

Can you ask the DEV team that the Hostgroup free variable can be buildt in to somewhere in the development tree, and to what version the team can ship the feature?

Thank you, best regards,

Ferenc

Re: Smart way to configure same service checks for multiple

Posted: Mon Dec 10, 2018 10:56 am
by npolovenko
@junkertf, Sure, I can submit this feature request internally or you can open this FR on the Core github page yourself:
https://github.com/NagiosEnterprises/na ... issues/new
That way you could communicate to developers directly.
Either way works fine, let me know.
Thank you.

Re: Smart way to configure same service checks for multiple

Posted: Thu Dec 13, 2018 8:59 am
by junkertf
Hello @npolovenko,

Please raise the feature request internally as we talked about it above!

Thank you! Best regards,

Ferenc

Re: Smart way to configure same service checks for multiple

Posted: Thu Dec 13, 2018 1:12 pm
by npolovenko
@junkertf, Will do. Thanks.