A need arose to monitor the list of file types/extensions that users are allowed to upload into Concrete5.
These two scripts allow Zabbix to remotely view the configuration.
list_c5_upload_extensions.sh
Should be placed wherever it can be accessed by the Zabbix agent; I chose /usr/lib/zabbix/externalscripts/
for consistency with other scripts that could be called externally (although external checks only work on scripts located on the Zabbix server itself).
list_c5_upload_extensions.php
This will do the heavy lifting of parsing the Concrete5 config file, and should be located in the same directory as the wrapper script
On the Concrete5 webserver:
# e.g. /etc/zabbix/zabbix_agent.conf
# Add this line wherever is appropriate
UserParameter=concrete5.upload_file_extensions,/usr/lib/zabbix/externalscripts/list_c5_upload_extensions.sh
# restart the agent, e.g.
sudo service zabbix-agent restart
# verify the key is available for use
# login as the zabbix user
sudo su zabbix -s /bin/bash
zabbix-agentd -t "concrete5.upload_file_extensions"
In the Zabbix GUI, Add an item
- Name: Concrete5 Allowed Upload File Extensions
- Type: Zabbix agent
- Key:
concrete5.upload_file_extensions
- Other attributes as desired (e.g.)
- Update interval: 600 (s)
In the Zabbix GUI, Add a trigger
- Name: Concrete5 Allowed Upload File Extensions Changed
- Expression:
{your_concrete5_host:concrete5.upload_file_extensions.diff()}=1
- Other attributes as desired (e.g.)
- URL: https://your.website.com/index.php/dashboard/system/files/filetypes
- Severity: Information