Ad Widget

Collapse

Monitor items with dynamic key values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ryafro
    Junior Member
    • Jul 2014
    • 6

    #1

    Monitor items with dynamic key values

    Hello,

    Looking for assistance on monitoring a log file that has a date in the path/name, e.g.

    vfs.file.time[/some/path/to/log/file/log_yyyyMMdd.log,change]

    Where yyyyMMdd is the current date.

    What is the best-practices approach to this issue?

    Thanks in advance!
  • filipp.sudanov
    Senior Member
    Zabbix Certified Specialist
    • May 2014
    • 137

    #2
    The values for yyyyMMdd should be definetely filled in on agent - if they were filled in on server, that might be delayed due to configuration synchronization.
    So, probably a UserParameter, that calls a script. See https://www.zabbix.com/documentation...userparameters

    Comment

    • coreychristian
      Senior Member
      Zabbix Certified Specialist
      • Jun 2012
      • 159

      #3
      Sorry misread the original post (need my caffeine) not sure if you can use regex or not on that particular item. You may need to write a script that checks the file time stamp, or play around to see if variables/regex work with that item.
      Last edited by coreychristian; 01-08-2014, 16:52.

      Comment

      • ryafro
        Junior Member
        • Jul 2014
        • 6

        #4
        Thanks for the responses!

        I have 300+ log files I'd need to check in this manner. When I look at Zabbix documentation on external scripts, I see the following:

        "Do not overuse external checks! It can decrease performance of the Zabbix system a lot."

        What is considered overuse?

        Comment

        • coreychristian
          Senior Member
          Zabbix Certified Specialist
          • Jun 2012
          • 159

          #5
          External scripts are different then parameters.

          An external script is run from the zabbix server. A user parameter allows you to use a script locally on the zabbix client.

          Comment

          • ryafro
            Junior Member
            • Jul 2014
            • 6

            #6
            Thank you for the clarification. I will check the documentation and give it a shot.

            Thanks for your help!

            Comment

            • ryafro
              Junior Member
              • Jul 2014
              • 6

              #7
              Thank you! This seems to work!

              Here was my solution:

              zabbix_agentd.conf
              UserParameter=check_file_age[*],stat -c %Z $1/`date +%Y%m%d`/$2

              Testing:
              zabbix_get -s hostname -k check_file_age[/home/somepath/,somefile.txt]
              1407356359

              Comment

              Working...