Ad Widget

Collapse

LLD vfs.fs.discovery triggers depending on disk size

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tomstocker
    Junior Member
    • Jan 2024
    • 16

    #1

    LLD vfs.fs.discovery triggers depending on disk size

    Hi all

    We do LLD using vfs.fs.discovery. Now the triggers are in % which is sometimes good and sometimes bad. I'd like to do something like this:

    last(vfs.fs.size[{#FSNAME},free].last(0))<5G&last(vfs.fs.size[{#FSNAME},free].last(0))>1024G

    ​but where do I need to put this?

    Basically I want triggers depending on disk size, if more than 1TB, I want to use another value as for smaller disks.

    But I need some hint on where to do that.

    Best regards, Tom
  • Answer selected by tomstocker at 07-03-2024, 11:28.
    tomstocker
    Junior Member
    • Jan 2024
    • 16

    I've macroified the whole thing as like:

    Trigger prototypes:

    Disaster Dynamic largedisk: Free disk space is less than {$TR_LARGEDISK_LOW_DISASTER} on FS {#FSNAME}
    last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_LARGEDISK_LOW_DISASTER} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])>{$TR_DISK_SIZE_SWITCH}
    Warning Dynamic largedisk: Free disk space is less than {$TR_LARGEDISK_LOW_WARNING} on FS {#FSNAME}
    last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_LARGEDISK_LOW_WARNING} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])>{$TR_DISK_SIZE_SWITCH}
    Disaster Dynamic smalldisk: Free disk space is less than {$TR_SMALLDISK_LOW_DISASTER} on FS {#FSNAME}
    last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_SMALLDISK_LOW_DISASTER} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])<{$TR_DISK_SIZE_SWITCH}
    Warning Dynamic smalldisk: Free disk space is less than {$TR_SMALLDISK_LOW_WARNING} on FS {#FSNAME}
    last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_SMALLDISK_LOW_WARNING} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])<{$TR_DISK_SIZE_SWITCH}

    Additional Macros to define:

    {$TR_DISK_SIZE_SWITCH} -> define size of a "large disk" like 1024G
    {$TR_LARGEDISK_LOW_DISASTER} -> 2 (in percent)
    {$TR_LARGEDISK_LOW_WARNING} -> 10 (in percent)
    {$TR_SMALLDISK_LOW_DISASTER} -> 2 (in percent)
    {$TR_SMALLDISK_LOW_WARNING} -> 10 (in percent)

    Hope that helps anybody.

    BR, Tom

    Comment

    • PeterZielony
      Senior Member
      • Nov 2022
      • 146

      #2
      For hints read this
      https://www.zabbix.com/documentation...ed_filesystems

      and this:
      https://www.zabbix.com/documentation...ger_prototypes

      for trigger syntax and operators:






      in general this is well written documentation with tons of examples. I suggest starting there with each problem


      Last edited by PeterZielony; 23-01-2024, 08:49.

      Hiring in the UK? Drop a message

      Comment

      • tomstocker
        Junior Member
        • Jan 2024
        • 16

        #3
        very helpful, thank you

        Comment

        • tomstocker
          Junior Member
          • Jan 2024
          • 16

          #4
          I've ended up with with 2 triggers like:


          last(/Template.Name/vfs.fs.size[{#FSNAME},free])<2 and last(/Template.Name/vfs.fs.size[{#FSNAME},total])<500G
          last(/Template.Name/vfs.fs.size[{#FSNAME},free])<50G and last(/Template.Name/vfs.fs.size[{#FSNAME},total])>500G

          BR, Tom

          Comment

          • tomstocker
            Junior Member
            • Jan 2024
            • 16

            #5
            I've macroified the whole thing as like:

            Trigger prototypes:

            Disaster Dynamic largedisk: Free disk space is less than {$TR_LARGEDISK_LOW_DISASTER} on FS {#FSNAME}
            last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_LARGEDISK_LOW_DISASTER} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])>{$TR_DISK_SIZE_SWITCH}
            Warning Dynamic largedisk: Free disk space is less than {$TR_LARGEDISK_LOW_WARNING} on FS {#FSNAME}
            last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_LARGEDISK_LOW_WARNING} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])>{$TR_DISK_SIZE_SWITCH}
            Disaster Dynamic smalldisk: Free disk space is less than {$TR_SMALLDISK_LOW_DISASTER} on FS {#FSNAME}
            last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_SMALLDISK_LOW_DISASTER} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])<{$TR_DISK_SIZE_SWITCH}
            Warning Dynamic smalldisk: Free disk space is less than {$TR_SMALLDISK_LOW_WARNING} on FS {#FSNAME}
            last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},pfree])<{$TR_SMALLDISK_LOW_WARNING} and last(/company.Templ.Linux-Low-Level-Discovery/vfs.fs.size[{#FSNAME},total])<{$TR_DISK_SIZE_SWITCH}

            Additional Macros to define:

            {$TR_DISK_SIZE_SWITCH} -> define size of a "large disk" like 1024G
            {$TR_LARGEDISK_LOW_DISASTER} -> 2 (in percent)
            {$TR_LARGEDISK_LOW_WARNING} -> 10 (in percent)
            {$TR_SMALLDISK_LOW_DISASTER} -> 2 (in percent)
            {$TR_SMALLDISK_LOW_WARNING} -> 10 (in percent)

            Hope that helps anybody.

            BR, Tom

            Comment

            Working...