rbicelli / pfsense-zabbix-template

Zabbix Template for pfSense
Apache License 2.0
244 stars 107 forks source link

Small typo in pfsense_zbx.php #78

Closed GuillaumeHullin closed 3 years ago

GuillaumeHullin commented 3 years ago

Hi I got the following error:

PHP ERROR: Type: 1, File: /root/scripts/pfsense_zbx.php, Line: 217, Message: Uncaught Error: Call to undefined function unlik() in /root/scripts/pfsense_zbx.php:217
Stack trace:
#0 /root/scripts/pfsense_zbx.php(190): pfz_speedtest_exec('em0', '192.168.1.10')
#1 /root/scripts/pfsense_zbx.php(1208): pfz_speedtest_cron()
#2 {main}
thrown @ 2021-07-08 15:00:00

https://github.com/rbicelli/pfsense-zabbix-template/blob/8e340822e190d707519ba83389805dc8da3b4635/pfsense_zbx.php#L217

Replace @unlik($filerun); by @unlink($filerun);

rbicelli commented 3 years ago

Thanks, fixed. A feedback is appreciated for the speedtest feature, since is new and I'm also testing it.

GuillaumeHullin commented 3 years ago

Thanks, fixed. A feedback is appreciated for the speedtest feature, since is new and I'm also testing it.

I'm actually testing it right now. I'm testing with pfSense 2.5.2 ... and somehow it doesnt work yet :) looking into it.

FYI on pfSense 2.5 it's Python 3.8 installed not 3.7... so I would advise that in the Readme you change your install command by:

pkg update && pkg install -y  -g 'py*-speedtest-cli'

So that will work for 3.7 and 3.8. Also, I'm gonna add this command in the Schellcmd service... so that it is installed even after upgrades.

Right now the problem I have is that the /tmp/speedtest-em0 and /tmp/speedtest-em1 are created empty.... I'll open an issue if I find something useful.

rbicelli commented 3 years ago

Have you tried to run speedtest via cli?

GuillaumeHullin commented 3 years ago

Yes and that work. Now basically the problem I see is that it doesnt register the Cron... This function seems to not work (but I can add the cron manually successfully):

function pfz_speedtest_cron_install($enable=true){
    //Install Cron Job
    $command = "/usr/local/bin/php " . __FILE__ . " speedtest_cron"; 
    install_cron_job($command, $enable, $minute = "*/15", "*", "*", "*", "*", "root", false);
}           
GuillaumeHullin commented 3 years ago

@rbicelli solved. I created a separate issue that you can close during your commit :)