Ad Widget

Collapse

Log file monitoring item supported options and value types

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skupko.sk
    Junior Member
    • Apr 2018
    • 8

    #1

    Log file monitoring item supported options and value types

    Have item definition:
    <key>log[{#STATSFILE},&quot;resource-usage:.*utime=([0-9]+)&quot;,,,,\1]</key>
    <value_type>3</value_type> #(Numeric)
    <delta>2</delta> #(Simple change)

    Example line:
    2018-06-04T14:32:24.488793+02:00 server rsyslogd-pstats: resource-usage: utime=12000 stime=16000 maxrss=3864 minflt=429 majflt=0 inblock=0 oublock=328 nvcsw=357

    See values as they are seen in logfile, sometimes with lowered value.
    2018-06-04 14:44:07 32000
    2018-06-04 14:43:37 32000
    2018-06-04 14:43:07 31955 32000 in logfile
    2018-06-04 14:42:37 31999 32000 in logfile
    2018-06-04 14:42:07 31998 32000 in logfile
    2018-06-04 14:40:37 27952 28000 in logfile
    2018-06-04 14:39:36 28000
    2018-06-04 14:37:32 23997 24000 in logfile
    2018-06-04 14:36:02 23526 24000 in logfile
    2018-06-04 14:35:02 23921 24000 in logfile
    2018-06-04 14:34:32 24000
    According to documentation only Type, Key, Type of information, Update interval, Log time format options are applicable and others are just ignored?
    Is it possible to store values as "Simple change" for log items? If not, then the only possibility to get "simple change" is to create another computed item based on log item?
    In Zabbix 3.0.8 all the item configuration options are available even for log item types.
  • skupko.sk
    Junior Member
    • Apr 2018
    • 8

    #2
    Change the value of 'Store value' to 'As Is' solved the issue with discrepancies.
    Just read hint from documentation that log and logrt items should have 'Update interval' set to 1 second. And the Zabbix agent will then send new values once log file was updated.

    Still have issue with computed item based on log item.

    Log items key (stored As Is with Numeric type):
    log[{#STATSFILE},"{#FWDNAME} queue\[DA\]:.* size=([0-9]+)",,,,\1]
    log[{#STATSFILE},"{#FWDNAME} queue:.* size=([0-9]+)",,,,\1]

    Calculated item key:
    rsyslog.diffqueue[{#INST},{#FWDNAME}]
    Calculated item formula:
    log[{#STATSFILE},"{#FWDNAME} queue:.* size=([0-9]+)",,,,\1].delta(#2)+log[{#STATSFILE},"{#FWDNAME} queue\[DA\]:.* size=([0-9]+)",,,,\1].delta(#2)

    Getting error:
    Cannot create item: macro "{#STATSFILE}" value is not numeric.

    Comment

    • skupko.sk
      Junior Member
      • Apr 2018
      • 8

      #3
      Configuration issue.
      The formula of calculated items have specific formatting, not the same like thresholds. Solved by change to:

      delta("log[{#STATSFILE},\"{#FWDNAME} queue:.* size=([0-9]+)\",,,,\1]",#2)+delta("log[{#STATSFILE},\"{#FWDNAME} queue\[DA\]:.* size=([0-9]+)\",,,,\1]",#2)
      Last edited by skupko.sk; 14-06-2018, 10:50.

      Comment

      Working...