Remotely execute actions

Contents:

Pentaho actions, reports, admin tasks, etc. are stored as xaction files. They are run when you call them via HTTP, through a Web browser or otherwise.

There are several means to periodically call an xaction file.

Scheduling through an xaction file

In Design Studio, create/open an xaction file. In Process Actions, click Add New Action (the blue plus sign) > Scheduler > Add Job. You can set a task to automatically run through here. See this xaction file as an example.

Refer also:

For more information:

Using Pentaho Data Integration (Kettle)

  1. Place an 'HTTP client' object (found in Core Objects > Lookup) into your transformation/job
  2. Enter the URL to the xaction into the settings
  3. Append the user name and password to the URL to allow it to authenticate
    &userid=USERNAME&password=PASSWORD
  4. The final URL should look something like
    http://mypentahoserver:8080/pentaho/ViewAction?solution=admin&path=&action=clear_mondrian_schema_cache.xaction&userid=USERNAME&password=PASSWORD

Using wget

You can use 'wget' to remotely call xaction files. Because it is a command-line tool, it can be easily scripted.

Example: flushing the Mondrian schema cache

Say you have your datamart updated nightly, and you find you have to manually purge your Mondrian schema cache every morning to ensure your analysis reports don't deliver stale data.

  1. Go to the Admin page: http://yourpentahoserver:8080/pentaho/Admin
  2. Examine the HTML source (in Firefox, click View > Page Source or hit Ctrl+U)
  3. You should see that "Purge Mondrian Schema Cache" has the URL "ViewAction?solution=admin&path=&action=clear_mondrian_schema_cache.xaction"
  4. Convert any character codes to their real characters (e.g. & becomes just &)
  5. Now plug this into wget:
    wget --quiet -O /dev/null --user=myusername --password=mypassword "http://mypentahoserver:8080/pentaho/ViewAction?solution=admin&path=&action=clear_mondrian_schema_cache.xaction"
    Include the user name and password of someone with the necessary permissions. The "--quiet -O /dev/null" is optional and suppresses all output.
  6. If successful, it should pull down an HTML page which says "Action Successful".
  7. If you want this to be automated, run this command as a cron job.

Resources

As the examples above show, you will need to authenticate against Pentaho to run actions. See our Security section for more information.

Pentaho also have some useful information:


Creator: Sridhar Dhanapalan on 2008/05/29 05:57
XWiki Enterprise 1.7.2.16857 - Documentation