search tips



















Legal Disclaimer (Our attorneys made us say this!)
Stirling Systems Group, LLC makes no warranties or representations, express or implied, without limitation, and in no event will Stirling Systems Group, LLC be liable to you or any party for ANY loss including time, money, goodwill and consequential damages which may arise from your use of these scripts. By requesting these scripts, you agree to the above terms.

Technical Disclaimer (Our consultants made us say this!)
Keep in mind, tailoring these scripts to your environment requires a strong working knowledge of Perl and shell scripting. If you would like a Stirling consultant to help you, contact us for a price quote.

Now that we've said all that, these scripts are free! The functionality of each script is listed below.

If you would like to receive a script, email toolkit@stirlingsystems.com.

AddPageBreak.prl

Description

Formats the output file with page breaks for easy printing and viewing.

Command Syntax

AddPageBreak.prl <Input File> <Output File> <Line Number>

Parameters (Required)

<Input File>
The full path name to the input file.
<Output File>
The full path name to the output file.
<Line Number>
Specifies the number of lines where the script will add a page break. For example if <Line Number> value is 33, the script will add a page break every 33 lines.

Return Codes

0
The script added the appropiate page breakes per specified number of lines.
1
Invalid number of arguments.
3
The input files do not exist.

Error Messages

  • ERROR: invalid number of arguments passed.
    Check the command syntax to verify that all arguments were passed correctly.
  • File <Input File> does not exist.
    The input file does not exist.

Examples

  • AddPageBreak.prl C:\temp\input.txt D:\output.txt 33
    Creates the D:\output.txt file from the C:\temp\input.txt file after adding page breaks every 33 lines.
  • AddPageBreak.prl /tmp/input /tmp/output 33
    Creates the /tmp/output file from the /tmp/input file after adding page breaks every 33 lines.

DeleteJils.prl

Description

Deletes a set of JIL code from the AutoSys DataBase. Instead of the several steps needed to delete jobs or boxes within JIL, this script will perform that function automatically.

Command Syntax

DeleteJils.prl <server> <roadmap_filename>

Parameters (Required)

<server>
The production where you wish to delete selected JIL from
<roadmap_filename>
The file containing selected JIL to be deleted

Return Codes

0
The delete completed successfully.
1
The user does not have autoedit rights.
3
The specified host name is an invalid AutoSys server.
5 The specified file does not exist.

Error Messages

  • Error: Only AutoEdit can perform this function
    Only a user with autoedit rights can perform this delete.
  • Warning: hostmachine is invalid
    The specified host machine is not a valid AutoSys client server.
  • Error: $source file does not exist
    The specified file does not exist. Make sure the path is valid.

Examples

  • DeleteJils.prl Prod jil.test
    This will delete the jobs and/or boxes specified in the JIL file jil.test from the AutoSys server Prod.

FindAutoCmd.syprl

Description

Prints status of jobs with the defined command string and job names that match the specified parameters. This is very useful for operators or other personnel who are trying to match a particular command with a job and its description, but don't know that actual name of the job.

Command Syntax

FindAutoCmd.syprl <Server> <User> <Password> <Database> <Command>

Parameters (Required)

<Server>
The machine which contains the production database that the user wants to check.
<User>
The name of the user who logs into database to run a script.
<Password> The password of the login user.
<Database> The name of the production database that contains AutoSys.
<Command>
The command that the user is comparing with a job

Return Codes

0
The query generated the list of jobs which match the command string.
1
Invalid number of arguments were passed. Check the syntax of the command.

Error Messages

  • Error: Invalid number of arguments
    Usage: FindAutoCmd.syprl Server User Password Database command
    There was an error in the syntax of the command. Make sure the correct number of arguments was passed.

Examples

  • FindAutoCmd.syprl Prod autosys keepters Orac3 sleep 20
    This will search the server Prod with the user autosys and the password keepters, accessing the database Orac3 for any jobs with the command string sleep 20. Any jobs that are found will be generated in a report with the name and status of the job.

GenerateJil.prl

Description

Generates/replicates a preformatted JIL file to use as a template.

Command Syntax

GenerateJil.prl <var_file> <format_file> <output file>

Parameters (Required)

<var_file>
File names of the @jvar = (jvar1, jvar2, jvar3, etc.)
<format_file>
The JIL file to use as a template.
<output file>
The name given to the newly replicated file.

Return Codes

0
The file was successfully replicated.
1
Invalid number of arguments.
3 The var_file does not exist.
4 The format_file has missing start commands.
5 An error occurred during the renaming process.
6 The var_file has invalid formats.
7 The format_file has missing end_once commands.
8 The format_file does not exist.
9
The format_file has missing end_replicate commands

Error Messages

  • Error: invalid number of arguments
    Verify that the number of arguments is correct.
  • Error: var_file Does NOT Exist!
    Verify that the specified var_file exists.
  • Error: Format File has missing start commands
    Verify that the specified format_file has a start command.
  • Error: during rename
    An error occurred during the renaming process.
  • Warning: Variable file has invalid formats
    Verify the format of the specified var_file.
  • Error: Format File has missing end_once commands
    Verify that the specified format_file has an end_once command.
  • Error: format_file Does NOT Exist!
    Verify that the specified format_file exists.
  • Error: Format File has missing end_replicate commands
    Verify that the specified format_file has an end_replicate command.

Examples

  • GenerateJil.prl @jvar=("TEST", "test.out") SLASSA_Box c:\output.jil
    Replicate the SLASSA_BOX JIL file into output.jil in the c: directory.
  • GenerateJil.prl @jvar=("TEST", "test.out") SLASSA_Box /tmp/output.jil
    Replicate the SLASSA_BOX JIL file into output.jil in the /tmp directory.

InsertJils.prl

Description

Inserts JIL from a file to the production AutoSys database in one step, as opposed to the manual process of updating JIL.

Command Syntax

InsertJils.prl <Server> <Filename>

Parameters (Required)

<Server>
The name of the target AutoSys server.
<Filename>
The location and name of the JIL file.

Return Codes

0
The JIL file has been successfully inserted.
1
Invalid number of arguments.
3
Login user does not have sufficient rights to perform this task.
5
The specified filename does not exist.

Error Messages

  • Error: invalid number of arguments passed.
    Verify that the number of arguments is correct.
  • Error: Only autoedit can perform this routine.
    The current login user does not have sufficient rights to insert the JIL file into the production server. Re-login with a valid login (e.g. autoedit).
  • Error: Filename does not exist
    Verify that the specified file path and name is valid.

Examples

  • InsertJil.prl Developers c:\output.jil
    Insert output.jil from the c: directory to the production server named "Developers."
  • InsertJil.prl Developers /tmp/output.jil
    Insert output.jil from the /tmp directory to the production server named "Developers."

KillServices.prl

Description

Kills the NT service indicated when run.

Command Syntax

KillServices.syprl <Flatfile> <Completion File>

Parameters (Required)

<Flatfile>
Flatfile with list of services.
<Completion File>
Completion file name to create.

Return Codes

0
This script killed the services on the file list.
1
Invalid number of arguments.
3
Flatfile does not exist.
5 or 7
Kill command failed.

Error Messages

  • Error: invalid number of arguments
    Verify that the number of arguments is correct.
  • Warning: Flatfile doesn't exist
    Verify that the indicated flatfile exists.
  • Error: while running tlist command
    An error occurred while running through the list of flatfiles set for the KillServices command.

Examples

  • KillServices.prl c:\input.txt c:\output.txt
    This script kills the services from the file input.txt, then lists the services killed in the output.txt file.
  • KillServices.prl /tmp/input /tmp/output
    This script kills the services from the file input, and lists the services killed in the file output.

Netsend.prl

Description

Notifies users via emial when the services are killed. This works together with KillServices.prl to provide notification into this automation procedure.

Command Syntax

Netsend.prl <Input File> <Message File>

Parameters (Required)

<Input File>
File that contains the list of users to be notified.
<Message File>
File that contains the message to send to the user list.

Return Codes

0
This script successfully sent the message in the message file to the user(s) listed in the input file.
1 Invalid number of arguments.
3 User listed in the input file does not exist.
5
Message does not exist.

Error Messages

  • ERROR: invalid number of arguments passed.
    Look at the command syntax to verify all arguments were passed correctly.
  • <USER> does not exist.
    The specified user does not exist on the machine that ran the script.
  • <MESSAGE> does not exist.
    The message file did not contain any information and was zero byte length.

Examples

  • Netsend.prl C:\userlist C:\message
    Sends the message in the C:\message file to the users listed in the C:\userlist file.
  • Netsend.prl /tmp/userlist /tmp/message
    Sends the message in the /tmp/message file to the users listed in the /tmp/userlist file.

ParseMail.prl

Description

Deletes the header portion of e-mails. This is useful when compacting e-mail files.

Command Syntax

ParseMail.prl <Message Files> <Target File>

Parameters (Required)

<Message Files>
File that contains the message to send to the user list.
<Target File>
File that will contain all the messages.

Return Codes

0
This script successfully sent the message in the message file to the user listed in the input file.
1
Invalid number of arguments.
3
The target file could not be written to.
5
Message does not exist.

Error Messages

  • ERROR: invalid number of arguments passed.
    Check the command syntax to verify all arguments were passed correctly.
  • ERROR: Target could not be written too
    Check the permissions on the Target file.
  • <MESSAGE> does not exist.
    The message file did not contain any information and was zero byte length.

Examples

  • Netsend.prl C:\message1 C:\message2 C:\message3 C:\message
    Parses the messages C:\message1 C:\message2 C:\message3 into the target file C:\message while removing all of the email headers.
  • Netsend.prl /tmp/message1 /tmp/message2 /tmp/message3 /tmp/message
    Parses the messages /tmp/message1 /tmp/message2 /tmp/message3 into the target file /tmp/message while removing all of the email headers.

Read_auto.prl

Description

Concatenates each auto_remote log to an output file, allowing you to capture what is currently happening in AutoSys the moment the script is launched.

Command Syntax

Read_auto.prl <Directory> <File Name> <Output File>

Parameters (Required)

<Directory>
The directory where AutoSys places the logs of the auto_remotes.
<File Name>
The file name pattern that AutoSys uses for it's auto_remotes. This is usually auto_rem.
<Output File>
The output file that will contain all the logs of all the auto_remotes.

Return Codes

0
This script successfully compiled all the auto_remote logs into one output log.
1
Invalid number of arguments.
3
There were no auto_remote logs.
5
auto_remote log does not exist.

Error Messages

  • ERROR: invalid number of arguments passed.
    Check the command syntax to verify that all of the arguments were passed correctly.
  • Warning: There are no files in the <directory>.
    There were no AutoSys jobs processing at the time. If this is unusual, the user should verify that the specified directory is correct.
  • Error: The auto_remote log does not exist.
    The auto_remote log does not exist, indicating that there is a stalled process. Investigate further into what the auto_remote was processing.

Examples

  • Read_auto.prl /tmp/ auto_rem /tmp/output
    All the auto_remote logs are concatenated into the file named output, located in the /tmp/ directory.

ShowLog.prl

Description

Reads the logfile of the AutoSys job and prints it to the screen. This is extremely useful for error checking. This utility can be placed into the AutoCons configuration file as a button which users can click and view the log file.

Command Syntax

ShowLog.prl <AutoSys INSTANCE> <Job Name>

Parameters (Required)

<AutoSys INSTANCE>
The AutoSys INSTANCE that the AutoSys job resides on.
<Job Name>
The name of the AutoSys job that the user wants the JOB LOG displayed.

Return Codes

0
The script showed the job log to the user.
1
Autorep FAILED.
2 Invalid number of arguments.
3 The remote execution failed.
4 User specified an incorrect choice when prompted.
5 Executing this script whose log is on the NT machine.
9 Log file is not found on the remote machine.
11 Error occurred while information was being retrieved.
13
Job does not have a LOG.

Error Messages

  • ERROR: invalid number of arguments passed.
    Check the command syntax to verify that all arguments were passed correctly.
  • WARNING: DSQUERY NOT SET using chk_auto_up to get AUTOSYS DataServer
    This is a warning message about querying for the DataServer. The script will look for the DataServer value by using the chk_auto_up command.
  • ERROR: autorep FAILED!
    The log query could not be initiated. Please verify that AutoSys is running correctly.
  • Error: That is an incorrect choice.
    Occasionally, the user will be prompted to choose a filename for either the STDOUT or STDERR files if they are different. The user then chooses that log file by typing in the log they want to see. If they type this in incorrectly this message will appear.
  • Error: during the rsh cmd profile.
    There was a problem while attempting to get the log file on the remote machine. Verify that the rsh command is properly configured.
  • WARNING: This is using an NT value and it is stored in the REGISTRY.
    The log file resides on a NT machine which can not be accessed with this version of the script.
  • Error: while retrieving information.
    There was a communications problem while retrieving the log information from a remote machine.
  • JOB is NOT a Command and WILL NOT have a LOGFILE.
    This job is either a box or filewatcher and will not have a log file associated with it.

Examples

  • ShowLog.prl PRD JOB1
    Show the job log for JOB1 on the AutoSys Instance, PRD.

 

Comments, suggestions or problems with our web site?
Please send email to: webmaster@stirlingsystems.com

© 2002 Stirling Systems Group, LLC
All Rights Reserved.