Defining a CCS File in String Mode

 



 

Creating a String CCS File

 

Please follow the steps given below to create a new String Mode CCS file for the Standalone CLI Agent :

  1. Go to <WebNMS\C-Agent>\bin directory from the command prompt.

  2. Run the CLI Editor application by executing CLIEditor.bat or CLIEditor.sh in <WebNMS>\C-Agent\bin directory.

  3. Select File -> Create from the menu bar options.

  4. Select the type of CCS file as String Mode.

  5. Enter the Filename as "stringsample".

  6. The CCS directory indicates the location in which the CCS is to be stored. Enter the location as <WebNMS\C-Agent>\ccs. The location starts from the drive in which the product is installed.

  7. Click OK to create the ccs file stringsample in the specified directory. You will now find the stringsample node added in the CLI tree.

Defining String Commands

 

The CLI Editor provides the following options to define String Commands:

 

Defining a Command

 

To define a string command,

Defining a Command with Options

    1.   Option Dependency Type Prefix Example

      Simple Option

      Specify the simple option for the command.

       

      The syntax for this option will be an alphabet (A,a - Z,z)

      Specify the dependency of this option (if any), with other options defined for this command. Refer to the link Dependency to know more.

      -

      By default the prefix is hyphen. ( - )

      ls -l

      In this example,

      ls is the command

       

      -l is the option which will list all the files and directories of the ls command result.

      Simple Option with Arguments

      Specify the simple option for the command.

       

      The length of this option should be 1 and it should be an alphabet

      (A,a - Z,z)

      Specify the dependency of this option (if any), with other options defined for this command. Refer to the link Dependency to know more.

      Specify if the argument to be passed to the simple option is of type String, Int, Char or Float, by selecting the Type from the list.

      By default the prefix is hyphen. ( - )

      cagent -p 8001 In this example,

       

      cagent is the command

       

      -p refers to the port number where the cagent is running.

       

      8001 is the argument passed

      to the simple option.

      Long Option

      Specify the Long option for the command.

       

      The length of this option can be a maximum of 25 characters of type alphanumeric.

      Its ID is not case sensitive.

      Specify the dependency of this option (if any), with other options defined for this command. Refer to the link Dependency to know more.

      --

      By default the prefix is double hyphen. ( -- )

      ls --all

      In this example,

      ls is the command

       

      -all is the long option. It will list all the files in the directory including the files starting with.

      Long Option with Arguments

      Specify the Long option for the command.

       

      The length of this option can be a maximum of 25 characters of type alphanumeric.

      Its ID is not case sensitive.

      Specify the dependency of this option (if any), with other options defined for this command. Refer to the link Dependency to know more.

      Specify if the argument to be passed to the long option is of type String, Int, Char or Float, by selecting the Type from the list.

      By default the prefix is double hyphen. ( -- )

      cagent --port 8001

      In this example, cagent is the command

      --port is the long option,

      8001 refers to the argument passed to the long option.

Dependency

 

If more than one option is defined for a command, specify the dependency, if any, with the other options. For example, Assume that you have defined a command ls with long options --help ,--all. To restrict the execution of --help if -all is executed, you can specify the dependency of -all as --help. If the user tries to enter this command ls --all --help, from the prompt, an error message will be displayed. To configure dependency,

dependency.jpg

add_option.jpg

 

Defining a Command with Parameters

 

To define a parameter value to a string command,

Example : cp source dest

 

In this example,

cp - name of the command

source - parameter value

dest - parameter value

 

Defining a Command with Objects

 

Objects are sub-commands defined for a string command. Multiple levels of objects can be defined. Options and parameters can be defined only for leaf objects.

 

Example: You may need to Add a router configuration, modify a router configuration, or delete an existing configuration. Instead of defining separate commands for each operation, Router Configuration can be defined as a String Command and Add, Delete, and Modify can be defined as objects under the Router Configuration command. Options and Parameters can be defined for the Add, Delete, and Modify objects.

 

To define a String Object,

    1. note.jpg

      Note: Options and Parameters can be defined only for leaf objects.

Defining a Command Help

 

User can configure or edit the command help for the commands created with the help of CLI Editor. This can be done by pressing the button Help in the Edit help field in the Edit command interface. The Configure Help dialog box pops up where the user can configure the following fields for the command help:

After entering all this, the user can press OK to configure the help or press Cancel to cancel the operation carried out.

 

After filling up the necessary fields for the command, the user needs to press Update for the changes/additions made to be added/changed in the tree structure. This just ensures temporary update of the tree structure. To permanently save the changes, the user needs to save the project by choosing Save option from the File menu.

 

On pressing Cancel, the changes/additions made do not get added on to the tree structure.



Copyright © 2012, ZOHO Corp. All Rights Reserved.