Ad Widget

Collapse

Monitor file-dates, timemachine backups

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • druber
    Junior Member
    • May 2012
    • 5

    #1

    Monitor file-dates, timemachine backups

    I am working on making Zabbix monitor the contents of a folder containing timemachine backups. OSX with timemachine server can warn you when backups are out of date, but i would like to monitor this with zabbix.
    If i run
    Code:
    /usr/bin/stat -lt "%Y%m%d %H:%M" /Volumes/backup/folder/* | /usr/bin/awk '{print $3 , $6}'
    -I get a nicely formatted list containing ownername of the backup, and the date in a format that i think zabbix would be happy to work with,

    Code:
    user.name1 20130524
    user.name2 20130619
    user.name3 20130618
    user.name4 ...
    ...
    Any suggestions on how I could make zabbix pick out users from this list of users with backups older than 10 days and make items and triggers dynamically?

    Regards,
    druber
  • dmartel
    Junior Member
    • Jun 2013
    • 7

    #2
    You could make a Perl script (or Python, Batch, etc.) and send your data using zabbix_sender.

    When you call the zabbix_sender, you have to give in parameters the Zabbix server address and the data file you have.

    The data file is formatted like so (one data per line):
    Code:
    <host_name> <item_name> <value>
    For creating dynamic hosts, you could take a look at the Zabbix JSON API.

    I hope it helps!

    David

    Comment

    • druber
      Junior Member
      • May 2012
      • 5

      #3
      Thanks dmartel, I'll look into zabbix_sender and making a script to produce the input file won't be difficult. Could I use date in a triggerfuction to pick out old backups? There is something like :

      "Current date is > than N"

      -But I am not sure how to make this work, and I can't find any examples of how this is used..

      druber

      Comment

      • dmartel
        Junior Member
        • Jun 2013
        • 7

        #4
        I don't think so. But since your date formatting represent a number, your item data type could be numeric (unsigned).

        In this way, you'll be able to ajust your triggers using numeric values.

        David

        Comment

        Working...