Custom Quick Actions
Custom Quick Actions
Hello,
Remember I wrote some Powershell script that installs the NSCP Agent on a Windows server? http://support.nagios.com/forum/viewtop ... l&start=10
This is working fine in the meantime, but I have a new issue popping up as we have more and more endusers wanting acces to the Nagios data.
So I made an account with read-only permissions that has only acces to four hosts, but it seems the quick actions that link to the Powershell scripts are also shown for users with read-only permissions. This is really not acceptable, as I don't want endusers to start re-installing NSCP, updating nsclient.ini etc...
Is there a way to prevent my actions to show up in the quick actions of 'users'. Ideally they should only show up on the quick actions of users with admin permissions.
Thanks for any feedback. Let me know if I should make a feature request.
Grtz..
Willem
Remember I wrote some Powershell script that installs the NSCP Agent on a Windows server? http://support.nagios.com/forum/viewtop ... l&start=10
This is working fine in the meantime, but I have a new issue popping up as we have more and more endusers wanting acces to the Nagios data.
So I made an account with read-only permissions that has only acces to four hosts, but it seems the quick actions that link to the Powershell scripts are also shown for users with read-only permissions. This is really not acceptable, as I don't want endusers to start re-installing NSCP, updating nsclient.ini etc...
Is there a way to prevent my actions to show up in the quick actions of 'users'. Ideally they should only show up on the quick actions of users with admin permissions.
Thanks for any feedback. Let me know if I should make a feature request.
Grtz..
Willem
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Custom Quick Actions
It's a good idea for a feature request for the "Actions" component. It would be nice to be able to limit who can view custom actions, based on the user's type, regex filtering, etc. I already filed an internal feature request. You are welcome to file another one on the public site if you wish.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Custom Quick Actions
fully agree this is a needed feature. I have a hack for you WillemDH, look here: http://support.nagios.com/forum/viewtop ... 135#p82915
I did that to remove "disable notifications" but you could put in there the is_admin() or is_advanced_user() and only display something for the advanced users and/or admins.
keep in mind, you will have to redo this "hack" any time you perform an upgrade.
I did that to remove "disable notifications" but you could put in there the is_admin() or is_advanced_user() and only display something for the advanced users and/or admins.
keep in mind, you will have to redo this "hack" any time you perform an upgrade.
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
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
Re: Custom Quick Actions
Feature request made => http://tracker.nagios.com/view.php?id=509
I'll try that Bandit, thanks for the tip.
I'll try that Bandit, thanks for the tip.
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Custom Quick Actions
Thank you for the submission, let us know if the "hack" works out for you in the meantime.
Re: Custom Quick Actions
I updated the internal bug report to include your hack bandit.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Custom Quick Actions
For ajaxhelpers-hoststatus.inc.php I suspect I would need to change the following:
For ajaxhelpers-servicestatus.inc.php
Where exactly should I put is_admin() or is_advanced_user() ?
Code: Select all
$cbdata=array(
"hostname" => $hostname,
"host_id" => $host_id,
"hoststatus_xml" => $xml,
"actions" => array(),
);
do_callbacks(CALLBACK_HOST_DETAIL_ACTION_LINK,$cbdata);
$customactions=grab_array_var($cbdata,"actions",array());
foreach($customactions as $ca){
$output.=$ca;
}
Code: Select all
$cbdata=array(
"hostname" => $hostname,
"servicename" => $servicename,
"service_id" => $service_id,
"servicestatus_xml" => $xml,
"actions" => array(),
);
do_callbacks(CALLBACK_SERVICE_DETAIL_ACTION_LINK,$cbdata);
$customactions=grab_array_var($cbdata,"actions",array());
foreach($customactions as $ca){
$output.=$ca;
}Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Custom Quick Actions
You would wrap an is_admin around there somewhere...but it will affect ALL custom actions.
Something like this:
Make a backup of the file and give it a shot...or better yet, if you have a dev server do it there 
Something like this:
Code: Select all
if is_admin() {
$cbdata=array(
"hostname" => $hostname,
"servicename" => $servicename,
"service_id" => $service_id,
"servicestatus_xml" => $xml,
"actions" => array(),
);
do_callbacks(CALLBACK_SERVICE_DETAIL_ACTION_LINK,$cbdata);
$customactions=grab_array_var($cbdata,"actions",array());
foreach($customactions as $ca){
$output.=$ca;
}
}
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
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
Re: Custom Quick Actions
We will do some testing on our end and will keep you posted.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Custom Quick Actions
Well I still didn't find the time to setup a test server
I fear it will take some time before I can find some time.
But I'll wait for the results of the test by lmitchev..
Grtz..
But I'll wait for the results of the test by lmitchev..
Grtz..
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net