Page 1 of 1

Empty values in wizards

Posted: Mon Jul 02, 2018 7:49 am
by YannPingot
Hello,

I'm currently facing a blocking issue for my needs in all wizards, the support doesn't have an answer so i'm trying here.

Since i want to use host & services templates to hold variables like check_interval, retry_interval or max_check_attempts, i want them to be empty (set as NULL in database) on the host/service like a manual creation would do in the CCM, but everything i tried put them to 0 instead of nothing.

The only thing i can think off right now is to update manually all values through an SQL request the newly created asset, but i still have to find how to implement that at the end of the wizard (i need this to be transparent for the user), since it's just a big function returning objects... I'd like to have something "clean" for this.

I don't understand why this on not natively supported, as this is a basic thing in Nagios.

I'm open to suggestions !

Thanks,
Yann

Re: Empty values in wizards

Posted: Mon Jul 02, 2018 9:30 am
by tmcdonald
Just to clarify, when you are posting in the forums you have access to the same support team as when you open tickets. We'll have the same answers regardless of where you post, but if you are looking for community feedback it might make more sense to post in the General section so your post gets access to a wider audience. Please let me know if you would like me to move the thread. Otherwise if you want to continue working with support, we would prefer sticking to the ticket so we are not working the same issue from two places.

Re: Empty values in wizards

Posted: Fri Jul 06, 2018 2:11 am
by YannPingot
Yes please move it to the General section then, the goal is to have the community help, since the problem has been mentioned multiple times.

Re: Empty values in wizards

Posted: Fri Jul 06, 2018 9:09 am
by tmcdonald
I've moved the thread and we will leave it open for community involvement. We will continue in the ticket if it is still open.

Re: Empty values in wizards

Posted: Tue Jul 10, 2018 9:28 am
by mcapra
YannPingot wrote: I don't understand why this on not natively supported, as this is a basic thing in Nagios.
My personal attitude towards wizards has always been that they are a very "hands off" way to handle less specific Nagios configurations. For more granular stuff, there's static config files, the REST API, the core config manager, etc.

I think inheriting the intervals from a template is a perfectly sane thing to want, I just don't know how you'd do it without inheriting all the other parts of the template and potentially causing conflicts with the wizard generated config and the templates. There'd need to be significant changes to wizards in general to support templates in a "mutually exclusive" fashion.

If it were my problem to solve, I'd just write a Greasemonkey script for this. You could get extra clever and sync it up with template definitions via the REST API to keep it up-to-date.

Re: Empty values in wizards

Posted: Tue Jul 10, 2018 10:12 am
by YannPingot
Hello mcapra,

The goal is indeed to inherit everything from templates, like it's done when we create hosts and services through the CCM.

After some tries i found something and it seems to be working, in fact not touching these values, i mean not overriding them in the GETSTAGE3OPTS, in the GETOBJECTS switch or anywhere else (except putting real values of course in the object), creates the object with empty values, like we would do manually in the CCM, so the templates ones are taken into account through the compilation.

I've yet to try it with services, but it works on hosts which is a good step.

A greasemonkey script could be a good idea but with tenth of people working on our XI instances it'll be tricky to widespread a script like that, thanks for the idea though.

Re: Empty values in wizards

Posted: Wed Jul 11, 2018 10:55 am
by cdienger
Thanks for the update. Glad you were able to find something that works for you.