Project

General

Profile

Actions

Bug #10522

closed

Telegraf, Netstat fails (missing lsof)

Added by Russell Morris almost 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Category:
Telegraf
Target version:
-
Start date:
05/02/2020
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

Enabling netstat from the web interface (as part of Telegraf) ... fails. The error message can be seen from a command line test run,
telegraf --test --input-filter netstat --config /usr/local/etc/telegraf.conf

2020-05-03T03:18:31Z I! Starting Telegraf 1.13.4
2020-05-03T03:18:31Z E! [inputs.netstat] Error in plugin: error getting net connections info: exec: "lsof": executable file not found in $PATH
2020-05-03T03:18:31Z E! [telegraf] Error running agent: One or more input plugins had an error

The fix is to manually install lsof, but shouldn't it be part of the package, to avoid this extra manual step?

Thanks!

Actions #1

Updated by Jim Pingle almost 4 years ago

  • Category set to Telegraf
Actions #2

Updated by Manuel Piovan almost 4 years ago

can't reproduce, it work for me
[2.4.5-RELEASE][]/root: telegraf --test --input-filter netstat --config /usr/local/etc/telegraf.conf
2020-05-04T18:55:20Z I! Starting Telegraf 1.13.4

netstat,host=pfSense.trmultiservice.lab tcp_close=0i,tcp_close_wait=0i,tcp_closing=0i,tcp_established=3i,tcp_fin_wait1=0i,tcp_fin_wait2=0i,tcp_last_ack=0i,tcp_listen=14i,tcp_none=0i,tcp_syn_recv=0i,tcp_syn_sent=0i,tcp_time_wait=0i,udp_socket=17i 1588618521000000000

the path is /usr/local/sbin/lsof
check your config or
try to reinstall lsof with

pkg install --force lsof-4.93.2_9,8

or ask the forum

Actions #3

Updated by Russell Morris almost 4 years ago

Yes, it works for me as well - after I manually install lsof. The reason I raised this is that lsof should be included when telegraf is installed ... agreed?

Thanks!

Actions #4

Updated by Viktor Gurov almost 4 years ago

correct, see https://github.com/influxdata/telegraf/blob/master/plugins/inputs/net/NETSTAT_README.md:

Netstat Input Plugin

This plugin collects TCP connections state and UDP socket counts by using lsof.

Fix:
https://github.com/pfsense/FreeBSD-ports/pull/858

Actions #5

Updated by Jim Pingle almost 4 years ago

  • Status changed from New to Pull Request Review
Actions #6

Updated by Renato Botelho almost 4 years ago

  • Status changed from Pull Request Review to Feedback
  • Assignee set to Renato Botelho
  • % Done changed from 0 to 100

PR has been merged. Thanks!

Actions #7

Updated by Russell Morris almost 4 years ago

Thanks very much for the quick action!

Actions #8

Updated by Viktor Gurov almost 4 years ago

  • Status changed from Feedback to Resolved

Good:

New packages to be INSTALLED:
    pfSense-pkg-Telegraf: 0.9_4 [pfSense]
    lsof: 4.93.2_9,8 [pfSense]
    telegraf: 1.13.4_1 [pfSense]

Number of packages to be installed: 3

The process will require 66 MiB more space.
14 MiB to be downloaded.
[1/3] Fetching pfSense-pkg-Telegraf-0.9_4.txz: . done
[2/3] Fetching lsof-4.93.2_9,8.txz: .......... done
[3/3] Fetching telegraf-1.13.4_1.txz: .......... done
...

Actions

Also available in: Atom PDF