Few days ago I wrote about Agents in OBIEE 12c and how it was possible to enable them by script, automating that part of the process which was still manual.
This time I’m going to write about 2 examples of how I used my findings about Agents, providing the code as download so you can use it in just few seconds.
Two use cases as example
Today I’m going to cover two possible needs with Agents, one mainly for upgrades or code promotion between environments and the second to provide a functionality to the consumers of your OBIEE dashboards and analysis.
- Execute an agent from a dashboard page / analysis
- Mass enabling in one step of Agents
(Code is provided, feel free to look at it and adapt or use it as you want)
All the tests and analysis have been done on OBIEE 12.2.1.2.0.
The libraries are probably the same for the previous OBIEE 12c releases and will also work, with some little adjustments for OBIEE 11g (11.1.1.7, 11.1.1.9) as the main javascript libraries are the same.Keep in mind jQuery wasn’t there in OBIEE 11g, so that’s the main change required.
Mass enabling of Agents in one step
In a running prod OBIEE you can easily have tens or hundreds of Agents: nothing bad with this, they provide functionalities for the consumers. But what happen when you upgrade your old PROD OBIEE 11g to OBIEE 12c? What happen to the Agents?
Well … the Agents end up on the new system but … all disabled ! Now have fun going through the full catalog, finding out which Agents must be enabled and enable them again one by one, by hand.
Not funny at all without forgetting the risk of missing some and have your consumers complaining your upgrade is actually a regression.
Stop fearing your next upgrade, you can enable all your Agents with few clicks from a single page.
As seen in previous post the OBIEE front-end catalog page uses a lot of javascript to interact with Agents, to enable them. So I put together some javascript code to use these OBIEE libraries to make my (and your) life easier.
Download the OBIEE catalog archive with the dashboard and code
The process to deploy and use this dashboard page is really simple:
- In your OBIEE instance go in the Catalog and create a new empty folder (to avoid issues in case you have a dashboard with the same exact name of the one in the file already). Can be your personal folder or the shared folder, works in both places, the path doesn’t matter.
- Download the file (a catalog archive) and unarchive (first unzip, then OBIEE unarchive) inside the newly create folder.
- Open the imported dashboard named “Manage Agents”
- When the page open, it searches the Agents in the catalog and display a list of them (can take some seconds if you have lot of them)
- Select the Agents you want to enable (or all of them using the “check all” link) and click the button. If you are sure confirm.
- The javascript OBIEE libraries are doing the work now, the logs show you what’s happening in the background. Once done the list of Agents is reloaded with the new status (if enabled the checkbox isn’t active anymore).
Done ! You can now enable lot of Agents at once.
If the page doesn’t work or take too long to load the list of Agents have a look at your browser console, it gives some output faster than the log box on screen.
How does it work?
The page is a normal dashboard page with “Text” elements containing some javascript and HTML.
It uses the embedded jQuery in OBIEE 12c to manage everything: load the required files, actions on checkboxes and button, output to screen.
Completely uses the OBIEE javascript libraries, so it does exactly what the Catalog does, nothing else. There are just 2 methods which are overwritten as they can’t work outside the Catalog (to handle the result and update available actions on an Agent).
Feel free to take the code and change it as you want, you can easily add a disable action too. Something you will maybe want to do is to customize the search of Agents in the catalog by defining a specific path and pattern for names.
1 |
$.post('/analytics/saw.dll?CatalogTreeModel', {action: "search", path: "/", mask: "*", recurse: "t", sig: "coibot1", _scid: obips_scid}, function(data){ |
You can adjust the value of “path” and “mask” as you want, even add them on screen as text field for a more interactive experience.
All my tests and development have been done on a OBIEE 12.2.1.2.0 but the catalog file must be fine for other 12c versions too. For 11g you will have to adapt things as jQuery isn’t there by default even if the OBIEE javascript functions are probably (tested a bit) 95-100% identical.
I have enabled 102 Agents at once using this script: the page become unresponsive at the beginning when things are running but just leave it there, few minutes later all the Agents were enabled!
Important note: permissions & privileges
As this script does exactly what happen when you click one by one in the catalog the same limitations apply. If your users don’t have the required permissions on the catalog to access the Agents or to enable them this script will not bypass these limitations. It uses the privileges of your current session, so it’s advised to use it with an admin-like account.
Execute an Agent from a dashboard page or an analysis
Sometimes you want to allow your consumers to execute an Agent, run it immediately, from a dashboard page or an analysis. For example if you have somebody in charge of validation of some data/analysis before to send it out to a wider audience.
The approval can be done visually using a dashboard or an analysis, and then to send out the data/analysis you can use an Agent setup without schedule and containing the full list of people, so you find it in the Catalog and click on “Run” directly.
Wouldn’t it be better if you could have a button directly on the validation dashboard page?
Good news again: doable with a really small piece of code.
All you need is a text object with the required code inside.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<script> $( document ).ready(function() { // find the path to be used to load OBI javascript files jqueryPath = $("script[src*='jquery']").first().attr('src'); var loadPath = jqueryPath.substring(0, jqueryPath.split('/', 3).join('/').length); // load the required scripts $.when( $.getScript(loadPath+'/delivers/obide.ServerRequests.js'), $.getScript(loadPath+'/deliversShared/obids.AjaxRequest.js') ).done(function(){ // when loading is done enable the button $('#runAgent').prop('disabled', false); // when the button is clicked => execute the agent $('#runAgent').click(function(){ // create required base objects var a = saw.catalogaction; var ibotHandler = new a.IbotsActionHandler(); // set agent path ibotHandler.tItemInfo = {'path': '/shared/Example agents/Test Agent 01'}; // this is optional but avoid a javascript error after execution (load info about the agent) ibotHandler.retrieveIBotInfo(); // execute the agent ibotHandler.runIBot(ibotHandler.tItemInfo.path); }); }); }); </script> <p>If you want to execute the Agent /shared/Example agents/Test Agent 01 click the button:</p> <button id="runAgent" disabled="disabled">Run Agent</button> |
In this code the path to the Agent is hardcoded, you can definitely change it or make it smarter (a generic event handler reading the path from an attribute of the button HTML tag). Can be executed by a link or anything else as long as it can be triggered in a way or another.
Important note: permissions & privileges
As this script does exactly what happen when you click “Run” in the Catalog the same limitations apply. If your users don’t have the required permissions on the catalog to access the Agent or to run it, this script will not bypass these limitations. It uses the privileges of your current session.
Final word
As you saw in the above examples a lot is doable. OBIEE is a web application which means you can easily hack pieces and reuses its own libraries for your needs.
If you want to see the details of other actions available on Agents find the actionhandlerimpl.js file on your OBIEE instance (you will find the same file few times) and look inside. If you check the saw.catalogaction.IbotsActionHandler.prototype.handleAction function you see all the actions available in the Catalog for Agents and the same file has details on actions on other kind of objects.
Do not abuse it! If you end up recoding half of the UI you maybe chose the wrong tool for the job.
If it doesn’t work … that’s life: look at the code, analyse what happen, compare with the actual OBIEE native javascript, debug by adding logging and breakpoints.
Feel free to post a comment if you have issues using the code in 12.2.1.0.0 or 12.2.1.1.0, I can easily have a look at those versions, for 11g it’s a bit more difficult as I don’t have environments easily accessible.
Hi,
Great post and solution. Thanks!
I am trying to use your code but it looks stuck (loading…)
Looking at the console provides the error : unexpected token = ( saw.dll line 228).
Also, looks like the functions do not load to the page.
Are you familier with that problem?
Thanks again
Tal
What version of OBIEE are you using?
Hi, I am using 12.2.1.3.0 and face the same problem. Can you please help?
There is nothing hidden, it’s just a piece of javascript. Look at your browser console and you are supposed to see what’s going on.
I’m sure you easily understand it’s quite difficult to help with something I don’t see or have.
Hi,
Is there any way, can you show us to implement the same in 11.1.1.7
Thanks,
Pre
Hi,
Have a look at this thread on the OTN forum: https://community.oracle.com/thread/4023366
You find an example of the code to execute an agent from a button.
As said the main issue is 11g doesn’t have jQuery, a library making the handling of things a lot easier. But the OBIEE libraries are the same (or almost identical).
Thank you for the input.It is still not enabling the option to run the agent.
Do we need to run any scripts other than mentioned in the solution.
Appreciate any inputs!
Thanks,
Pre
Perfectly worked like that quite a lot of times for me. So what you can do is look at the console of your browser and debug it from there, calling functions by hand to see if they are there and all the files loaded etc.
Hi Gianni,
it works in the OBIEE 12.2.1.2.0 without any problems. Thank you for this solution – it’s very useful!
I have a question: Your script returns agents only from “Shared Folders” (/shared/*). Is possible to get all agents – even from “User Folders” (/users/*)?
Thank you.
Petr
Hi Petr,
The script actually search in shared folders and the “my folder” of the connected user. If you look at the script you see the search uses the param “path: /” and not “path: /shared”.
The problem is that security is applied, and from the front-end of OBIEE you can’t navigate to other users folders, you have access only to your own “my folder”.
You can maybe use Catalog Manager (the client installed next to Admin tool), that one can search at a different level and also into /users folders as long as you have the right permissions.
But even by taking a list of objects from there the script will hang because when retrieving the agents details the security will kick in.
OK, I’ll try to use the Catalog Manager. Gianni, thank you for your the next recommendation.
Did you find a way to search in user folders? We were having issues at first even getting this to work, but we think that either custom analyticsRes or SSO were blocking it. However, this only brings back shared folders and we have no idea how many user report agents exist.
Users folders are protected by security: only the owner can look inside and do things there. And actually the users folders aren’t at all exposed in the tool as only the “my folder” is accessible. So you could search into “my folder”, but you would need to login with every single user to go over the various person folders.
To find how many agents are into users folders you can use Catalog Manager as he has a wider access to things.
Hi Gianni,
I’m using OBIEE 12.2.1.2.0
I have similar requirement like to show and run agent from my dashboard.I have hard coded my agent path in the above script. But when click on run button on my dashboard throwing below error.
“Could not open Agent. If you are expecting to have access to this Agent, please contact your Administrator.”
do we need to set any configuration here? please suggest.
Hi,
No config is needed but you must be allowed to run the agent. So standard permission model apply and any user wanting to click the button must have the same privileges if doing that in the catalog itself.
Thanks for response…
I have given full control permission for consumers and administrators roles on my agent in catalog, but still getting above error.
Apparently that’s not what OBIEE sees. Can you go in the catalog and run it from there?
I can able to run the agent successfully from my catalog folder, no issues.
error on dashboard:
“Could not open Agent. If you are expecting to have access to this Agent, please contact your Administrator.”
So it seems an access issue.
i had created a dashboard page and copy the scripts from manage agent to another dashboard page same i had taken text1, text2 text3,text4 but the result is showing same script which i copy and paste in dashboard could you please help me
Not sure I get exactly what your issue is: you copied the content of the page you got from the blog post into another page. But instead of having the working thing you see the code on screen? Did you check the checkbox “HTML”? Are you sure you copied the full content of the text blocks without losing (breaking) HTML tags around? Greetings to Oracle 😉
when i download and archive its working fine.but when i copied the scripts from manage agents dashboard page to another dashboard page in 12c its not working can u help me on this
could you please check in obiee forums which i had posted https://community.oracle.com/message/14584963#14584963
And the answer is what I said yesterday already: you have to check the “HTML” checkbox for the text block. In 12.2.1.3 Oracle added an extra security disabling HTML everywhere, so you have to enable it. That’s what Michael posted on the ODC thread.
It works perfectly in my system. I was able to execute an agent from the dashboard page. My question is how have you found this script ? Is this something present ? I can see ServerRequests.JS and AjaxRequest.js in my OBIEE environment. If we want to develop or modify scripts like this what is the starting point would you suggest ?
First: I would highly suggest you never edit a default file of OBIEE but create your own customization (so it has more chances to survive upgrades and patches). How I have found it? I looked for it. OBIEE is a web application, as such everything happening can be analysed using your browser and in that way you manage to find the right functions and how to call them. Just make sure to analyze enough how things are done by OBIEE so your customization will be aligned with it and aren’t going to introduce errors OBIEE itself would avoid.
Okay, Thank you !
Hello,
This is works good and will be very handy when we roll out OBIEE 12c. It seems to be limited to locating/listing 300 Agents. I see the truncated=yes in the log messages. I don’t see a limit set in your code. Do you where this limit is set so that we can locate and list more than 300 Agents?
Thank-you!
Hi,
The limit of 300 is the limit you get in searching for objects in the catalog page.
I didn’t hit but there are 2 settings for the BI Presentation service which can maybe increase that limit:
– MaxSearchResultItemsToReturn
– ManageCatalogMaxItemsPerPage
They are both set by default to 300 and do not have a description giving more details on their real impact, but the names seems to match.
They need to be set in the OBIPS config file inside WebConfig/ServerInstance/UI.
Again: I didn’t test it, so can’t confirm it’s the thing you look for …
Gianni,
Thank you so much. It was the ‘MaxSearchResultItemsToReturn’ XML tag. I set it to 1000 and I get the complete list of Agents now. I thought I would reply back in case anyone else ran into this.
Is it possible to open a Create Ibot Webpage with all the information like analysis, subject etc pre-filled?
I would say you can’t … Replied on the ODC thread too. There are too many information required by an agent, so it’s kind of difficult to pass them as parameters. You can for sure create objects by scripts (webservices etc.) but it’s a different thing.
Excellent utility, saved our project a lot of time, many thanks!!!
Hi Gianni,
I’m using OBIEE 12.2.1.2.0
I have similar requirement like to show and run agent from my dashboard.I have hard coded my agent path in the above script. But when click on run button on my dashboard throwing below error.
“Could not open Agent. If you are expecting to have access to this Agent, please contact your Administrator.”
do we need to set any configuration here? please suggest.
Can you open the catalog, navigate till the agent and click on “Run” there? There privileges required are the same as the code is exactly the same in the background. So check that …
Thanks Gianni,
Great stuff, We could easily adapt the code so it also features disabling agents. Real timesaver.
You are welcome Martin.
And yes, you could easily do many other things “at once” on many/all the agents…
Hi Gianni,
Thanks for wonderful post. Our environment is obiee12c running on RHEL. We are triggering scheduled agent to show figures in a map which is sent as pdf attachment. Issue is after triggering agent pdf does not display map. Please guide & help us.
Hi, I imagine the problem doesn’t happen only when using the trick to execute the agent from a button in the page but more generic: you never have the map in the PDF, right?
If it’s the case, you better open a thread in the Oracle public forum, where you will be able to post more details about the environment, versions etc. and describe in detail the issue.
Can we hide the execution dialogue box, when the ibot is running
In theory everything is possible, it’s a webpage in the end, so you can hide everything you want. In practice I wouldn’t put my hands there. Too many risks to break other things, so not worth the effort I would say.
Gianni, This is really a great post, It worked for me perfectly, it solved my primary purpose of requirement. Did you try passing the filter values to the agent. For example i will have to send/run agent for only “Stockplus Inc” company. Please let me know if we can implement it. Thanks
This script is really just about mass enabling agents in a context of a migration. When the analysis you send by an agent has filters you are prompted for the values to set for the filters at that time and those values are saved into the agent. So if you want to change the value and set it as “Stockplus Inc” you will need to edit the agent and set that value, save the agent and then run it. You can still do all that by code (webservices to edit content of saved objects exists), but it’s a multi-steps process.
When trying to display the agents list, and looking at the console browser, I am seeing the following:
Object { readyState: 4, getResponseHeader: .ajax/cj.getResponseHeader(), getAllResponseHeaders: .ajax/cj.getAllResponseHeaders(), setRequestHeader: .ajax/cj.setRequestHeader(), overrideMimeType: .ajax/cj.overrideMimeType(), statusCode: .ajax/cj.statusCode(), abort: .ajax/cj.abort(), state: .Deferred/b7.state(), always: .Deferred/b7.always(), then: .Deferred/b7.then(), 11 more… } saw.dll:326:4
error saw.dll:327:4
Not Found saw.dll:328:4
something went wrong …
Any ideas?
Hi, can you tell me which version you are using? And also if how does the URL of your OBIEE looks like in general? (protocol, port etc.).
Of course we agree you can do a search for agents in the catalog with the user you are connected, right?
Hi there
We are on version 12.2.1.3. The URL of OBIEE is host:port/analytics/saw.dll
The user that is searching should be able to view the agents as they are able to access the root of the catalog using the client tool.
If in the web UI you open the catalog and do a search there for agents, does it work? Having access to the root of the catalog doesn’t mean the user can access other folders and search. The script just use that search you have in the web UI, nothing hidden. I will test it on a 12.2.1.3 but I would imagine nothing really changed in what the script uses in that version.
Just tested on 12.2.1.3 on linux and works just fine. So the source of the error you got is somewhere else and not related to the version.
As i am new to this,can you also guide me how to add disable feature.Where in code i need to make changes
I would say that you have good chances by replacing the call to “enableIBotSchedule” by a call to “disableIBotSchedule”. They seem to have the same parameters and so it would be enough. Of couse you also need to edit the logic around as, for now, it do everything to not enable an agent already enabled. But it’s all in the javascript and there are comments around.
Hi Gianni,
Regarding the button for Execute an Agent from a dashboard page, I have this button in production which is used to invoke one Agent and that Master agent has multiple agent to invoke which is causing some issue and server overload. So I am searching for option where I can put a condition where ibotHandler.runIBot(ibotHandler.tItemInfo.path); will not run till it is after 5 PM EST and if I can add multiple agent run instruction in this script to run in specific interval. Please suggest !
Hi,
If by “will not run till it is after 5PM EST” you mean to not allow people to click till after that time, this is easy to do as javascript can know what it is and therefor have a condition before to call the agent based on that. If you mean that you click the button and you want to keep the execution “on wait” till it’s 5PM this is a different story and you look more for a scheduler than a button to run an agent from the front-end.
Being a javascript based thing, you can add various agents to run at different intervals, but it would mean to keep the page open and hope the browser will not kill the script after a while. IMHO you need to implement a different solution, something which would be based on standard agents schedules to run at a fixed time every day mixed with a conditions to know if somebody wanted the agents to be executed. The condition could be a row entered in a table from the front-end (write-back, APEX etc.) or things like that.
Thanks Gianni for the reply.
Actually there is a validation report where Business will validate the current monthly data and after validation click the button to execute all the agents. But they can click the button any time during the day.
So I want to keep the execution “on wait” till it’s 5PM.
In this way they will invoke the process of Agent execution but it will only run after 5 PM. There are multiple Agents also so if possible I can put a wait time in between those Agents.
So for that, as said, you can use default agents behaviour: schedule your agents from 5PM on with the intervals you need (based on your guess on exec time or load or looking at past executions etc.).
The agents will run daily or at the required higher frequency and you add to each one a condition to decide if they really need to run or not. If you don’t want to the schedule all of them you can chain them: not one agent calling all the others but a real chain, one calling another one etc.
The condition can be a very simple check if there is a row matching a criteria in a table. That row can be inserted by your users via the front-end using write back for example, your condition will check if there is a row matching the current day (so you don’t need to delete inserted rows after execution).
Will match your needs and all done with out of the box feature of OBIEE.
Hi Gianni,
We are using OBIEE version: 12.2.1.0.0.
During import of ManageAgent.catalog we are getting this error:
Incompatible version when reading object “CatalogInputStreamer”.
Version read: 16, min expected: 11, max expected: 15.
Any chance you can publish / offer version compatible with OBIEE 12.2.1.0.0 ?
Thanks
Joanna
Hi Joanna,
12.2.1.0.0? Wow, you are brave 😀
This thing is out of support for more than a year now and, being the very first release, is full of bugs. What about planning an upgrade to a supported / recent version?
Great blog Gianni.. Thanks
I am using 11.1.1.7. ‘Run Agent’ button is still grayed out. Even I enabled all my agents and put correct path.
As said above the code is quite similar for 11g, you need to get jQuery in the page first. You find a working piece of code I did randomly as test on a 11g at the following link: https://community.oracle.com/message/14270797#14270797 (you need an Oracle Login with access to MOS to be able to see it as it’s part of a MOSC thread)
Ideally you deploy jQuery in your server inside your custom style, you load it in the page and just take things from there. There code between 12c and 11g is 99% the same based on what I posted in that forum 2 years ago.
Hello Gianni,
I have a request where I need to allow user to modify/update the email recipients on their own. We cannot provide access to edit and update the agent instead we are looking for similar page where it would list the all email recipients against each agent.
Could you provide any suggestion.
Hi, the recipients can be explicit and in this case they are saved into the agent itself, you find them in the XML. There are methods to get the XML of the agent, there is maybe even a function in JS to get directly the recipients but you would need to explore a bit the libraries, otherwise just parse the XML and get what you need out.
The other way for an agent to get recipients is by getting them into the analysis used as condition, so this one would require more works and to execute the analysis to get the recipients.
In the end the point is that everything is possible, but it’s up to you to evaluate if the work required is work the result. Also don’t forget security: users would need to be able to access agents as the page isn’t static, it uses the connected user privileges to do the job.
WIll it work in this version as well 12.2.1.4.0 (Build BIPS-20180409020153 64-bit) ?
As in its keep on saying loading object?
Didn’t test on .4, but I would say it must work. What do you have if you search for agents in the catalog? Anything more useful in the console?
I am searching it thru Advanced search option and giving below values
Search:**
Location: Shared Folder
TYpe: Agent
It keep on saying loading for me…but never list down the agents..running in this version: 12.2.1.4.0 (Build BIPS-20180409020153 64-bit) ?.
Did you try to look at the browser’s console? It must tell you what’s going on there, if you see the calls in the background or not, what comes back etc.
I just tested on a clean 12.2.1.4 (no bundle patch) and it works without issues.
Therefore can’t really say anything without seeing the issue and being able to debug it.
This is hang on loading … in 12.2.1.4.0 (Build BIPS-20180409020153 64-bit) version, when check on console, nothing is displayed.
Any recommend browser?
Thanks
I just tested on a clean 12.2.1.4 (no bundle patch) and it works without issues.
Therefore can’t really say anything without seeing the issue and being able to debug it.
I want to include browser script actions in OBIEE 12c Action Framework and I modified the Userscript.js as per the instructions here
https://www.rittmanmead.com/blog/2012/07/navigating-to-bi-content-in-obiee11g-and-passing-multiple-parameters/
However, Even after restarting presentation services, I wasn’t able to see this browser action available on my dashboard. Are there any steps that I missed out? Any suggestions?
Thanks
Hi, as it isn’t really possible to figure out what’s happening in comments of a post about something else, the best is if you post the question in https://community.oracle.com, more specifically in https://community.oracle.com/community/groundbreakers/business_intelligence/business_intelligence_foundation/business_intelligence_suite_enterprise_edition. We are waiting for your thread.
Hi Gianni,
I am working OBIEE 12.2.1.4 to migrate from 12.2.1.2 .
I didn’t created dashboard named “Manage Agents” and how can import ?
Thanks,
Prakash
Hi,
I’m not sure to understand…
First a 12.2.1.2 to 12.2.1.4 upgrade doesn’t require to move any content on the OBIEE side and therefore doesn’t disable agents. You replace binaries, update the domain and done: from an OBIEE content point of view it’s like an in-place upgrade.
The dashboard you mention is just a sample you find in the catalog archive linked in the blog post. You can download that archive and unarchive it into your OBIEE catalog and there you find that dashboard.
HI Gianni,
I do not see data in S_NQ_JOB and S_NQ_JOB_PARAM .
What to replace binaries, update the domain ..
Thanks,
Prakash
This is a bit “generic”: no data maybe because you don’t have any agent registered?
I prefer to not go into how to upgrade from .2 to .4 without knowing exactly what is the situation as what is generally quite simple when everything is done following the good practices, can be difficult in other situations.
Hi,
Is it possible to run more than one agent pressing one button? I would like to manipulate the script to add multiple paths but can’t seem to come up with a solution.
Thanks,
Joanna
Hi Joanna,
It is possible but you have to do a loop over the paths you need in the ‘ $(‘#runAgent’).click ‘ handler. The OBIEE function expects a single agent at a time in the ‘runIBot’ call, so you have to loop outside that call over your various paths. Another option would be a to chain the agents directly, as OBIEE allows to do when you want to run them one after the other.
Hello,
Is it possible to make this work in OAC? I tried to run it in OAC as is and getting this error:
Refused to load the font ” because it violates the following Content Security Policy directive: “font-src ‘self'”.
I was just wondering if I should try to make this work in OAC or just manually enable about 500 agents.
This piece of code doesn’t load any external font, therefore that Content Security Policy (CSP) error doesn’t come from it.
OAC is a 12.2.2.x version, the code was written for (and on) 12.2.1.x : there are many chances that it will just work or worst case only requires really little changes on it. Will give it a look either tonight or tomorrow to see how it goes on a OAC 105.4.
Hi Gianni, how do I get it to list all agents? It looks like it truncates at 300.
Hi Lena, there is a setting which is by default 300. You can change it in instanceconfig.xml. Check one of the previous comments, the name is there. (And reply if you can’t get it, will get you more details)
Hello Gianni
Can I save the agent with query. Can you please help with few steps to do the same.
Hi, sorry but I don’t understand what you mean by “save the agent with query”.
Hello Gianni
When we save the agent it creates the job I’d in job manager which is manual. I want to automate this agent saving so that it creates jobs in job manager
And what do you do once you have an ID? Having one or not doesn’t change much, the agent must be enabled. You can probably simulate and edit/save of the agent by adapting the kind of calls you do. Try to look at what happen when you save the agent from the edit screen (I don’t exclude it’s an heavier operation as multiple pieces are involved).
Hi Team,
Could you please help me how to enable /disabled agents in obiee12c 12.2.1.4 .
Thanks
Kc
Sorry but … isn’t it exactly what this post is all about?
Hello Gianni,
Thank you very much for a wonderful script to mass enable of agents.
Could you please help me to mass disable of agents?
In the script what parameters do we need to update to disable the agents. If time time permits please provide the details. It will help us a lot.
Look at some of the previous comments, the name of the method to call to disable agents is mentioned (it’s pretty intuitive anyway).
For the code you will have to adapt the Js to deal with both statuses, except if you just keep it single-usage and reverse the first check logic on the status and adapt the method call to disable instead of enabling.
Thank you very much Gianni,
Its working as expected and Now we are able to enable as well as disable agents successfully.
Hi Raju,
Would you be able to share a copy of the Dashboard with your changes to disable Agents, also?
Thank you.
Hello Gianni,
we are able to enable and disable agents but after moving the changes to other environment, its just loading but not showing list of agents. Any idea please.
Thanks in advance
Well … my crystal ball is broken 😀
Open your browser console and look at what it does tell you. There is nothing secret in this thing, it’s just a piece of JS.
Hello Gianni,
Have you tried this with the new Oracle Analytics Server v5.5.0? The same issue exists with migrating content from OBIEE 12c to OAS via a snapshot (.bar file). The Agents come over but are all disabled. The javascript for the Mange Agents dashboard is throwing syntax errors. This was very handy when upgrading from OBIEE 11g to OBIEE 12c. I was hoping it would work with the new Oracle Analytics Server.
Thanks!
Hi Tony,
It isn’t really an issue, but I can understand why it feels like being one 🙂
OAS 5.5 changed the location of some libraries, to make the code work you must be allowed to save HTML content (it’s disabled by default), and you have to edit the Dashboard page containing the code.
In the very first text object of the page (on top, named “Text 1”), look for this line: var loadPath = jqueryPath.substring(0, jqueryPath.split(‘/’, 3).join(‘/’).length);
There inside replace the 3 by 5 and job done, save the page and you are good to go.
Let me know if you need any support in your OAS migration 😉
Hi Gianni,
Thank-you!
Any way to add disable option as well ?
Easily doable, previous comments give all the hints on how to do it in few minutes.
really nice, it worked for me, I am using Oracle Business Intelligence 12.2.1.3.0
I’m trying this solution, it’s not working in OBIEE 12c
“this solution” : what does even mean? there are 2 use cases covered by the post with different code.
And there isn’t much that can be said on “it’s not working in OBIEE 12c”. What exact version, what “not working” means, etc.
Hi Gianni,
In OBIEE 12, the Manage Agents dashboard shows the list of Agents sorted in alphabetical order. However, in Oracle Analytics Server 5.5, the list of Agents seems to be displayed in no certain order. We have well over 1500 Agents in our production environment. While migrating form OBIEE 12 to OAS 5.5, this is making the line-by-line comparison for re-enabling the Agents very difficult. I can’t seem to find a server setting for this. Would you have a way to modify the code to sort the list of Agents?
Thanks-you!
Hi Gianni.. do you have any posts about kicking off OBIEE 12c agents by script from outside OBIEE? I am looking to implement a solution where an ODI job finishes and kicks off a script that runs an agent. Apologies if this is the wrong place to ask or it is covered above. Thanks – Niamh
You can use the OBIEE web service: https://docs.oracle.com/middleware/1221/biee/BIEIT/methods.htm#BIEIT1106
An alternatives could be to use the SASCHINVOKE utility by command line.
If you Google on this second way, there are old blog posts for 11g but it will probably be the same in 12c.
Hi Gianni,
Need the automation script for enabling the agents all at once. Please provide me the sample script.
With all the respect, you maybe should read the blog post once again. I don’t think the Oracle network, that you are connected to, altered the blog post to hide parts of it…
Hi Gianni
Thanks for the useful post
My requirement is a little different and I want to use what you have written as a basis for solving my problem.
I have a large number of users (almost 100) who each have a different RLS.
For the purpose of heating the cache,
I want to run my report (scheduled or manual with agent), each time with a different user.
I was thinking of wrapping your script with a loop but I do not see a place where I can set “run as” another user.
I would appreciate it if you have a solution to the issue
Thanks
Yochai
Hi Yochai,
The “run as” option is inside the agent itself, one of the very first options you set when editing/creating an agent. If you want to run an existing agent as different users by changing the “run as” option, you should edit the agent itself as the info is stored into the XML defining the agent stored in the catalog. Did you try to change your agent to “run as recipient” and set all your 100 users as recipients? With that option the server will impersonate every single one of your recipients and run the agent, there are chances that it also work for your cache seeding purpose.
Hi Gianni,
My requirement is to run the agents based on event(after ETL completion). Our ETL is SQL Server job. Some times the ETL jobs are delayed and agents that are scheduled at specific time are sending the stale data to business and we had to rerun them manually.
I read about this command line SASchInvoke creating batch of all the jobs with this command. Any thoughts of initiating this batch or how to handshake since this command can only run on OBIEE box.
or any better ways to do this?
Thanks.
Hi Gianni,
This code has been working great in OAS 5.5. However, after upgrading to OAS 5.9, the Manage Agents dashboard only displays the Agents in my “user” folder and not the “shared” folder tree. I have tried adjusting the PATH parameter in your code, but no luck. I am a “BI Service Administrator” with admin access to the entire server. Do you have any ideas? Thanks!
Hi Tony, I unarchived the dashboard in a fresh OAS 5.9 instance. After changing the
var loadPath = ...
with a 5 instead of 3 (to make it work with OAS), the page does show some agents I did create in the shared folder.Because of that it’s difficult to guess why your doesn’t seem to work. Being BI Service Administrator doesn’t always mean to have access to catalog objects to change their properties. Can you check if in the catalog page you can find agents and enable/disable them?
Hi,
Yes, if I use the Catalog to navigate to our Agents, I can edit and “Enable” the Agent manually. We have over 1000 Agents and having the Manage Agents dashboard is a life saver. I do wish I could figure out how to keep it working in OAS 5.9
Using the browser’s developer console, in the “network” tab, you can look at what calls are fired by the page.
There should be one for “/analytics/saw.dll?CatalogTreeModel”, is it executed? Does it have a result? What does the result look like? Any error in the console itself? Maybe there is a piece of JS failing somewhere and the fix will be simple.
For some reason today, the Manage Agents dashboard is not working at all whereas yesterday I was just getting Agents listed my user folder.
I do see the POST for /saw.dll?CatalogTreeModel. In the browser console I’m now getting a “502 Bad Gateway” and error below. This is very puzzling as the rest of the Analytics server functions are fine.
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /analytics/saw.dll.
Reason: Error reading from remote server
That’s a good thing, keep looking at the developer tool extension of your browser for the results of the requests. Do you have a proxy in front of your OAS environments? That page will fire many requests, one per agent to be precise, after retrieving the list of agents. If you have a proxy or some strict configuration of your environment, that could be seen as unusual activity and maybe be blocked.
But the thing is that this is a behavior in your environment, therefore difficult to guess what the issue is without knowing the environment or having access to it.
Hi Gianni, I am very happy to hear from you.
Thank you very much for the great script for mass activation of agents.
This code worked on 5.9 as well.
As you wrote above
> jqueryPath.substring(0, jqueryPath.split(‘/’, 3).join(‘/’).length))
Changed 3 to 5.
Hi Gianni,
I’m trying to tweak the code to include the recipient email addresses with a pipe delimiter but not sure how to? Can you please help?
An agent has the recipients defined inside, therefore not sure to understand what you are trying to achieve.
If you want dynamic recipients, why don’t you use the available feature in agents for that with an analysis returning the recipients?
Without EJB, Is it possible to download reports to server in a specific path via javascript?
EJB is java and not javascript. You can freely code whatever you want in javascript, there just isn’t any special integration and so you are just dealing with a web page (a complex one but still a web page).
Hello Gianni Ceresa,
I want to change the dashboard page permissions from Modify to Custom (read, Execute) for each client. is there a way I can do it programmatically either by java or python?
Thanks
Eswar KC
You will first define who a “client” is because that isn’t a security object. You should identify an application role representing your “each client”.
Then you can use runcat.sh|.cmd or the WebCatalogService webservice exposed by the WSDL. There would also be other ways, but you better stay on fully documented and supported methods.
Hi Gianni,
You made my day simple thanks for that. it is working perfectly.
Just to know
1.how I can disable this agent.
2.i have huge number of agents so that BI link is getting crashed while fetching all the agents.so make it simple how can we put the prompt value (Agents paths, share folder,Userfolder paths) in the same dashboard.
it would be very helpful if you have that code also.Thanks in Advance….
Hi,
If you look in the code inside the dashboard, at some point you find
$.post('/analytics/saw.dll?CatalogTreeModel', {action: "search", path: "/", mask: "*", recurse: "t", sig: "coibot1", _scid: obips_scid}, function(data){ ... });
inside the listAgents function.As you can see it does a catalog search, you can pass a path and a search mask. Adapt that part based on your needs.
Hi Gianni,
User Agents are missing in the script. It is just showing My folders and Shared folders agents not the users agents. Can you please help where we have to modify to display everything in the system including Users personal Agents as well. I have tested it with biadmin with access roles but still the same. Your help is really appreaciated.
Thank you!
Gopi
There is no magic in the code. It is working online with the connected session, the security is enforced.
Can you see the content of users’ folders with your user? No, the script doesn’t have more powers than what your user has.
Hi Gianni,
I am using with biadmin with full access where we can see everything including user folders as well but right now with this script i can only see biadmin my folders agents and shared folders agents but not the agents under user folders.
Please help me how to get all the list of all user agents as well with biadmin
“biadmin” or any administration role in OBIEE/OAS/OAC doesn’t have access to the users’ personal folders when the security is enforced with a standard security model. It can see the list of the users’ folders and that’s it. If your account has access to any content inside personal folders it means you did explicitly modify the security.
Anyway, as said the script is no magic, it does just a catalog search and nothing else. If you can perform a catalog search and find the agents in users’ personal folders, then the script will also see them (it does a search in / of the catalog). If you can’t see those agents, it’s because the security is enforced.
Hello Gianni,
Thank you for great post.
Is this doable in OAC as well. When I am trying to implement the same I am getting error like
Failed to load resource: the server responded with a status of 404 (Not Found).
I am doing something wrong.
Thanks
Anirban
Hi, look in the previous comments. For OAC and OAS I believe there is a path to include a JS file that has to be changed. It is mentioned in a previous comment.
Hello Gianni,
Thank you very much for quick reply.
I am sorry but I am not able to find any such information. I could only find below comment by you in previous –
”
OAC is a 12.2.2.x version, the code was written for (and on) 12.2.1.x : there are many chances that it will just work or worst case only requires really little changes on it. Will give it a look either tonight or tomorrow to see how it goes on a OAC 105.4.
”
Am I missing something here.
Thanks
Anirban
Search for a comment posted by Tony on 22 April 2020. The reply is about OAS, should be the same for OAC.
Hello Gianni,
Thank you for your reply.
I have already tried the same,
var loadPath = jqueryPath.substring(0, jqueryPath.split(‘/’, 5).join(‘/’).length);
But still getting 404 error.
HTML is already allowed.
Thanks
Anirban
Hello Gianni,
Thanks for your help.
I have tried in OAS and OBIEE, it is working fine, but it is not working in OAC.
Am I doing something wrong.
Thanks
Anirban
The post is from 2017, based on OBIEE 12c.
The logic, the approach, should still work in OAC, but in 6 years there are chances some paths did change somewhere.
If it doesn’t work in OAC, debug it: it’s just some JavaScript loading libraries and doing some HTTP calls.
I didn’t use it in OAC, I know that the product still work the same way globally, but the UI did change and with it there are different paths involved probably.
FWIW, I tried to implement this in OAC succesfully, had to apply following changes:
– a predefined path to filter agents in, had to be exact and was slightly changed after catalog exp/imp
– /analytics/saw.dll became /ui/analytics/saw.dll
– jqueryPath.split(‘/’, 3) had to be become jqueryPath.split(‘/’, 6)
Great script, we could implement it in OAS successfully! Just one question, can you tell a path where obiee js libraries are stored? We wanted to implement disable functionality too, and i was wondering if there is such method in a library at all until i read some comments here where you mentioned that there is
Hi,
I didn’t check the code right now, but in a older comment (6 years ago: time flies) I posted this: “you have good chances by replacing the call to “enableIBotSchedule” by a call to “disableIBotSchedule”. They seem to have the same parameters and so it would be enough.”.
Give it a try…
As for the JS libraries there are many, and don’t have a fixed path as they are extracted from a WAR or EAR deployed in WebLogic, and therefore one way of doing it is to search through the loaded JS files in your browser’s console when you are in the catalog page, or do a full text search on your disk. It all depends what you try to achieve.
There isn’t any doc about these things, because it wasn’t designed to be used by custom scripts. But it’s JS, it’s all there in your browser already…
Thanks Gianni, that was helpful, there indeed is a function disableIBotSchedule() in js files. I searched through server catalog and found related js files inside bi server domain ../war/res/b_mozilla. After doing some modifications as you suggested we were finally able to implement disable functionality too.