[ENH] Enhance Tiki Monitoring with IP Restriction, Authentication, and Probe Support
requested to merge softstart/tikiwiki/tiki:item88078-enhance-tiki-monitoring-integration into master
Enhances Tiki's monitoring capabilities, evolving the existing tiki-monitor.php
script to support more robust health and uptime monitoring,
with potential for integration into systems like GlitchTip, Nagios, and Zabbix.
Key Features:
-
IP Restriction: Added a new preference
monitoring_restricted_ips
to restrict access to the monitor script to specified IP addresses, ensuring tighter control. -
Token-based Authentication: Introduced a
monitoring_token
preference that allows authentication via a token passed as a GET/POST parameter or HTTP header. -
Key Visibility Rules: Added a new preference
monitoring_auth
to define visibility rules for different parts of the JSON output, allowing more granular control over which data can be seen by public users versus authenticated users or admins. -
Monitoring Probes: Implemented a new preference
monitoring_probes
allowing the definition of custom probes using Tiki's Calculations system to monitor specific metrics. Probes can include conditions for various system keys, with the overall result indicating success or failure. -
Expanded HTTP Methods and Custom Error Codes: Updated the script to support HEAD, GET, and POST requests. Added the ability to pass a
monitoring_error_code
parameter or HTTP header to specify the HTTP response code in case of a probe failure.
These improvements make it easier to integrate Tiki with external monitoring systems and provide more flexible, customizable health monitoring.