Page 1 of 1
Creating custom component
Posted: Fri Oct 02, 2015 2:29 pm
by BanditBBS
I need to work on something here that would be awesome as a customer component. However, I would want to be very tight on who can see or at least click on the component link. My question is, is there a method when I could say "If member of specified contact group" ? That would be sooooooo awesome if there is a method for me to do that
As I wrote that, I thought of a few methods that I could do to do it, but lets see what someone form nagios may suggest
EDIT: Or, what about a function to see if they have the "can (re)configure hosts and services" like the is_admin() and is_advanced() ones.
Re: Creating custom component
Posted: Mon Oct 05, 2015 10:45 am
by tmcdonald
Definitely a dev question, but the is_authorized_to_configure_service() and is_authorized_to_configure_host() functions are used to determine if the "Re-configure this [host|service]" link is visible. Check in /usr/local/nagiosxi/html/includes/components/xicore/status-object-detail.inc.php.
Re: Creating custom component
Posted: Mon Oct 05, 2015 11:26 am
by jomann
is_contact_member_of_contactgroup($contact, $contactgroup)
returns true/false
Re: Creating custom component
Posted: Mon Oct 05, 2015 12:26 pm
by BanditBBS
jomann wrote:is_contact_member_of_contactgroup($contact, $contactgroup)
returns true/false
That will work awesomely! Thanks, you can close this, WOOHOO!
Are all of these functions documented anywhere for those of us that like to customize?

Re: Creating custom component
Posted: Mon Oct 05, 2015 12:44 pm
by tmcdonald
Not really. The thing is, when people start customizing it gets really hard for us to provide support because we don't know what has been changed, been added, removed, or just outright broken. It's not that we discourage customization officially, we just don't want to encourage it.
Re: Creating custom component
Posted: Mon Oct 05, 2015 12:47 pm
by BanditBBS
tmcdonald wrote:Not really. The thing is, when people start customizing it gets really hard for us to provide support because we don't know what has been changed, been added, removed, or just outright broken. It's not that we discourage customization officially, we just don't want to encourage it.
Yeah, I got ya......my component shouldn't break anything though

Thanks
Re: Creating custom component
Posted: Mon Oct 05, 2015 1:00 pm
by tmcdonald
Lock'd.