Actions code section

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Actions code section

Post by WillemDH »

Just an informative question. Now there is a permissions column in the actions component, what is the use of the code comlumn exactly. Before I used it to replace

Code: Select all

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

Code: Select all

if(is_admin()){$showlink=true;} else{$showlink=false;}
If I only wanted admins to see the actions. What does this first code block exactly do? Can we empty all the code blocks and will the permissions setting work independently?
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Actions code section

Post by tmcdonald »

I would imagine the permissions dropdown was added specifically for this reason, so the code box can be used to do other things. I'll test this out to make sure it is working, but to answer your question directly:
WillemDH wrote:what is the use of the code comlumn exactly
Probably not much use anymore. In my opinion, running any sort of user-supplied PHP code is A Bad Thing, but I think we originally put it in there so custom actions can be defined (and permissions-based code can be run).
Former Nagios employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Actions code section

Post by WillemDH »

Hey Trevor,
Probably not much use anymore.
As the actions overview is getting very crowded over here and as you say
running any sort of user-supplied PHP code is A Bad Thing
I think it would make the actions component easier to read if this unused code column, which takes 1/4th of the screen could be hidable or left out?

Grtz
Nagios XI 5.8.1
https://outsideit.net
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Actions code section

Post by bwallace »

Good suggestion, we've filed a feature request for that = task id:7529. Shall we lock this thread or were there additional questions?
Be sure to check out the Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Actions code section

Post by WillemDH »

Please lock. Thanks!
Nagios XI 5.8.1
https://outsideit.net
Locked