Apache base
This is Apache template made by me for testing the following :
1.500 error - a trigger will pop if the item has discovered 10 500 error code for the past hour + real time.
2.404 error - a trigger will pop if the item has discovered 100 404 error code for the past minute + mealtime.
3. Graph for 404 and 500 error
4. SSL cert expire check - will fire a trigger 30 days before expiration.
how to implant:
1. add the xml template to Configuration -> Templates.
2. adding scripts : cert_expire.sh , 404.total.sh, 404err.sh, 500.total.sh, 500err.sh to youre
/home/zabbix/ or your own path of zabbix scripts.
3. add permission for scripts:
chmod +x SCRIPTNAME
chown zabbix. SCRIPTNAME
4. add this user parameter to /etc/zabbix/zabbix_agent.conf
at the end of the file you will find all user param, add this template param at the end of the file :
UserParameter=500.err,/home/zabbix/500err.sh
UserParameter=cert.exp,/home/zabbix/cert_expire.sh
UserParameter=graf.500,/home/zabbix/404.total.sh
UserParameter=graf.404,/home/zabbix/500.total.sh
UserParameter=404.err,/home/zabbix/404err.sh
dont forget to restart zabbix_agent after adding this parameters
only after that you can assign the template to a host.
of course change /home/zabbix/ to your own path if needed.
###################################
Remember- change the scripts as you need.
for example, the cert script contains my file of certs as a variable -
change DIR var at the script to your file.
script check for crt,ca type of certs.
####################################
And error code scripts read file /var/log/httpd/ssl_access_log
change it as you need.
####################################
let me know if all went OK :)
Listing Details
1 version, '2017-01-30 06:52' modified