Ad Widget

Collapse

Question About triggers.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sby
    Member
    • Jan 2017
    • 59

    #1

    Question About triggers.

    Hi,

    I have a question when i now check in zabbix i see a trigger

    {Template OS Linux:vm.memory.size[available].last(0)}<20

    Now i want to have a trigger that alerts when the memory of 16 GB
    Is used by 10 GB of the memory how can i fix that.

  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    If it is acceptable to replace the condition that the available memory size becomes less than 6 GB, the following conditional expression will be obtained.

    Code:
    {Template OS Linux:vm.memory.size[available].last(0)}<6G
    If you want to use conditional expressions on the size of used memory, you need to start with the procedure to create the item.

    Comment

    • sby
      Member
      • Jan 2017
      • 59

      #3
      Can i use the same item for this then with only a new name ??
      Code:
      vm.memory.size[available]

      Comment

      • sby
        Member
        • Jan 2017
        • 59

        #4
        Someone i use zabbix and also monitis in monitis i have the follow rules.
        If used memory and also if free memory.

        How can i create this rules also in Zabbix

        Click image for larger version  Name:	Screen Shot 2018-04-16 at 15.19.02.png Views:	3 Size:	3.8 KB ID:	357229

        Comment

        • tcilmo
          Senior Member
          • Nov 2016
          • 122

          #5
          Originally posted by sby
          Someone i use zabbix and also monitis in monitis i have the follow rules.
          If used memory and also if free memory.

          How can i create this rules also in Zabbix

          Click image for larger version Name:	Screen Shot 2018-04-16 at 15.19.02.png Views:	3 Size:	3.8 KB ID:	357229
          You will create a trigger off this item - vm.memory.size. https://www.zabbix.com/documentation...ry.size_params. used - used memory, calculated differently depending on the platform (see the table below)


          Comment

          • sby
            Member
            • Jan 2017
            • 59

            #6
            Thank you I have created the Item and that works also.
            I see the used Memory now.

            I want to create a trigger for when more than 4 GB used from the server I get an alert.
            I have now this but it is not working for the alert.
            What is wrong.

            {Template OS Linux NO SWAP:vm.memory.size[used].last(0)}<4G

            Comment

            • sby
              Member
              • Jan 2017
              • 59

              #7
              I have found my problem I need to change < to > and then it works. Thanks

              Comment

              • tcilmo
                Senior Member
                • Nov 2016
                • 122

                #8
                Originally posted by sby
                Thank you I have created the Item and that works also.
                I see the used Memory now.

                I want to create a trigger for when more than 4 GB used from the server I get an alert.
                I have now this but it is not working for the alert.
                What is wrong.

                {Template OS Linux NO SWAP:vm.memory.size[used].last(0)}<4G
                The trigger looks right - does an alert appear in the dashboard when the threshold is reached?

                Comment

                • kloczek
                  Senior Member
                  • Jun 2006
                  • 1771

                  #9
                  Just a comment only about the sense of such trigger.

                  In many cases system architects are trying to gaining state when none of the memory will be used unused.
                  Why? because it means that host has been overspecified.
                  Example of such system may be OS used by the database when DB engine allocates specified in the DB engine configuration block of memory and it allocates within such block memory chunks used by databases or JVM which allocates as well not more memory than it is specified in the JVM setup.
                  In other words, you should be more worried about that situation that available memory than you have no free memory.
                  Everything, of course, depends on the exact scenario/application(s) running on the system because in many cases amount of used/available memory may vary in time however usually it is possible to predict somehow.
                  Example: http server which dynamically suns forked processes or cloned threads where is possible to predict how much memory will be used by single thread/process has always max limit of such spawned processes or threads. In such cases, if the memory used by single httpd process will be X and max possible to spawn instances N, MaxMem=X*N and you should be not alarming about used/unused memory than reaching max possible to spawn httpd processes/threads that saturation of the max slots has been reached on exact system.

                  Why I'm pointing to such logic? Because the name of the template in your example suggests that you are working on generic OS Linux template which will be used on every/most of the systems in your env.
                  In other words, such template with such memory trigger will be producing on some systems false alarms because on exact system someone may intentionally want have zero or almost zero not used memory.
                  This is why most of the people working on monitoring drop any alarms about free/used memory leaving the only metrics to sample memory state only adding (sometimes) adding some memory related triggers in other templates which inherits base OS template.

                  On top of this, it is yet another interesting aspect that in recent years on Linux paradigm of the memory management changed a bit and in many cases, it is less important to monitor free/used memory than active/inactive memory.
                  This is why a few months ago I've proposed some patch for zabbix agent to add new memory types possible to monitor over vm.memory.size[] https://support.zabbix.com/browse/ZBX-13233
                  Those new types memory will be possible to monitor on zabbix 4.0 however in the ticket is attached patch which can be applied on 3.4.
                  I've added in my templates as well copy of my own OS Linux template which is using those new keys https://github.com/kloczek/zabbix-te...ux%20ZBX-13233
                  http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                  https://kloczek.wordpress.com/
                  zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                  My zabbix templates https://github.com/kloczek/zabbix-templates

                  Comment

                  Working...