Ad Widget

Collapse

Discussion thread for official Zabbix Template for Linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeff16384
    Junior Member
    • Aug 2023
    • 1

    #16
    Hi, some of our Linux servers are configured to heavily swap unused memory do get free memory for disk cache.

    as a result I often see memory situations like this:
    Click image for larger version

Name:	grafik.png
Views:	1035
Size:	8.3 KB
ID:	469321

    so free swap is less than 25% but lot of memory is available. so swap-in of all data is always possible. which means we often have Alerts about High swap usage by zabbix. I suggest this small patch:

    --- linux-template.orig 2023-08-24 16:54:31.439127713 +0000
    +++ linux-template.new 2023-08-24 16:54:53.458292768 +0000
    @@ -479,6 +479,17 @@
    value: memory
    - tag: component
    value: storage
    + - uuid: 2e4e665e1b664d889ad690692e031aba
    + name: 'Linux: Used swap space'
    + key: 'system.swap.size[,used]'
    + history: 7d
    + units: B
    + description: 'The used space of the swap volume/file expressed in bytes.'
    + tags:
    + - tag: component
    + value: memory
    + - tag: component
    + value: storage
    - uuid: fc6898682f904c57ba28bcb3748b237f
    name: 'Linux: System description'
    key: system.uname
    @@ -1921,12 +1932,14 @@
    - tag: scope
    value: performance
    - uuid: f49fc01c5ac945d59455563bdbcc6469
    - expression: 'max(/Linux by Zabbix agent/system.swap.size[,pfree],5m)<{$SWAP.PFREE.MIN.WARN} and last(/Linux by Zabbix agent/system.swap.size[,total])>0'
    + expression: 'max(/Linux by Zabbix agent/system.swap.size[,pfree],5m)<{$SWAP.PFREE.MIN.WARN} and last(/Linux by Zabbix agent/system.swap.size[,total])>0 and last(/Linux by Zabbix agent/system.swap.size[,used]) > last(/Linux by Zabbix agent/vm.memory.size[available])'
    name: 'Linux: High swap space usage'
    - event_name: 'Linux: High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free)'
    + event_name: 'Linux: High swap space usage (less than {$SWAP.PFREE.MIN.WARN}% free) and available memory lower than used swap space'
    opdata: 'Free: {ITEM.LASTVALUE1}, total: {ITEM.LASTVALUE2}'
    priority: WARNING
    - description: 'If there is no swap configured, this trigger is ignored.'
    + description: |
    + If there is no swap configured, this trigger is ignored.
    + Do not trigger as long as enough memory is available
    dependencies:
    - name: 'Linux: High memory utilization'
    expression: 'min(/Linux by Zabbix agent/vm.memory.utilization,5m)>{$MEMORY.UTIL.MAX}'



    explanation:
    1. Polling also Used Swapspace
    2. only Trigger "High Swap usage" if available memory is less than used swap.

    BR. Jörg







    Comment

    • pfzim
      Junior Member
      • Apr 2025
      • 2

      #17
      Hi,
      I noticed that in the Linux templates, the condition for absolute values was removed, leaving only percentages.
      I believe this change is a mistake because for large-capacity disks, 20% is still a significant amount of free space for a trigger to activate.
      For example, on a 2 TB disk, the trigger activates at 20%, which is 400 GB of free space. Even SCOM uses a combined trigger: https://kevinholman.com/2019/07/09/h...works-in-scom/

      Triggers:
      • FS [{#FSNAME}]: Space is critically low
      • FS [{#FSNAME}]: Space is low
      The commit with the change: https://git.zabbix.com/projects/ZBX/...31d7b5dfac4ccd

      I suggest reverting it to how it was:

      Code:
      last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
      (last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}
      Last edited by pfzim; 14-04-2025, 22:01.

      Comment

      • pfzim
        Junior Member
        • Apr 2025
        • 2

        #18
        Event name:
        Code:
        Linux: FS [{#FSNAME}]: Space is low (used > {$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"} and {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%, free {{?(last(//vfs.fs.dependent.size[{#FSNAME},total])-last(//vfs.fs.dependent.size[{#FSNAME},used]))/1024/1024/1024}.fmtnum(1)}GB, total {{?last(//vfs.fs.dependent.size[{#FSNAME},total])/1024/1024/1024}.fmtnum(1)}GB)
        Code:
        Linux: FS [{#FSNAME}]: Space is critically low (used > {$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"} and {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%, free {{?(last(//vfs.fs.dependent.size[{#FSNAME},total])-last(//vfs.fs.dependent.size[{#FSNAME},used]))/1024/1024/1024}.fmtnum(1)}GB, total {{?last(//vfs.fs.dependent.size[{#FSNAME},total])/1024/1024/1024}.fmtnum(1)}GB)
        Operational data:
        Code:
        Space used: {ITEM.LASTVALUE3} ({{ITEM.LASTVALUE1}.fmtnum(1)}%), total: {ITEM.LASTVALUE2})}
        Expression:
        Code:
        last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
        (last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.WARN:"{#FSNAME}"}
        Code:
        last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},pused])>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
        (last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},total])-last(/Linux by Zabbix agent active/vfs.fs.dependent.size[{#FSNAME},used]))<{$VFS.FS.FREE.MIN.CRIT:"{#FSNAME}"}​
        Last edited by pfzim; 15-04-2025, 11:39.

        Comment

        • dharam
          Junior Member
          • Oct 2024
          • 26

          #19
          Anyone using File system monitoring for Linux host and can provide me high level steps to begin with. I have given task to explore this option.
          Currently we have script based from tool called HP ovo and we need to replace it with zabbix

          Comment

          • dharam
            Junior Member
            • Oct 2024
            • 26

            #20
            Hi,
            I have downloaded the template - Linux by Zabbix agent active and applied to Zabbix app and proxy servers (both are on linux) , I need to do any configuration to discover any filesystem on this? I dont see any file system in latest data.
            Any help on this?

            Comment

            • PavelZ
              Senior Member
              • Dec 2024
              • 162

              #21
              This is a pretty popular and reliable template. Nothing breaks there.
              Maybe you show versions of the agent, template, and also check the values ​of the host macros ? (this affects filesystems autodiscovery)​

              Comment

              • dharam
                Junior Member
                • Oct 2024
                • 26

                #22
                Hi,
                Please find below details :
                Zabbix 7.0.12
                Agent version : 7.0.12
                fstype: ext4 xfs (how to discover other file system e.g tmpfs,other mount fs)

                Item : Get FileSystems - shows no data (when tried to run discovery shows , shows attached error)
                Template : Linux by Zabbix agent active (Zabbix 7.0 or higher)

                Detailed snapshot.
                Attached Files

                Comment

                • PavelZ
                  Senior Member
                  • Dec 2024
                  • 162

                  #23
                  Item : Get FileSystems - shows no data (when tried to run discovery shows , shows attached error)
                  This function does not work only because the agent kind is active
                  Can you debug querying of information using zabbix_get program separately?

                  Comment


                  • dharam
                    dharam commented
                    Editing a comment
                    sorry but can you give me how to debug this as I am not aware?
                • ralfbergs
                  Junior Member
                  • Nov 2025
                  • 1

                  #24
                  Hi.

                  I would suggest that this template be extended as follows:
                  • Include an (optional) protocol scheme macro so that you can change from "http://" URLs to "https://" URLs.
                  • Include (optional) basic authentication credentials "login" and "password".
                  I don't think these features are available yet. The usecase is a host on the internet whose node exporter can be reached via http-over-TLS, protected by basic authentication.

                  I tried to hack the existing template, but I can't import my modified version due to some errors whose root cause is unknown to me (I know nothing about Zabbix or its templates): "Import failed: Invalid parameter "/1/host": invalid host name."

                  Thank you.

                  Kind regards,

                  Ralf

                  Comment

                  Working...