Ad Widget

Collapse

Monitoring SQL dump

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • giviz
    Junior Member
    • Mar 2014
    • 2

    #1

    Monitoring SQL dump

    Hi all,

    I've a problem I cannot find the solution :

    Server A make SQL dumps at night and store them in a folder.
    Server B rsync the folder from remote to local, to keep a copy of the dumps.

    Dumps are in the given format :
    db-DDMMYY_HHMM.sql.bz2

    So each day, a new file is created.

    I've made a script that return the file size of the last dump and I'm monitoring this value with zabbix on server B.

    Then I setup a trigger to alert me if the size of the dump change for more than xMo (absolute change) when comparing to the previous value.

    I add a Flexible intervals :
    Interval : 3600
    Period : 1-7,06:00-24:00

    The main problem is that at midnight (00 AM) zabbix store a value of 0, so it run the trigger.

    The backups runs in the period of 0AM to 6AM, so I was thinking to not monitor this interval of time.

    My questions are :

    1) How can I say zabbix to stop saving value from 0AM to 6AM, not to store a 0 an run the trigger ?
    2) Do you see a better way to monitor SQL dumps with zabbix ?
    Any good ressources to read will be very appreciated.
    3) Is there a way in the trigger to say "difference of x% of the last value" and not "difference of x" ?

    Thanks you very much !
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    1) use flexible intervalls for that
    2) in your script have a line that always symlinks "db-DDMMYY_HHMM.sql.bz2" to let's say "backup-latest.sql.bz2" after successful dump/copy. Then you could just check for the size of that symlinked file.
    3) should be possible with calculated items.

    Comment

    • giviz
      Junior Member
      • Mar 2014
      • 2

      #3
      Thank you for you answer.
      I will try with flexible intervals.

      Comment

      • Colttt
        Senior Member
        Zabbix Certified Specialist
        • Mar 2009
        • 878

        #4
        make a Userparameter
        like this:
        Code:
        UserParamer=check.file.age[*], stat -c "%Y %n" $1/* | sort -n | head -n 1 |awk '{print $1}'
        and in the Frontend:
        check.file.age[/var/l2k/]

        then you can create a trigger if the file older then 24hours (no backup is created)
        Debian-User

        Sorry for my bad english

        Comment

        Working...