tw_injectip
Deprecated utility
The tw_injectip
utility is now deprecated and may be removed in future releases. Its functionality is available in the tw_scan_control
utility which has all of the same options.
The tw_injectip
utility enables you to scan IP ranges using the command line.
Recommendation
Use the BMC Atrium Discovery user interface to perform the functionality provided by the tw_injectip
command line utility (see Controlling discovery). If you choose to run the utility, read the documentation in this section to learn its usage and to understand the risks and potential impact on your environment.
To use the utility, type the following command at the $TIDEWAY/bin/
directory:
tw_injectip [options] range
where:
- range is a single IP address or range (for example,
172.17.1.1
or172.17.1.1-5
), a space-separated list of IP addresses, a range of IP addresses, or a subnet (for example,172.17.1.0/24
). If you use the
--file
option, a range refers to a file that contains IP addresses.
- options are any of the options described in the following table and the common command line options described in Using command line utilities.
Command Line Option |
Description |
---|---|
|
Removes all the recurrent ranges that are not currently being scanned from the Reasoning pipeline. |
|
Specify a company name to use for a scan in a multitenant deployment. |
|
A file or a list of files of IP addresses. They must be plain text files with a new line delimited list of IP addresses. |
|
Specifies a label for the scan. |
|
Specifies a vault passphrase to use |
|
Specifies to scan the IP addresses (located in a file or listed at the command prompt) in random order |
|
Specifies to add a daily recurrent range. This option specifies a recurrent range scan that must be modified with the |
|
Specifies the duration that the recurring scan lasts (in hours). |
|
Specifies the start time for recurrent ranges (in hours) after midnight |
|
Replace (edit) the specified scheduled discovery run. The discovery run is specified using its ID which can be determined using a search query like the following: |
|
Specifies the scan level to use. This may be one of the following:
|
|
Specifies that Reasoning will start. This is equivalent to clicking the START ALL SCANS button. |
|
Specifies that Reasoning will stop. This is equivalent to clicking the STOP ALL SCANS button. |
|
Specifies the name of the BMC Atrium Discovery user. If a user is not specified, BMC Atrium Discovery uses the default, |
User examples
In the following examples, the user name is system
and the password is not specified on the command line. The utility prompts for the password after you enter the command. Type the commands on a single line; line breaks are provided in the examples to make them easier to read.
Note
The utility is designed to handle only snapshot and daily scans; no weekly or monthly schedules are available within this tool. For this functionality, use the user interface.
Specifying an immediate scan of a single IP address
$TIDEWAY/bin/tw_injectip --username system 192.168.0.1
Specifying an immediate scan of a single IP address at Sweep Scan
level
$TIDEWAY/bin/tw_injectip --username system -l 'Sweep Scan' 192.168.0.1
Specifying an immediate scan of a range of IP addresses
$TIDEWAY/bin/tw_injectip --username system 192.168.0.1-10
Specifying an immediate scan of IP addresses listed in a file
$TIDEWAY/bin/tw_injectip --username system --file ~/scanlist
Specifying a scheduled scan of IP addresses listed in a file at 03.00
$TIDEWAY/bin/tw_injectip --username system --recur-daily --recurrence-start=3 --file ~/scanlist
Specifying a two-hour scheduled scan of IP addresses listed in a file
$TIDEWAY/bin/tw_injectip --username system --recur-daily --recurrence-duration=2 --file ~/scanlist
Specifying a two-hour scheduled scan of IP addresses listed in a file and label it TEST
$TIDEWAY/bin/tw_injectip --username system --recur-daily --recurrence-duration=2 --scheduled-label=TEST --file ~/scanlist
Replacing a discovery run
The following example illustrates how to find the ID of a scheduled discovery run and use it to update the run's label. The way that this option works is to delete and replace the scan, so it is important to specify all essential parameters (recur-daily, recurrence-duration and/or recurrence-start, and a range).
In the Enter Generic Query page, enter the following query and click Run Query:
search IPRange where scan_type='Scheduled' show range_id, label
- Copy the ID from the range that you want to replace and use it to specify the ID of the scan that you want to replace.
Enter the command. This example illustrates how a system user replaces a specified scan with a daily six-hour scan of the range
192.168.0.1-10
and a label ofUPDATED
.tw_injectip -u system -p system --recur-daily --recurrence-duration=6 --label=UPDATED --replace 85be3f2d9ef810d84c1089485c704129 192.168.0.1-10
Comments