You can use inline commands for Native Command Sets.
You can only use inline commands for Native Command Sets (NCS) if Line By Line (LBL) mode is
true. If the LBL is not true, Netcool Configuration
Manager will remove the
commands and try to send what is left to the device. To use inline commands to make configuration
changes, Streaming has to be set and the sendData command will be used instead of send command.
Note: In the f5 example, streamFile.03, send was replaced by send
Data:
### Stream file
streamFile.03.sendData=$stream_input$\r
streamFile.04.wait=#
streamFile.05.sleep=5000
streamFile.08.send=save sys config\r
streamFile.11.wait=#
Inline commands
- ITNCM-Sleep
- This command will allow Netcool Configuration
Manager to sleep for the
specified milliseconds before doing the next command in the list.
- Example sleeping for 2 seconds:
ITNCM-Sleep=2000
The following example is
for using the sleep command in an NCS. This example is for a Juniper
m7i.ITNCM-Sleep=10000
ITNCM-ChangePrompt=#
set system location floor 1
ITNCM-Sleep=5000
set system location building redish
ITNCM-Sleep=5000
set system location floor 313
ITNCM-Sleep=4000
set system location rack 23
ITNCM-Sleep=2000
set system location altitude 123
ITNCM-ResetPrompt=true
- ITNCM-NoPrompt
- This command will cause Netcool Configuration
Manager to not wait for a
prompt to be returned.
- When setting NoPrompt to true, ITNCM will not wait for any reply from the device.
- Example:
ITNCM-NoPrompt=true
ITNCM-NoPrompt=false
- The following example was for an F5 device. In this example the display threshold is set to 6.
This is a device change, but we are not going into configuration mode so we are using an
interrogation script.
cli
ITNCM-NoPrompt=true
modify preference display-threshold 6
ITNCM-NoPrompt=false
exit
- ITNCM-ChangePrompt
- This command will change the prompt that Netcool Configuration
Manager is waiting for when
executing commands in NCS.
- This example changes the prompt from default prompt to
‘>’.
ITNCM-ChangePrompt=>
The following example shows how to use the
ChangePrompt cmd in a
NCS.ITNCM-Sleep=10000
ITNCM-ChangePrompt=#
set system location floor 1
ITNCM-Sleep=5000
set system location building redish
ITNCM-Sleep=5000
set system location floor 313
ITNCM-Sleep=4000
set system location rack 23
ITNCM-Sleep=2000
set system location altitude 123
ITNCM-ResetPrompt=true
- ITNCM-ResetPrompt
- This command will reset the prompt to the default value.
- The default prompt is set in the device script (example
default.prompt=#):
ITNCM-ResetPrompt=true
ITNCM-ResetPrompt=false
- The following is an example of how to use the ResetPrompt cmd in a
NCS.
ITNCM-Sleep=10000
ITNCM-ChangePrompt=#
set system location floor 1
ITNCM-Sleep=5000
set system location building redish
ITNCM-Sleep=5000
set system location floor 313
ITNCM-Sleep=4000
set system location rack 23
ITNCM-Sleep=2000
set system location altitude 123
ITNCM-ResetPrompt=true
- ITNCM-ChangeEndOfLine
- This command will change the end of line value that follows each
command.
ITNCM-ChangeEndOfLine=\r\n
- ITNCM-ResetEndOfLine
- This command will reset the end of line values back to the default value.
- The default value is
\n
ITNCM-ResetEndOfLine=true
ITNCM-ResetEndOfLine=false
- Inline case statement
- Inline case statement is a command that is added to the Native Command Sets (NCS) to handle the
case where multiple responses to a command that is sent to the device are possible. The case
statement is limited to one cmd at a time.
- All of the following examples are for list net vlan on an F5 load balancer. Depending on the
configuration size, the device will return a question with y/n. If the config is small, the config
will be displayed without the extra prompt. When the y/n prompt is given, the device will expect a y
to display the config.
-
- Case statement commands
-
ITNCM-Case(some number) - is one of the expected responses that Netcool Configuration
Manager will expect from the
previous command.
ITNCM-Case-Done - lets Netcool Configuration
Manager know that the case
statement is done.
ITNMC-Send - is what Netcool Configuration
Manager will sent to the
device.
ITNCM-Wait - is what Netcool Configuration
Manager will wait for from
the device.
ITNCM-Case-Loop - is the number of times Netcool Configuration
Manager will loop through the
cases statement while waiting for a match. The default = 2.
ITNCM-Case-Sleep - is the time in milliseconds that the case statement will sleep after
all the cases have been checked. The default = 1500.
ITNMC-Case-Timeout - is the time that the case statement will wait for each of the cases
to show up in the device output before moving to check the next case. The default = 1500.
- Example One
-
Add a case statement that will return a carriage return "\r" in the case of a # or y in the case
of y/n) prompt.
If the LBL is not set, then the ITNCM-Case1, ITNCM-Case2 and ITNCM-Case-Done lines will be
removed and everything else will be sent to the device.
list net vlan
ITNCM-Case1=#
\r
ITNCM-Case2=y/n)
y
ITNCM-Case-Done
- Example Two
- Add a case statement that will return a carriage return and a new line blank in the case of a #
or y in the case of y/n) prompt. If the LBL is not set then the ITNCM-Case1, ITNCM-Case2 and
ITNCM-Case-Done lines will be removed and everything else will be sent to the
device.
list net vlan
ITNCM-Case1=#
ITNCM-Case2=y/n)
y
ITNCM-Case-Done
- Example Three
- Add a case statement that will not return anything in the case of a # or y in the case of y/n)
prompt. If the LBL is not set then the ITNCM-Case1, ITNCM-Case2 and ITNCM-Case-Done lines will be
removed and "list net vlan" and "y" will be sent to the
device.
list net vlan
ITNCM-Case1=#
ITNCM-Case2=y/n)
y
ITNCM-Case-Done
- Example Four
- Add a case statement that will not return anything in the case of a # or y in the case of y/n)
prompt and wait for a # before finishing. If the LBL is not set then the ITNCM-Case1, ITNCM-Case2,
ITNCM-Wait and ITNCM-Case-Done will be removed and "list net vlan" and "y" will be sent to the
device.
list net vlan
ITNCM-Case1=#
ITNCM-Case2=y/n)
y
ITNCM-Wait=#
ITNCM-Case-Done
- Example Five
- Add a case statement that in the case of y/n) will send a newline, then a y and then wait for a
#. Or in the case of a #, will send a carriage return, then a new line blank and then wait for a #
before finishing. If the LBL is not set then the ITNCM-Case1, ITNCM-Case2, ITNCM-Wait and
ITNCM-Case-Done will be removed and "list net vlan" and "y" will be sent to the
device.
list net vlan
ITNCM-Case1=y/n)
y
ITNCM-Wait=#
ITNCM-Case2=#
ITNCM-Wait=#
- Example Six
- Add ITNCM-Case-Loop=4 - This will cause ITNCM to loop 4 times unless a match is found
sooner
- Add ITNCM-Case-Sleep=25000 - ITNCM will sleep 25 sec between loops of the case statement.
- Add ITNMC-Case-Timeout=25000 - ITNCM will wait 25 sec before timing out on the expected case
before moving to the next case.
- Add a case statement that will send a newline and wait for a # in the case of a # or y in the
case of y/n) prompt and wait for a # before finishing.
- Add a 2nd case statement that will not send anything for a # in the case of a # or y in the case
of y/n) prompt and wait for a # before finishing.
- Add ITNCM-Case-Loop=2 - set the loop count back to default.Add ITNCM-Case-Sleep=15000 - set
sleep time back to default.
- Add ITNMC-Case-Timeout=15000 - set sleep time back to default. If the LBL is not set then all
the ITNCM-Case1, ITNCM-Case2, ITNCM-Wait, ITNCM-Case-Done, ITNCM-Case-Loop, ITNCM-Case-Sleep and
ITNCM-Case_Timeout will be removed and "list net vlan","y","\r"," list all-properties " and "Y" will
be sent to the
device.
ITNCM-Case-Loop=4
ITNCM-Case-Sleep=25000
ITNCM-Case-Timeout=25000
list net vlan
ITNCM-Case1=y/n)
y
ITNCM-Wait=#
ITNCM-Case2=#
ITNCM-Wait=#
ITNCM-Case-Done
list all-properties
ITNCM-Case1=#
ITNCM-Case2=y/n)
y
ITNCM-Wait=#
ITNCM-Case-Done
ITNCM-Case-Loop=2
ITNCM-Case-Sleep=15000
ITNCM-Case-Timeout=15000
- Example Seven
- Is the same as 6 but will send “show sys software” between the two case statements. If the LBL
is not set then all the ITNCM-Case1, ITNCM-Case2, ITNCM-Wait, ITNCM-Case-Done, ITNCM-Case-Loop,
ITNCM-Case-Sleep and ITNCM-Case_Timeout will be removed and "list net vlan","y","\r","show sys
software ","list all-properties " and "Y" will be sent to the
device.
list net vlan
ITNCM-Case1=y/n)
y
ITNCM-Wait=#
ITNCM-Case2=#
ITNCM-Wait=#
ITNCM-Case-Done
show sys software
list net vlan
ITNCM-Case1=y/n)
ITNCM-Send=y
ITNCM-Wait=#
ITNCM-Case2=#
ITNCM-Wait=#
ITNCM-Case-Done
- Example Eight
- Add a case statement that will return a carriage return and wait for a # in the case of a # or y
and wait for a # in the case of y/n) prompt. If the LBL is not set then the ITNCM-Case1, ITNCM-Case2
and ITNCM-Case-Done all the ITNCM-Send and ITNCM-Wait commands will be removed and only the show sys
software, list net vlan will be sent to the device.