Hi!
No idea where to put it, I’ve been browsing the internet for answers but cannot find any.
I’m trying to pull out data from my DPI server, so on that server I have a socket and a Telegraf agent.
The socket returns output when I poll it with NC:
sudo nc -U /var/run/netifyd/netifyd.sock | jq . -C
{
"established": false,
"flow": {
"ct_id": 0,
"ct_mark": 0,
"detected_application": 0,
"detected_application_name": "Unknown",
"detected_protocol": 81,
"detected_protocol_name": "ICMP",
"detection_guessed": 0,
"dhc_hit": false,
"digest": "########",
"first_seen_at": 1635509658588,
"first_update_at": 1635509658588,
"ip_nat": false,
"ip_protocol": 1,
"ip_version": 4,
"last_seen_at": 1635509658588,
"local_ip": "########",
"local_mac": "########",
"local_origin": true,
"local_port": 0,
"other_ip": "########",
"other_mac": "########",
"other_port": 0,
"other_type": "remote",
"vlan_id": 0
},
"interface": "########",
"internal": true,
"type": "flow"
}
However, the Telegraf socket listener does absolutely nothing, socket_listener part of the config:
# Generic socket listener capable of handling multiple socket types.
[[inputs.socket_listener]]
service_address = "unix:///var/run/netifyd/netifyd.sock"
# service_address = "unixgram:///tmp/telegraf.sock"
## Change the file mode bits on unix sockets. These permissions may not be
## respected by some platforms, to safely restrict write permissions it is best
## to place the socket into a directory that has previously been created
## with the desired permissions.
## ex: socket_mode = "777"
# socket_mode = ""
## Maximum number of concurrent connections.
## Only applies to stream sockets (e.g. TCP).
## 0 (default) is unlimited.
max_connections = 1
## Read timeout.
## Only applies to stream sockets (e.g. TCP).
## 0 (default) is unlimited.
read_timeout = "5s"
## Optional TLS configuration.
## Only applies to stream sockets (e.g. TCP).
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Enables client authentication if set.
# tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
## Maximum socket buffer size (in bytes when no unit specified).
## For stream sockets, once the buffer fills up, the sender will start backing up.
## For datagram sockets, once the buffer fills up, metrics will start dropping.
## Defaults to the OS default.
# read_buffer_size = "64KiB"
## Period between keep alive probes.
## Only applies to TCP sockets.
## 0 disables keep alive probes.
## Defaults to the OS configuration.
# keep_alive_period = "5m"
## Data format to consume.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "json"
## Content encoding for message payloads, can be set to "gzip" to or
## "identity" to apply no encoding.
# content_encoding = "identity"
The output link to influx is also in there but that part works fine. Output of the telegram agent is:
2021-10-29T12:17:32Z I! Starting Telegraf 1.20.3
2021-10-29T12:17:32Z I! Loaded inputs: socket_listener
2021-10-29T12:17:32Z I! Loaded aggregators:
2021-10-29T12:17:32Z I! Loaded processors:
2021-10-29T12:17:32Z I! Loaded outputs: influxdb_v2
2021-10-29T12:17:32Z I! Tags enabled: host=ubnt-home
2021-10-29T12:17:32Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"ubnt-home", Flush Interval:10s
2021-10-29T12:17:32Z D! [agent] Initializing plugins
2021-10-29T12:17:32Z D! [agent] Connecting outputs
2021-10-29T12:17:32Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2021-10-29T12:17:32Z D! [agent] Successfully connected to outputs.influxdb_v2
2021-10-29T12:17:32Z D! [agent] Starting service inputs
2021-10-29T12:17:32Z I! [inputs.socket_listener] Listening on unix:///var/run/netifyd/netifyd.sock
2021-10-29T12:17:42Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:17:52Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:18:02Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:18:12Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:18:22Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:18:32Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:18:42Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:18:52Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:19:02Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:19:12Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:19:22Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:19:32Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:19:42Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:19:52Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:20:02Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:20:12Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:20:22Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:20:32Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:20:42Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:20:52Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:21:02Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:21:12Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:21:22Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:21:32Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:21:42Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:21:52Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:22:02Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-29T12:22:12Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
Extra bug after is that my socket file is gone after I kill the telegraf agent. Have to reboot the netfiy service to get it back.
I’d be grateful for some insights…