Ad Widget

Collapse

Calculated item help required

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yello
    Senior Member
    • Apr 2011
    • 309

    #1

    Calculated item help required

    Hi,
    I have an item which is searching a log file for errors. The item works fine but I want to create a second item which counts the rate at which errors are being found so that a trigger can be defined.

    This is how I have set up this calculated item:

    key: log.error

    Function:

    count(log[{$LOG_PATH},{$REGEX_APP_ERR},UTF-8,50])

    So, I'm looking to count the number of lines that have been returned by the "log[{$LOG_PATH},{$REGEX_APP_ERR},UTF-8,50]" during the current update interval of log.error.

    However, when I enable this the check fails with "Cannot evaluate function [count({$REGEX_APP_ERR},UTF-8,50])] item[loghost:log[{$LOG_PATH}] not found" and the item goes unsupported. It looks like the entire back end of the item being passed to count is being dropped.

    Can someone help to get this working or point out a better way to do it if I'm heading down a blind alley?


    Regards,
    David
  • Yello
    Senior Member
    • Apr 2011
    • 309

    #2
    Any ideas?

    Regards,
    David

    Comment

    • elya
      Junior Member
      • Jul 2011
      • 1

      #3
      Have the same problem

      I would like to count the number of rows in a log file with certain criteria.
      I tried to make an Calculated item the same way Yello did, and got the same error, obviously.

      Any help would be appreciated.

      Comment

      • meir.akrish
        Junior Member
        • Jun 2011
        • 3

        #4
        why to use calculated items for that?

        if i got you right, you are searching for a string in an error log,
        and you want to get the items count.

        i did that in a different way,
        i wrote a script that gets the log file name and location as a parameter, and the search term as a parameter.

        i put a user parameter on the zabbix agent conf file, which forwards this 2 params.

        and then i created an item like that:

        LogParser[httpdaccesslog,/var/log/httpd/access_log,grep error-]

        Comment

        Working...