Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

os-telegraf: PF input fails when Telegraf runs as telegraf user on OPNsense 26.7.1 (works immediately as root)

Aperta
#5,577 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva

Direzione di ricerca

Riproduci il problema con /sbin/pfctl -si e il comando Telegraf utilizzando sia root sia l’utente telegraf, quindi confronta l’output di PF e i permessi di /dev/pf. La modifica è completa quando l’utente telegraf può raccogliere ricerche, contatori di stato e altre metriche PF senza eseguire il servizio come root.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

incomplete

Environment
• OPNsense CE 26.7.1
• FreeBSD 15.1
• os-telegraf 1.12.15
• Telegraf 1.39.1
Description
After upgrading to OPNsense 26.7.1, PF metrics stopped updating.
Affected metrics include:
• PF Searches/s
• New PF States/s
• Closed PF States/s
pf.entries continues to work intermittently, but searches and related counters stop updating because the PF input plugin cannot read the expected output from pfctl.
Investigation
Running PF directly as root:
/sbin/pfctl -si
returns:
Status: Enabled
...
searches ...
Running Telegraf as root:
/usr/local/bin/telegraf
--input-filter pf
--test
--config /usr/local/etc/telegraf.conf
produces valid metrics:
pf,...
entries=442i
searches=4189467i
...
However, running exactly the same commands as the telegraf user:
su -m telegraf -c "/sbin/pfctl -si"
returns:
Status: Disabled
and
su -m telegraf -c "/usr/local/bin/telegraf --input-filter pf --test --config /usr/local/etc/telegraf.conf"
returns:
E! [inputs.pf] Error in plugin:
struct data for tag "searches" not found in pfctl output
Permissions checked
telegraf is a member of the proxy group:
uid=884(telegraf)
gid=884(telegraf)
groups=884(telegraf),59(unbound),62(proxy)
/dev/pf permissions:
crw-rw---- root proxy
ACL:
user::rw-
group::rw-
other::---
No securelevel restrictions:
kern.securelevel = -1
Workaround
Changing the Telegraf service to run as root:
telegraf_user=root
telegraf_group=wheel
makes all PF metrics immediately start working again after restarting Telegraf.
Expected behavior
The telegraf user (member of the proxy group) should be able to collect PF statistics as in previous OPNsense releases.
Actual behavior
When running as the telegraf user:
• pfctl -si reports Status: Disabled
• PF statistics are incomplete
• Telegraf PF input fails because expected fields such as searches are missing.
When running as root, everything works correctly.


This appears to be either:
• a regression in OPNsense 26.7.1,
• or a FreeBSD 15.1 PF permission/regression affecting non-root users.

Lingua principale
PHP
Stelle
1.2k
Fork
880
Merge medio
1g 23h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opnsense/plugins

Tutte le issue di opnsense/plugins

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.