Running "Monitor" commands from outside Rx Admin tool

Hello,

We’d like to be able to run admin commands like “flush cache”/“flush foldercache” on a scheduled basis, be it through an external script launched from a crontab entry, or from a scheduler within Rhythmyx. My understanding from Tech Support is that the scripted varierty used exist but is no longer supported.

Are either of these options available now or in the works?

For background purposes, we are refreshing our dev/qa Rx database tables from production on a regular basis. And without running the flush operations, content explorer and publishing generate serious errors and bad data based on the discrepancies between the caches and the database contents. We would love to run this cleanup step after the db refresh on the same automated schedule.

Flush cache is available as a pre java exit. You can create a publishing app that doesn’t return anything and add that pre exit. Then you can add it to a blank publishing edition and schedule that edition using cron.

Found a way for you to add this in a script. The following call can be added to a script to run any of the console commands:

com.percussion.util.RemoteConsole <SERVER> <PORT> <USER ID> <PASSWORD> “console command to run” <Y or N to select if you want to see output>

Following jars need to be in your classpath:
<Rhythmyx Root>\AppServer\server\rx\deploy\rxapp.ear\rxapp.war\WEB-INF\lib\rxclient.jar
<Rhythmyx Root>\sys_resources\AppletJars\rxcx.jar
<Rhythmyx Root>\Administration\commons-codec-1.3.jar
<Rhythmyx Root>\Administration\rxmisctools.jar

Command line example run from the Rhythmyx root directory:

java -classpath “AppServer\server\rx\deploy\rxapp.ear\rxapp.war\WEB-INF\lib\rxclient.jar;sys_resources\AppletJars\rxcx.jar;Administration\commons-codec-1.3.jar;Administration\rxmisctools.jar” com.percussion.util.RemoteConsole localhost 9992 admin1 demo “flush cache” y

That second option sounds good. I’ll try that. Thanks!

I thought I would post my fleshed out version of this for Linux/Unix users. Note that the Rhythmyx directory and login info should be defined. Code assumes you are running on the local Rhythmyx server.


#!/bin/sh
##  This script provides a way to run Rhythmyx Server Monitor commands from a shell script.

function log()
{
echo -e "`date` $* 
"
}

function execute_command()
{
MONITOR_COMMAND="$1"
log "Executing monitor command, \"$MONITOR_COMMAND\" ... "

JAVA_COMMAND="$JAVA_HOME/java -classpath $CLASSPATH com.percussion.util.RemoteConsole localhost 9992 $USER $PASSWORD \"$MONITOR_COMMAND\" y"
#log $JAVA_COMMAND
$JAVA_COMMAND
echo
}

## Start of "main"
log "$0 Starting"

## Variable setup
JAVA_HOME="/usr/java/jdk1.5.0_10/bin"
RX_ROOT="/opt/percussion/rhythmyx"
CLASSPATH="$RX_ROOT/AppServer/server/rx/deploy/rxapp.ear/rxapp.war/WEB-INF/lib/rxclient.jar:$RX_ROOT/sys_resources/AppletJars/rxcx.jar:$RX_ROOT/Administration/commons-codec-1.3.jar:$RX_ROOT/Administration/rxmisctools.jar"
USER="admin1"
PASSWORD="demo"

## Run commands
execute_command "flush cache"
execute_command "flush foldercache"

log "$0 Finished!"