View Full Version : 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.
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.
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
lcondado
12-06-2006, 19:38
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.
achu_sab
13-06-2006, 08:51
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?
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?
lcondado
10-01-2008, 16:27
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}'
cbidwell
10-01-2008, 16:57
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'.