# US 2021/0083938 A1 · Enhancing discovery patterns with shell command exit status

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0083938 A1
- Document ID: US20210083938A1
- Status: Published application
- Kind: A1
- Application number: 16/570,514
- Filed: 2019-09-13
- Published: 2021-03-18
- Earliest claimed: 2019-09-13
- Assignees: ServiceNow, Inc.
- Applicants: ServiceNow, Inc.
- Inventors: Robert Bitterfeld; Asaf Garty; Bary Solomon; Daniel Badyan
- Web page: https://patentgrep.com/patent/US20210083938A1

## CPC

- H04L 41/0853: by actively collecting configuration information or by backing up configuration information
- G06F 9/45512: {Command shells}
- H04L 41/04: Network management architectures or arrangements
- H04L 41/069: using logs of notifications; Post-processing of notifications
- H04L 41/0816: the condition being an adaptation, e.g. in response to network events
- H04L 47/762: triggered by the network
- H04L 67/1097: for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
- H04L 67/51: Discovery or management thereof, e.g. service location protocol [SLP] or web services
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computing system includes a discovery application that identifies a computing device associated with a managed network. The application determines a first command that causes the computing device to invoke a function that provides as output attributes of the computing device. The command includes a parameter that suppresses any textual error messages that the function places in the output. The application also determines a second command that causes the computing device to provide a numerical exit status of the function. The application causes the computing device to execute the first and second commands, and obtains the output and the numerical exit status. Based on the numerical exit status, the application determines that the function did not fully obtain the attributes of the computing device and, in response, (i) modifies the first command, and (ii) causes the computing device to execute the first command as modified and the second command.

## Claims

### Claim 1

A computing system comprising:
persistent storage disposed within a remote network management platform and configured to store, as one or more configuration items and on behalf of a managed network, a representation of computing resources associated with the managed network; and
a discovery application configured to perform operations comprising:
identifying a computing device associated with the managed network for incorporation into the representation;
determining a first command configured to cause the computing device to invoke a function configured to provide as output one or more attributes of the computing device, wherein the first command includes a parameter that suppresses any textual error messages that the function places in the output in response to its execution;
determining a second command configured to cause the computing device to provide a numerical exit status of the function;
causing the computing device to execute the first command and the second command;
obtaining, from the computing device, the output of the function and the numerical exit status of the function;
based on the numerical exit status of the function, determining that the function did not fully obtain the one or more attributes of the computing device; and
in response to determining that the function did not fully obtain the one or more attributes of the computing device, (i) modifying the first command, and (ii) causing the computing device to execute the first command as modified and the second command.

### Claim 2 (depends on 1)

The computing system of claim 1, wherein the operations further comprise:
obtaining, from the computing device, an updated output of the function and an updated numerical exit status of the function;
based on the updated numerical exit status of the function, determining that the function obtained the one or more attributes of the computing device;
based on determining that the function obtained the one or more attributes of the computing device, updating the representation of the computing resources associated with the managed network to include the one or more attributes of the computing device; and
storing, in the persistent storage, the representation as updated.

### Claim 3 (depends on 2)

The computing system of claim 2, wherein the representation is not updated when the numerical exit status of the function indicates that the function did not fully obtain the one or more attributes of the computing device.

### Claim 4 (depends on 1)

The computing system of claim 1, wherein determining that the function did not fully obtain the one or more attributes of the computing device comprises determining that the numerical exit status of the function is not equal to a predetermined value.

### Claim 5 (depends on 1)

The computing system of claim 1, wherein the operations further comprise:
determining that the output of the function is empty; and
determining that the function did not fully obtain the one or more attributes of the computing device further based on determining that the output of the function is empty.

### Claim 6 (depends on 1)

The computing system of claim 1, wherein modifying the first command comprises:
modifying the first command based on the numerical exit status of the function.

### Claim 7 (depends on 1)

The computing system of claim 1, wherein modifying the first command comprises:
determining a third command configured to cause the computing device to invoke another function configured to provide as output at least some of the one or more attributes.

### Claim 8 (depends on 1)

The computing system of claim 1, wherein the parameter is a first parameter, and wherein modifying the first command comprises:
modifying a second parameter included in the first command, wherein the second parameter specifies an input for the function.

### Claim 9 (depends on 1)

The computing system of claim 1, wherein the first command is modified based on a manual page associated with the first command.

### Claim 10 (depends on 1)

The computing system of claim 1, wherein the operations further comprise:
identifying an operating system of the computing device; and
determining each of the first command and the second command based on the operating system of the computing device.

### Claim 11 (depends on 1)

The computing system of claim 1, wherein each of the first command and the second command comprise operating system shell commands.

### Claim 12 (depends on 1)

The computing system of claim 1, wherein the parameter is configured to cause the computing device to suppress the textual error messages generated by the function by redirecting a standard error channel to a file system object configured to discard data provided thereto.

### Claim 13 (depends on 1)

The computing system of claim 1, wherein the second command is configured to cause the computing device to provide the numerical exit status of the function by providing a value of a particular operating system shell variable to a standard output channel.

### Claim 14 (depends on 1)

The computing system of claim 1, wherein the discovery application is executed by a server device remote to the computing device to implement an agentless discovery process for the computing device.

### Claim 15

A computer-implemented method comprising:
identifying, by a discovery application, a computing device associated with a managed network for incorporation into a representation of computing resources associated with the managed network, wherein the representation is stored, as one or more configuration items and on behalf of the managed network, in persistent storage disposed within a remote network management platform;
determining, by the discovery application, a first command configured to cause the computing device to invoke a function configured to provide as output one or more attributes of the computing device, wherein the first command includes a parameter that suppresses any textual error messages that the function places in the output in response to its execution;
determining, by the discovery application, a second command configured to cause the computing device to provide a numerical exit status of the function;
causing, by the discovery application, the computing device to execute the first command and the second command;
obtaining, from the computing device and by the discovery application, the output of the function and the numerical exit status of the function;
based on the numerical exit status of the function, determining, by the discovery application, that the function did not fully obtain the one or more attributes of the computing device; and
in response to determining that the function did not fully obtain the one or more attributes of the computing device, (i) modifying, by the discovery application, the first command, and (ii) causing, by the discovery application, the computing device to execute the first command as modified and the second command.

### Claim 16 (depends on 15)

The computer-implemented method claim 15, further comprising:
obtaining, from the computing device, an updated output of the function and an updated numerical exit status of the function;
based on the updated numerical exit status of the function, determining that the function obtained the one or more attributes of the computing device;
based on determining that the function obtained the one or more attributes of the computing device, updating the representation of the computing resources associated with the managed network to include the one or more attributes of the computing device; and
storing, in the persistent storage, the representation as updated.

### Claim 17 (depends on 16)

The computer-implemented method claim 16, wherein the representation is not updated when the numerical exit status of the function indicates that the function did not fully obtain the one or more attributes of the computing device.

### Claim 18 (depends on 15)

The computer-implemented method claim 15, wherein modifying the first command comprises:
determining a third command configured to cause the computing device to invoke another function configured to provide as output at least some of the one or more attributes.

### Claim 19 (depends on 15)

The computer-implemented method claim 15, further comprising:
identifying an operating system of the computing device; and
determining each of the first command and the second command based on the operating system of the computing device.

### Claim 20

An article of manufacture including a non-transitory computer-readable medium, having stored thereon program instructions that, upon execution by a computing system, cause the computing system to perform operations comprising:
identifying a computing device associated with a managed network for incorporation into a representation of computing resources associated with the managed network, wherein the representation is stored, as one or more configuration items and on behalf of the managed network, in persistent storage disposed within a remote network management platform;
determining a first command configured to cause the computing device to invoke a function configured to provide as output one or more attributes of the computing device, wherein the first command includes a parameter that suppresses any textual error messages that the function places in the output in response to its execution;
determining a second command configured to cause the computing device to provide a numerical exit status of the function;
causing the computing device to execute the first command and the second command;
obtaining, from the computing device, the output of the function and the numerical exit status of the function;
based on the numerical exit status of the function, determining that the function did not fully obtain the one or more attributes of the computing device; and
in response to determining that the function did not fully obtain the one or more attributes of the computing device, (i) modifying the first command, and (ii) causing the computing device to execute the first command as modified and the second command.
