Creating custom component

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Creating custom component

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Creating custom component

Post 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.
Former Nagios employee
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Creating custom component

Post by jomann »

is_contact_member_of_contactgroup($contact, $contactgroup)

returns true/false
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Creating custom component

Post 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? :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Creating custom component

Post 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.
Former Nagios employee
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Creating custom component

Post 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
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Creating custom component

Post by tmcdonald »

Lock'd.
Former Nagios employee
Locked