---
sourceDocument: Referência de API do Xanadu
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência de API do Xanadu

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# LSOFParser - Global

# LSOFParser - Global {#ariaid-title1}

* Versão de lançamento: Xanadu
* 
* Atualizado 1 de ago. de 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

A inclusão de script LSOFParser fornece métodos para analisar a saída do comando lsof : `lsof -i4TCP -n -P -F pcnfT`.

Use esta inclusão de script com um script de descoberta quando precisar analisar a saída de lsof.

## LSOFParser - erro (cadeia de caracteres mensagem) {#ariaid-title2}

Gera a mensagem de erro especificada.
{#r_LSOFP-error_S__table_s4s_td2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| msg | Cadeia de caracteres | A mensagem de erro |
[Tabela 1. Parâmetros]

{#r_LSOFP-error_S__table_s4s_td2_5t} {#r_LSOFP-error_S__table_t4s_td2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 2. Retorna]

{#r_LSOFP-error_S__table_t4s_td2_5t}

## LSOFParser -- initFileDescriptor() {#ariaid-title3}

Inicializa o processo do descritor de arquivo.
{#r_LSOFP-initFileDescriptor__table_j5f_kd2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 3. Parâmetros]

{#r_LSOFP-initFileDescriptor__table_j5f_kd2_5t} {#r_LSOFP-initFileDescriptor__table_k5f_kd2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 4. Retorna]

{#r_LSOFP-initFileDescriptor__table_k5f_kd2_5t}

## LSOFParser -- initProcess() {#ariaid-title4}

Inicializa o processo do analisador.
{#r_LSOFP-initProcess__table_omf_cd2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 5. Parâmetros]

{#r_LSOFP-initProcess__table_omf_cd2_5t} {#r_LSOFP-initProcess__table_pmf_cd2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 6. Retorna]

{#r_LSOFP-initProcess__table_pmf_cd2_5t}

## LSOFParser - on_c(cadeia de caracteres linha) {#ariaid-title5}

Define o comando atual.
{#r_LSOFP-on_c_S__table_wqf_fb2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| linha | Cadeia de caracteres | O comando |
[Tabela 7. Parâmetros]

{#r_LSOFP-on_c_S__table_wqf_fb2_5t} {#r_LSOFP-on_c_S__table_xqf_fb2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 8. Retorna]

{#r_LSOFP-on_c_S__table_xqf_fb2_5t}

## LSOFParser - on_endFileDescriptor() {#ariaid-title6}

Encerra o processo do descritor de arquivo.
{#r_LSOFP-on_endFileDescriptor__table_eqx_nc2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 9. Parâmetros]

{#r_LSOFP-on_endFileDescriptor__table_eqx_nc2_5t} {#r_LSOFP-on_endFileDescriptor__table_fqx_nc2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 10. Retorna]

{#r_LSOFP-on_endFileDescriptor__table_fqx_nc2_5t}

## LSOFParser - on_endProcess() {#ariaid-title7}

Encerra o processo do analisador.
{#r_LSOFP-on_endProcess__table_ogc_vc2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 11. Parâmetros]

{#r_LSOFP-on_endProcess__table_ogc_vc2_5t} {#r_LSOFP-on_endProcess__table_pgc_vc2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 12. Retorna]

{#r_LSOFP-on_endProcess__table_pgc_vc2_5t}

## LSOFParser - on_f(cadeia de caracteres linha) {#ariaid-title8}

Define o descritor de arquivo atual.
{#r_LSOFP-on_f_S__table_ywq_nb2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| linha | Cadeia de caracteres | O descritor de arquivo |
[Tabela 13. Parâmetros]

{#r_LSOFP-on_f_S__table_ywq_nb2_5t} {#r_LSOFP-on_f_S__table_zwq_nb2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 14. Retorna]

{#r_LSOFP-on_f_S__table_zwq_nb2_5t}

## LSOFParser - on_n(cadeia de caracteres linha) {#ariaid-title9}

Define o endereço atual.
{#r_LSOFP-on_n_S__table_lx3_vb2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| linha | Cadeia de caracteres | O endereço |
[Tabela 15. Parâmetros]

{#r_LSOFP-on_n_S__table_lx3_vb2_5t} {#r_LSOFP-on_n_S__table_mx3_vb2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 16. Retorna]

{#r_LSOFP-on_n_S__table_mx3_vb2_5t}

## LSOFParser - on_p(cadeia de caracteres linha) {#ariaid-title10}

Define o PID atual.
{#r_LSOFP-on_p_S__table_sm5_v12_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| linha | Cadeia de caracteres | O PID |
[Tabela 17. Parâmetros]

{#r_LSOFP-on_p_S__table_sm5_v12_5t} {#r_LSOFP-on_p_S__table_tm5_v12_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 18. Retorna]

{#r_LSOFP-on_p_S__table_tm5_v12_5t}

## LSOFParser - on_T(cadeia de caracteres linha) {#ariaid-title11}

Define o estado atual.
{#r_LSOFP-on_T_S__table_x2h_fc2_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| linha | Cadeia de caracteres | O estado |
[Tabela 19. Parâmetros]

{#r_LSOFP-on_T_S__table_x2h_fc2_5t} {#r_LSOFP-on_T_S__table_y2h_fc2_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 20. Retorna]

{#r_LSOFP-on_T_S__table_y2h_fc2_5t}

## LSOFParser - parse(cadeia de caracteres lsofOutput) {#ariaid-title12}

Analisa a saída `lsof` especificada.
Os resultados estão disponíveis em matrizes de conexões e ouvintes, e os erros são registrados em errorString() e isValid().
{#r_LSOFP-parse_S__table_lbn_g12_5t__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| lsofSaída | Cadeia de caracteres | A saída `lsof` |
[Tabela 21. Parâmetros]

{#r_LSOFP-parse_S__table_lbn_g12_5t} {#r_LSOFP-parse_S__table_mbn_g12_5t__entry__2}

| Tipo | Descrição |
|-|-|
| vazio |   |
[Tabela 22. Retorna]

{#r_LSOFP-parse_S__table_mbn_g12_5t}

