Ad Widget

Collapse

Nesting Macros..?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobC
    Junior Member
    • Jun 2012
    • 7

    #1

    Nesting Macros..?

    Hi,
    I'm a relative newbie with Zabbix (I previously used a completely different monitoring tool at my previous company), so bear with me

    I'd like to know if Zabbix 1.8.10 can support nesting macros...

    e.g.
    I have macro's set for
    {$DBNAME} = DB00
    {$PGVER} = 9.1.3

    I'd like to monitor the disk usage on the database's data directory in
    /data/postgres/9.1.3/data/db00

    (This part of the monitoring I've sorted out already )

    As I have several databases on this server (DB00 -> DB21) running differring versions of Postgres I'd like to get Zabbix to monitor all these from a single macro'd entry, e.g.

    {$DBDATADIR} = /data/postgres/{$PGVER}/data/{$DBNAME}

    A simple 'key' of "vfs.fs.size[{$DBDATADIR},pfree]" will suffice for the monitoring part (it's a tried and tested key for other monitoring I do).

    So, {$DBDATADIR} would expand (for each database) to something like :
    /data/postgres/9.1.3/data/db00
    /data/postgres/9.0.4/data/db01
    /data/postgres/8.2.6/data/db02
    /data/postgres/9.1.0/data/db03

    and so on for each database 'host'...

    Is such a macro valid within Zabbix 1.8.10, and should it be working? (e.g. Am I doing something wrong here and not seeing the wood for the trees?)

    Cheers,
    Rob.
  • ke_sheng_jie
    Member
    • Aug 2011
    • 40

    #2
    Nope

    I set {$TEST1}=1 and {$TEST2}=2{$TEST1}
    {$TEST2} just evaluates to "2{$TEST1}".

    So, it looks like you'd have to use "vfs.fs.size[/data/postgres/{$PGVER}/data/{$DBNAME},pfree]" in your item key.

    Not much of a disadvantage, but it does make your item key longer.

    Comment

    • RobC
      Junior Member
      • Jun 2012
      • 7

      #3
      Originally posted by ke_sheng_jie
      I set {$TEST1}=1 and {$TEST2}=2{$TEST1}
      {$TEST2} just evaluates to "2{$TEST1}".

      So, it looks like you'd have to use "vfs.fs.size[/data/postgres/{$PGVER}/data/{$DBNAME},pfree]" in your item key.

      Not much of a disadvantage, but it does make your item key longer.
      Thanks, I'd wondered about doing that, but now I have a different problem
      (see "Limit of directory 'depth' for monitoring" thread for that), so I wonder if the two threads are linked in some way...

      Rob.

      Comment

      Working...