Ad Widget

Collapse

Aggregate items with wildcards

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • olgierd
    Junior Member
    • Dec 2011
    • 7

    #1

    Aggregate items with wildcards

    Is it possible to aggregate items with wildcards e.g:

    ITEM keys on group of hosts:
    filesystem_free[/usr/local,ext3]
    filesystem_free[/usr,ext4]
    filesystem_free[/var,ext3]

    count all filesystems with mountpoint like /usr* and fs type like ext*
    groupfunc["Host group","filesystem_free[/usr*,ext*]",itemfunc,timeperiod]

    P.S.
    don't worry about item's function - this is example
  • olgierd
    Junior Member
    • Dec 2011
    • 7

    #2
    please help and answer

    Any ideas?
    Originally posted by olgierd
    Is it possible to aggregate items with wildcards e.g:

    ITEM keys on group of hosts:
    filesystem_free[/usr/local,ext3]
    filesystem_free[/usr,ext4]
    filesystem_free[/var,ext3]

    count all filesystems with mountpoint like /usr* and fs type like ext*
    groupfunc["Host group","filesystem_free[/usr*,ext*]",itemfunc,timeperiod]

    P.S.
    don't worry about item's function - this is example

    Comment

    • eger
      Member
      • Nov 2006
      • 95

      #3
      Did you ever find a way to do this? I want to build a aggregate item using groupsum for all my storage filesystems on agents. But this doesn't include "/" and the mount points are named differently on all nodes.

      I was trying to do something like:
      Code:
      grpsum["MogileFS","vfs.fs.size[/var/mogdata/*,total]",last,0]
      and aggregate all the filesystem mounted under /var/mogdata on each node in the "MogileFS" group.

      Comment

      • olgierd
        Junior Member
        • Dec 2011
        • 7

        #4
        Originally posted by eger
        Did you ever find a way to do this? I want to build a aggregate item using groupsum for all my storage filesystems on agents. But this doesn't include "/" and the mount points are named differently on all nodes.

        I was trying to do something like:
        Code:
        grpsum["MogileFS","vfs.fs.size[/var/mogdata/*,total]",last,0]
        and aggregate all the filesystem mounted under /var/mogdata on each node in the "MogileFS" group.
        Unfortunately, I didn't find a way to do it.

        Comment

        • eger
          Member
          • Nov 2006
          • 95

          #5
          Originally posted by olgierd
          Unfortunately, I didn't find a way to do it.
          Ah, thanks for the update. I played around with this idea a little bit and the closest I got was creating some local UserParameters on the agents to aggregate disk usage on a group of mounts like this:

          Code:
          UserParameter=mogilefs.fs.total,df -k --total --portability /var/mogdata/* | awk '$1 ~ /^total/ { print $2}'
          UserParameter=mogilefs.fs.used,df -k --total --portability /var/mogdata/* | awk '$1 ~ /^total/ { print $3}'
          UserParameter=mogilefs.fs.free,df -k --total --portability /var/mogdata/* | awk '$1 ~ /^total/ { print $4}'
          This is just using df to output the total for a glob of mounts (all my mounts happen under /var/mogdata which made it simple) and then grepping for the total line and getting the total, free, and used in the df column output.

          I am then able to build some aggregate checks for gprsum using these keys to get totals for the cluster:

          Code:
          grpsum["MogileFS","mogilefs.fs.used",last,0]
          A little hackish. But seems to work OK. The biggest downside to this is having to add UserParams to agents. I'm using Puppet to more easily deploy config to servers so creating a file like /etc/zabbix/zabbix_agentd.d/userparameter_mogilefs.conf from Puppet wasn't a big deal for me.

          Comment

          Working...