Here is an alternative, using shell and Perl (one liner):
NOTES:
1) Multiple machine names are allowed (comma separated).
2) THIS ONE FINDS JOBS THAT ARE DEFINED ON MACHINES STARTING WITH THE NAMES PASSED. "LOD" will find "LODHP01" and "LODSUN1" and so on.
Usage: ./getJobsByMach.sh machine1[,machine2,..,machineN]
(No white space after comma, please)
Example:
sh-4.1# ./getJobsByMach.sh localhost,lodhp01
Job name: CMD1
RunMachine: localhost
Job name: CMD2
RunMachine: localhost
Job name: test_invalid_TZ
RunMachine: localhost
Job name: future_date
RunMachine: localhost
Job name: 21957774_hpux_agent_kill-15
RunMachine: lodhp01
Job name: test_perl
RunMachine: localhost
Job name: 21989472_n_retry_test
RunMachine: localhost
Script:
sh-4.1# cat getJobsByMach.sh
#!/bin/sh
#Source the autosys profile
. /opt/CA/WorkloadAutomationAE/autouser.CVC/autosys.sh.`hostname`
#Ensure there is atleast one machine name passed as argument
if [ $# -eq 0 ]
then
echo -e "\nSorry, what am I supposed to search for? You haven't given any machine name\n"
echo -e "Usage: $0 machine1[,machine2,..,machineN]\n"
echo -e "(No white space after comma, please)\n"
exit 1
fi
MACH_LIST=`echo -e $1 | sed -e 's/,/|/'`
MACH_LIST="$MACH_LIST"
do_the_search()
{
PERL_LINE="$(which perl) -00 -ne"
$AUTOSYS/bin/autorep -J ALL -q | \
$PERL_LINE "print if /machine:\s($MACH_LIST)/" | \
egrep '(^$|insert_job:|machine:)' | \
sed -e 's/insert_job:/Job name:/' -e 's/job_type:.*//' -e 's/machine:/RunMachine:/'
}
do_the_search
#THE END
The fine print: These scripts are provided "as-is", without warranty of any kind, etc. etc.