Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message in Telegraf logging relating to telegraf_pfifgw.php after upgrade to OPNsense 24.1 #57

Open
digibaro opened this issue Feb 1, 2024 · 9 comments

Comments

@digibaro
Copy link

digibaro commented Feb 1, 2024

After the upgrade to OPNSense 24.1 the following error messages are shown which results in no Firewall (drops/country/firewall) and Interface information visible in the OPNSense dashboard. The CPU/Memory graphs are fine

I experimented with non-root and root rights for Telegraf in the OPNSense GUI.

Telegraf log error message in OPNSense GUI
E! [inputs.exec] Error in plugin: exec: exit status 255 for command "sudo /usr/local/bin/telegraf_pfifgw.php":

CLI error message in OPNSense
root@firewall:/usr/local/bin # sudo telegraf_pfifgw.php

Fatal error: Uncaught Error: Call to undefined function get_interfaces_info() in /usr/local/bin/telegraf_pfifgw.php:13
Stack trace:
#0 {main}
thrown in /usr/local/bin/telegraf_pfifgw.php on line 13

It looks like some function get_interfaces_info(); has been removed fom require_once("interfaces.inc");

$ifsinfo = get_interfaces_info();

@cyberpunked1985
Copy link

Same issue here, all after the 24.1 opnsense upgrade, telegraf_pfifgw.php getting errors.
Possible opnsense problem?

@th3voic3
Copy link

th3voic3 commented Feb 2, 2024

To add to this.
The function get_interfaces_info was removed in this commit:
opnsense/core@4d495ea

See:
dblanque/opnsense-zabbix#1

@digibaro
Copy link
Author

digibaro commented Feb 2, 2024

I copied the function (block) get_interfaces_info from interfaces.inc (23.x) to the script telegraf_pfifgw.php under the require_once statements.

Now the script works again. Up to the owner to add the function to the script or transform it to available OPNSense 24.1 functions.

@digibaro digibaro changed the title Error message in Telegraf logging relating to telegraf_pfifgw.php Error message in Telegraf logging relating to telegraf_pfifgw.php after upgrade to OPNsense 24.1 Feb 2, 2024
@dicepvp
Copy link

dicepvp commented Feb 9, 2024

i am a little bit confused on how to fix this issue myself. like what exactly am i supposed to copy into the telegraf_pfifgw.php. could someone send me the exact file please

@digibaro
Copy link
Author

digibaro commented Feb 9, 2024

i am a little bit confused on how to fix this issue myself. like what exactly am i supposed to copy into the telegraf_pfifgw.php. could someone send me the exact file please

The requested file. I hope nothing breaks with the conversion between OS and editors.

telegraf_pfifgw.php.txt

@jsa91
Copy link

jsa91 commented Feb 20, 2024

The requested file. I hope nothing breaks with the conversion between OS and editors.

telegraf_pfifgw.php.txt

Thank you! I found typo starting at line 105 though. Here is a corrected version:

telegraf_pfifgw.php.txt

@superczar
Copy link

Thank you @jsa91
This fixed my problem too.

one minor issue - The gateway summary panel shows all gateways as unmonitored although that is not the case. Any pointers to what could be causing this?

@Taralas
Copy link

Taralas commented May 1, 2024

@superczar Same on my end. This is a good workaround, but it would be nice to get this updated to work with the current supported versions.

@TheDublord
Copy link

TheDublord commented Jul 7, 2024

The requested file. I hope nothing breaks with the conversion between OS and editors.
telegraf_pfifgw.php.txt

Thank you! I found typo starting at line 105 though. Here is a corrected version:

telegraf_pfifgw.php.txt

For me, even with the new file I get the same error in the Telegraf OPNsense log, but the command line error is "No input file specified". There doesnt appear to be anything in the file itself echoing that, so many it is an issue with PHP. I havent gotten any further in the install process so I dont know if its just a missing dep. After running sudo telegraf_pfifgw.php I used echo $? to get the exit code of the last command and as mentioned, its exiting with 255.

EDIT: I think I fixed it by enabling RFC5424 and making sure my remote logging is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants