Closed denisgrilliGMSL closed 4 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?
Sorry, I was not clear in my explanation.
pfsense_zbx.php - pfSense Zabbix Interface Version 1.1.1 - 2021-10-24
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.
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?
@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.
@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.
@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.
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.
Hello, I'm adding a new item "Script Version" which is tied to a constant defined in the script. Will release soon.
Added item and trigger.
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.
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.