Ad Widget

Collapse

Edit vfs.fs.size trigger NOT to go off for disk C:

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pportnoy
    Junior Member
    • Nov 2012
    • 8

    #1

    Edit vfs.fs.size trigger NOT to go off for disk C:

    Hello!
    I have a default trigger: "Free disk space is less than 10% on volume {#FSNAME}"
    It looks like:
    Code:
    {Template OS Windows:vfs.fs.size[{#FSNAME},pfree].last(0)}<10
    I'd like that trigger not to alarm me when it's disk "C:"

    I've tried to edit it like:
    Code:
    {Template OS Windows:vfs.fs.size[{#FSNAME},pfree].last(0)}<10&{#FSNAME}#"C:"
    , but it gave me an error:
    Incorrect host name "#FSNAME" provided in expression. Check expression part starting from "{Template OS Windows:vfs.fs.size[{#FSNAME},pfree].last(0)}<10&{#FSNAME}#"C:"".

    How can I realise what's needed? Thank you!
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    LLD Macros can be used for [...]triggers, in names and expressions[...] only (See: Low-level discovery).

    I encountered a similar problem some time ago and solved it by adding an additional item prototype that holds the necessary information.
    Find a way to provide an item that gets {#FSNAME} as argument and returns the information that you need.

    In worst case add a custom item similar to:
    Code:
    UserParameter=echo[*],echo $1
    Then make an item prototype like:
    Code:
    echo["{#FSNAME}"]
    and a trigger prototype like:
    Code:
    {Template OS Windows:vfs.fs.size[{#FSNAME},pfree].last(0)}<10&{Template OS Windows:echo["{#FSNAME}"].regexp("^C:$")}=0
    Just to show the idea. Haven't tested any of that.

    Comment

    • joel_leonhardt
      Junior Member
      • Dec 2011
      • 12

      #3
      Adding to BDiE8VNy's excellent advice (use an additional item prototype), you can create a slightly different prototype that doesn't need a custom item added to each Zabbix agent config file.

      Make the item prototype like this:
      Code:
      Item type: external check
      Item key:  echo["{#FSNAME}"]
      This uses the Zabbix server's ECHO command, so that must be available as an external check:
      Code:
      ZabbixServer> ln /bin/echo /usr/share/zabbix/externalscripts/
      (directories may be different on your system)
      We have just done this ourselves (basing our work on BDiE8VNy's original answer), so it's been tested under Zabbix v2.0.4.
      Last edited by joel_leonhardt; 27-01-2013, 06:47. Reason: minor typo

      Comment

      Working...