Custom Quick Actions

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Custom Quick Actions

Post by lmiltchev »

I will be testing this as soon as developers finish the task. I am not sure when they are going to get to it, since this is not a priority at the moment. In any case, we will post the results.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Custom Quick Actions

Post by BanditBBS »

I just tested and this worked:

Code: Select all

    786 if(is_admin() == true) {
    787                 // additional actions...
    788                 $cbdata=array(
    789                         "hostname" => $hostname,
    790                         "servicename" => $servicename,
    791                         "service_id" => $service_id,
    792                         "servicestatus_xml" => $xml,
    793                         "actions" => array(),
    794                         );
    795                 do_callbacks(CALLBACK_SERVICE_DETAIL_ACTION_LINK,$cbdata);
    796                 $customactions=grab_array_var($cbdata,"actions",array());
    797                 foreach($customactions as $ca){
    798                         $output.=$ca;
    799                         }
    800                 //$output.=serialize($customactions);
    801
    802                 }
    803                 }
this hides all custom actions on services from non admins. Verified and tested :)
Do the same to the hosts file and it'll work there.
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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Custom Quick Actions

Post by sreinhardt »

Sweet, thanks for the test!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Custom Quick Actions

Post by WillemDH »

Hello,

Just wanted to inquire to the state of this feature request to enable us to set view permissions per task. We have some actions that need to be visible by normal users, and other that may only be seen by admins.

Tx
Nagios XI 5.8.1
https://outsideit.net
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Custom Quick Actions

Post by ssax »

He did leave this comment on the feature request, will that not work for you?
I'm going to see about getting this added but just so you guys are aware, you can add the following into the Code box, it will only show for Admins

Code: Select all

if(is_admin()){$showlink=true;} else{$showlink=false;}
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Custom Quick Actions

Post by WillemDH »

Sean,

Sorry I thought I read in the thread:
this hides all custom actions on services from non admins
So I was thinking this only works for all actions or none. I will try your suggestion.

EDIT: I tried:

Code: Select all

/*if((%objecttype%=='host' && '%hoststateid%'!='0') || (%objecttype%=='service' && '%servicestateid%'!='0')){$img='/nagiosxi/images/schedulecheck.png';$showlink=true;} else{$showlink=false;}if(is_admin()){$showlink=true;} else{$showlink=false;}*/

Code: Select all

/*if((%objecttype%=='host' && '%hoststateid%'!='0') || (%objecttype%=='service' && '%servicestateid%'!='0')){$img='/nagiosxi/images/schedulecheck.png';$showlink=true;} else{$showlink=false;};if(is_admin()){$showlink=true;} else{$showlink=false;}*/

Code: Select all

/*if(is_admin()){$showlink=true;} else{$showlink=false;}*/
But the link to the Reactor chain keeps showing for my test normal user. Am I missing something?

EDIT: Never mind, it was actually just

Code: Select all

if(is_admin()){$showlink=true;} else{$showlink=false;}
My PHP knowledge is very low. Sorry for that. You can close this thread. This solution is perfect for now. :)

Grtz
Nagios XI 5.8.1
https://outsideit.net
Locked