Server API reference › API reference › API implementation and reference
LSOFParser- Global
The LSOFParser script include provides methods to parse the output of the lsof command: lsof -i4TCP -n -P -F pcnfT.
Use this script include with a discovery script when you need to parse lsof output.
Parent Topic:Server API reference
LSOFParser - error(String msg)
Generates the specified error message.
| Name | Type | Description |
|---|
| msg | String | The error message |
LSOFParser - initFileDescriptor()
Initializes the file descriptor process.
LSOFParser - initProcess()
Initializes the parser process.
LSOFParser - on_c(String line)
Sets the current command.
| Name | Type | Description |
|---|
| line | String | The command |
LSOFParser - on_endFileDescriptor()
Closes the file descriptor process.
LSOFParser - on_endProcess()
Closes the parser process.
LSOFParser - on_f(String line)
Sets the current file descriptor.
| Name | Type | Description |
|---|
| line | String | The file descriptor |
LSOFParser - on_n(String line)
Sets the current address.
| Name | Type | Description |
|---|
| line | String | The address |
LSOFParser - on_p(String line)
Sets the current PID.
| Name | Type | Description |
|---|
| line | String | The PID |
LSOFParser - on_T(String line)
Sets the current state.
| Name | Type | Description |
|---|
| line | String | The state |
LSOFParser - parse(String lsofOutput)
Parses the specified lsof output.
Results are available in connections and listeners arrays, and errors are recorded in errorString() and isValid().
| Name | Type | Description |
|---|
| lsofOutput | String | The lsof output |