Ad Widget

Collapse

MySQL Partition Creation Monitoring

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    MySQL Partition Creation Monitoring

    Hey,
    New to Zabbix but have setup server with MySQL partitions as detailed at zabbix.org and wanted to be able to monitor that the scheduled event is running and creating the new partitions.

    Added the following to my userparameter_mysql.conf to output the number of "future" partitions that have been created for a table.

    Code:
    #mysql.partitions[<database>,<table>]
    #Count of created partition for future data
    #Use to make sure schedule is running to create partitions
    UserParameter=mysql.partitions[*],HOME=/var/lib/zabbix mysql -N -e "select count(*) from  INFORMATION_SCHEMA.PARTITIONS where TABLE_SCHEMA='$1' and TABLE_NAME='$2' and cast(substring(PARTITION_NAME from 2) as unsigned) > FROM_UNIXTIME(UNIX_TIMESTAMP(DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')), '%Y%m%d%H00');" | cut -d' ' -f1
    With this I can now have a trigger go off if the number drops below my expected result.

    Hope this helps someone else.

    Tim

Announcement

Collapse
No announcement yet.
Working...
X