Ad Widget

Collapse

calculations in items and/or graphs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron
    Junior Member
    • May 2006
    • 16

    #1

    calculations in items and/or graphs

    I have values for total memory and free memory. I need to make a graph of memory used. It seems that I cannot graph a calculation since my only options are from a drop down box of existing items. I have been trying to define an item that is basically (total - free) to give me a "memory used" item value that I can graph. So far I haven't managed to get anywhere.

    Is this even possible?

    I am currently considering looking at the agent and hacking to add a new "used" mode to vm.memory.size. Any opinion on that? I would prefer limit my customization to the interface itself because it would make future upgrades and such easier. That and my programming skills are lousy.
  • Aaron
    Junior Member
    • May 2006
    • 16

    #2
    I created a UserParameter entry that calls a script for this so I have the amount of memory used stored as a variable in the database.

    Comment

    • vrtareg
      Senior Member
      • May 2006
      • 293

      #3
      Hi

      Can you share your script content ?
      I want to do the same to see some parameters on same graph.
      For example memory usage and CPU utilization in percents to determine high loaded servers.

      Thanks
      Areg

      Comment

      • lcondado
        Member
        • May 2006
        • 37

        #4
        memory calculation script

        This is an example of memory calculation usage (percent) in a linux server with 4Gb of memory

        vmstat 1 2 | /bin/gawk '{if (NR==4) print ((4000000-$5)*100)/4000000}'

        in this case vmstat reports memory size in KB, however in HPUX the memory usage is reported in pages.

        Comment

        • achu_sab
          Member
          • May 2006
          • 49

          #5
          Can you specify how the script is implemented? I tried to add it to zabbix_agentd.conf as a user parameter but it doesn't work, pls describe where I have to add the script to get the memory usage, Also can you tell me where is the location of file in which zabbix_agentd keys are specified?

          Comment

          • SierraX
            Junior Member
            • Dec 2006
            • 21

            #6
            Hi, is there another solution for this problem?
            I have intigrate a programmline to send the a sum of 3 Memorys sizes.
            UserParameter=real.free.mem, free -b|awk ‘$1==”-/+” { print $NF }’
            and it works.
            But this is a very dirty way. I mean if i have a Databaseserver, did i realy need to send 2 times the same Informations?

            Comment

            • lcondado
              Member
              • May 2006
              • 37

              #7
              Here is the script (for solaris):

              cat mem_used.ksh
              #!/bin/ksh

              vmstat 1 2 | /bin/awk '{if (NR==4) print ((32000000-$5)*100)/32000000}'

              And here is the agent file configuration line:

              grep mem_used.ksh /etc/zabbix/zabbix_agentd.conf
              UserParameter=CUST.MEM_PERC,/herramientas/monitoreo/zabbix/scripts/mem_used.ksh


              For linux is reccomendable to subtract the cached memory:

              cat mem_used.ksh
              #!/bin/bash

              vmstat 1 2 | /bin/gawk '{if (NR==4) print (((16400000-$6)-$4)*100)/16400000}'
              Last edited by lcondado; 10-01-2008, 17:33.

              Comment

              • cbidwell
                Senior Member
                • Aug 2006
                • 127

                #8
                Would you explain here how you implemented this into the zabbix fe configuration? I've been trying something similar to this but I only get 'no data'.

                Comment

                Working...