sentry-routing-table
Retrieves the routing table from a remote sentry.
Command properties
| Property | Description |
|---|---|
| Command type | Transforming |
| Required permission | Administrator |
| License usage | N/A |
| Parallel execution | Supported |
| Distributed execution | Not supported |
Syntax
Options
timeout=INT- RPC timeout in seconds. Accepts a value between 1 and 600. (Default:
30)
Input fields
| Field | Type | Required | Description |
|---|---|---|---|
| guid | string | Required | Sentry unique identifier. |
Output fields
| Field | Type | Description |
|---|---|---|
| guid | string | Sentry unique identifier. |
| type | string | Route type. For the values by operating system, see the table below. |
| protocol | string | Routing protocol that registered the route. For the values by operating system, see the table below. |
| destination | ipaddr | Destination network address. |
| mask | ipaddr | Subnet mask. |
| forward | ipaddr | Next hop (gateway) address. |
| metric | integer | Routing metric. |
| iface | string | Network interface name. Output only by Linux sentries. |
| _error | string | Error message added to the original record if an error occurs. |
The values of the type and protocol fields depend on the operating system where the sentry is installed:
| Operating system | type | protocol |
|---|---|---|
| Linux | Indirect for a route through a gateway (a route whose Flags column value in the output of the route -een command contains G), and Direct for any other route. | null |
| Windows | One of Direct, Indirect, Invalid, or Other. | One of Other, Local, NetMgmt, ICMP, EGP, GGP, Hello, RIP, IS_IS, ES_IS, IGRP, BBN, OSPF, BGP, Autostatic, Static, or StaticNonDOD. |
Linux sentries assign the Gateway column value in the output of the route -een command to the forward field, and the Metric column value to the metric field. Windows sentries assign the next hop address of the route to the forward field, and the first metric (Metric1) value to the metric field. Both operating systems retrieve only IPv4 routes.
Linux sentries read the routing table with the route command. If the net-tools package, which provides this command, is not installed on the sentry host, the retrieval fails and an error message is assigned to the _error field. For the packages required on a Linux sentry host, see Install required packages.
AIX, HP-UX, and Solaris sentries do not support retrieving the routing table. If you send a request to one of these sentries, the error message sentry method not found: getRoutingTable is assigned to the _error field.
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 23100 | no sentry rpc permission | A user without administrator privileges ran the command. |
| 23101 | invalid sentry rpc timeout. use timeout between 1 and 600. | The timeout option value is not an integer or is outside the range 1–600. |
Runtime errors
Errors are returned via the _error field:
| Error message | Description |
|---|---|
| guid is null | The guid field value in the input record is null. |
| guid should be string | The guid field value in the input record is not a string. |
| guid should be non empty string | The guid field value in the input record is an empty string. |
| not connected | The sentry is not connected. |
| timeout | The RPC request timed out. |
| disconnected | The sentry connection was already lost when the RPC request was sent. |
Other RPC exception messages may be returned depending on the state of the system where the sentry is installed.
Description
The sentry-routing-table command reads the guid field of each input record, sends an asynchronous RPC message to the corresponding sentry, and retrieves the routing table. The destination, mask, and forward fields are returned as the ipaddr type.
Results are returned in the order RPC response messages are received from sentries, so the output record order may differ from the input record order.
The maximum length of the asynchronous RPC request queue is 100 by default and can be adjusted using the logpresso.core.sentry_rpc_parallel environment variable.
To retrieve results from all Data Nodes at once in a cluster environment, use the sonar-sentry-routing-table command.
Examples
-
Retrieve the routing table from all sentries
sentry | fields guid | sentry-routing-tableRetrieves the current routing table from all connected sentries.
-
Retrieve with a 60-second timeout
sentry | fields guid | sentry-routing-table timeout=60Retrieves the routing table from sentries with the RPC timeout set to 60 seconds.
Change history
The sentry-routing-table command has been available since before Sonar 4.0.