Packeteer Home Page Choose a PacketGuide version   

 Feedback

 Search

 Index

 Contents

What's New?



 Overviews

 Recommendations

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

 Reference
 



 

Create a Command File

When you have a sequence of commands that you type over and over again, you can save time by typing these commands once into a command file. A command file is a text file containing a list of PacketWise CLI commands. When you run the command file, the commands are executed sequentially. You can either use the run command to execute the command file from the CLI prompt, or use the schedule feature to schedule the command file to run on a regular basis.

Not all CLI commands can be included in a command file. First of all, there is a requirement that the CLI command run without additional user input. If the command is interactive and prompts the user for input (such as the event new command in command-prompting mode), the command won't work. Second, many of the file utility and diagnostic commands (such as cat, cd, cmp, date, dnslookup, du, echo, ls, mkdir, mv, ping, and rm) cannot be included in a command file. Exceptions are ftpget, ftpput, zip, and unzip — these commands can be included and are quite useful in command files.

Although you can create a command file in any text editor, you may prefer the convenience of using PacketWise's Command File Editor. With the built-in editor, you can save the file directly on the PacketShaper.


Note: To perform this task from PolicyCenter, you must first select a configuration from the Editing Configuration drop-down list at the top of the page.

To create a command file:

1. In the File Browser, navigate to the directory where you want to store your command file.

Note: The hard drive is the recommended location for command files because the log files can potentially consume significant disk space. You cannot save command files to the root directory of the hard or flash drive.

2. Click the new cmd file button. The Command File Editor window appears.  show screen

3. (Optional) In the Contents area, enter a description next to the #Title text. You can use this comment line to describe the function of the command file.

4. Enter the CLI commands, with each command on a separate line. (See Command-Line Interface for descriptions and syntax of each command.)

For example, suppose you want the command file to output measurement data to a file and then FTP the file to an FTP server. You use the measure dump command to create a delimited text file of the data and then use the ftpput command to copy the file:

measure dump class inbound/default by time 1w 1h to inbound.out bytes
ftpput jsmith:mypassword@smithinc 9.256/inbound.out inbound.out

Important: Command files must end with a carriage return. If a command file doesn't have a carriage return at the end of the file, the last command in the file will not be executed. Therefore, make sure all of your command files (including adaptive response action files) have a carriage return after the last line.

5. To save the file, enter a descriptive name (up to 8 characters) in the File Name field and click save.

The file is stored in the current directory and a CMD file extension is automatically added to the name. The Results area indicates whether the file was saved successfully.

6. To make sure you entered the commands with the correct syntax and that the commands work as expected, click run. The Results area displays the output of each command and any error messages that may have occurred.

7. Modify the commands as necessary, and then repeat steps 5 and 6 until the command file runs successfully.

8. Click the back button and observe that the command file you created is listed in the Contents of folder window. If it's not listed, click update to refresh the screen.

If you need to modify the command file in the future, use the edit button that appears next to the filename. Note that the maximum file size that can be edited is 8K.

See also:

Create a Data Entry Form

Review Log Files

 

 

PacketGuide™ for PacketWise® 7.3