node-port-group
Queries port group data downloaded to the Data Node through the policy synchronization module.
Command properties
| Property | Description |
|---|---|
| Command type | Driver |
| Required permission | Administrator |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
In the syntax above, name is available starting with 4.0.2609.0.
Options
guid=STR- Port group GUID. In the 5.0 series (through 5.0.2605.2), this is the only way to specify a port group. In the 4.0 series (4.0.2609.0 and later), it cannot be used together with
name. When specified, queries the port entries included in that port group. When omitted, lists a summary of all port groups. name=STR- Port group name (cannot be used together with
guid). When specified, queries the port entries included in that port group. When omitted, lists a summary of all port groups. This option is available starting with 4.0.2609.0.
Output fields
When either the guid or name option is specified:
| Field | Type | Description |
|---|---|---|
protocol | string | Protocol (tcp, udp, etc.) |
start | integer | Start of port range |
end | integer | End of port range |
description | string | Port entry description |
app_code | string | App code |
app_built_in | boolean | Whether this is a built-in app |
When both the guid and name options are omitted:
| Field | Type | Description |
|---|---|---|
id | integer | Port group ID |
guid | string | Port group GUID |
name | string | Port group name |
description | string | Port group description |
port_count | integer | Number of port entries |
user_name | string | Creator name |
user_guid | string | Creator GUID |
Error codes
Parse errors
| Error code | Message | Description |
|---|---|---|
| 300310 | no permission for node-port-group | Administrator privileges are required. |
| 300311 | invalid guid format for node-port-group | The guid option value is not a valid GUID format. |
| 300312 | port group [guid] not found for node-port-group | No port group exists for the specified GUID. |
| 300313 | Port group not found by name for node-port-group. | No port group exists with the name specified in the name option. Available starting with 4.0.2609.0, which has the name option. |
| 300314 | Duplicate port group name for node-port-group. | More than one port group exists with the name specified in the name option. Available starting with 4.0.2609.0, which has the name option. |
| 300315 | Specify only one of 'guid' or 'name' option in the node-port-group command. | Both the guid and name options are specified. Available starting with 4.0.2609.0, which has the name option. |
| 300316 | Cannot load port group for node-port-group. | An error occurred while reading data while querying by the name option. Available starting with 4.0.2609.0, which has the name option. |
Runtime errors
None
Description
The node-port-group command queries port group data downloaded from the Control Node to the Data Node through the policy synchronization module.
When either the guid or name option is specified, it returns the individual port entries (protocol, start port, end port, description) included in that port group. When both options are omitted, it returns a summary list of all synchronized port groups (name, GUID, port count, etc.).
In the 4.0 series (4.0.2609.0 and later), you can use the name option to specify a port group by name instead of GUID. Specifying both options at the same time causes an error, as does specifying a name that does not exist or that matches more than one group.
Examples
-
List all port groups
node-port-groupQueries the summary information of all port groups synchronized to the Data Node.
-
Query port entries of a specific port group
node-port-group guid=550e8400-e29b-41d4-a716-446655440000Queries the port entries included in the port group with the specified GUID.
-
Query port entries of a port group by name (4.0 series, 4.0.2609.0 and later)
node-port-group name=web_portsQueries the port entries included in the port group with the specified name.
Change history
| Target | Introduced in |
|---|---|
The node-port-group command | Before Sonar 4.0 |
The name option | 4.0.2609.0 |