rbicelli / pfsense-zabbix-template

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

pfsense_zbx.php script version not being updated #159

Closed denisgrilliGMSL closed 4 months ago

denisgrilliGMSL commented 7 months ago

Despite the script get updated quite frequently the version inside it still the same. It would be useful to get that updated with any release so do know when need to be updated in the pfsense box.

GuillaumeHullin commented 7 months ago

Can you give a bit more detail? FYI, the script works fine to tell me when there is an update on my side. Which version of pfSense do you use and what data is being reported?

denisgrilliGMSL commented 7 months ago

Sorry, I was not clear in my explanation.

Inside pfsense_zbx.php there is a section like this:

pfsense_zbx.php - pfSense Zabbix Interface Version 1.1.1 - 2021-10-24

Written by Riccardo Bicelli r.bicelli@gmail.com This program is licensed under Apache 2.0 License */

As you can see the version number still from 2021 when actually the script last change is from a few months ago.

I know is not something important from the operation point of view but it would be very useful for this version number to updated so that we know when to update it on our pfsense boxes. Also the template file has a comment in the description referring to this script version which as well, it would be useful to have aligned (as for: this template works with pfsense_zbx.php version >= 1.x.x ) just to know in case of any incompatibility.

rbicelli commented 7 months ago

Ok I understand the point. Would it be nice to have an item in Zabbix template that grabs the script version directly from the script?

GuillaumeHullin commented 7 months ago

@denisgrilliGMSL what about adding the download of the script to your pfSense startup with the package ShellCmd

curl --create-dirs -o /root/scripts/pfsense_zbx.php https://raw.githubusercontent.com/rbicelli/pfsense-zabbix-template/master/pfsense_zbx.php

So that every time you reboot pfSense (for upgrade) then you get the latest version. Also it means that if you restore pfSense from a config backup... then your script is redownloaded automatically.

denisgrilliGMSL commented 7 months ago

@rbicelli : that would be very useful but I don't dare to ask.. I know how busy you are.

@GuillaumeHullin: I will look into this but I can foreseen some issue with that. For instance if an updated version of the script has a bug and stop working can cause issue to all our pfsenses... We normally do test any new version before to send it to production and we do staged upgrade in production as well. But it is definitely something I would explore further.

GuillaumeHullin commented 7 months ago

@denisgrilliGMSL well I totally understand I do the same for my pfSense which are in production... so my solution have been to fork the repo and make the download link to my fork. Then, when there are updates I can pull them into my repo and then I can either run the curl on every pfSense or wait for reboot if I have a pfsense upgrade.

aalmond-cb commented 4 months ago

Having the comment updated each time the script is updated would be very helpful. We manage over 30 firewalls with pfSense, and it's hard to know if they have the latest version of the script.

rbicelli commented 4 months ago

Hello, I'm adding a new item "Script Version" which is tied to a constant defined in the script. Will release soon.

rbicelli commented 4 months ago

Added item and trigger.

marcopape commented 1 month ago

The implementation in the pfsense_zbx.php has broken the code due to incorrect indentation. The 'case' blocks are at the same height as the switch function and the single 'case "version"' is indented 2 levels too deep. This error prevents our pfsense monitoring from working. Simply adjusting the indentation fixed the error for us.

image