Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Aug 22, 2017 5:44 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Improved Linux memory graph
PostPosted: Mon Sep 10, 2012 10:50 am 
Offline

Joined: Mon Sep 10, 2012 10:29 am
Posts: 3
Created a new Linux memory graph here. The build-in cacti graph does not show total and swap memory information. There are several other graph templates out here, but one used 3 separate graphs and the other used an external script. Cacti is capable of doing this all in one graph and without external scripts.

Here is the snmp data available. The default data values pulled by cacti are: memAvailReal, memBuffer, memCached

snmpwalk -c public -v1 -Of <remote-server-name> .1.3.6.1.4.1.2021.4
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memIndex.0 = INTEGER: 0
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memErrorName.0 = STRING: swap
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalSwap.0 = INTEGER: 2097144
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memAvailSwap.0 = INTEGER: 2096956
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalReal.0 = INTEGER: 8173208
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memAvailReal.0 = INTEGER: 46264
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalFree.0 = INTEGER: 2143220
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memMinimumSwap.0 = INTEGER: 16000
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memShared.0 = INTEGER: 0
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memBuffer.0 = INTEGER: 135556
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memCached.0 = INTEGER: 2090784
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memSwapError.0 = INTEGER: 0
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memSwapErrorMsg.0 = STRING:

I've added pulling these values: memTotalSwap, memAvailSwap, memTotalReal

Thus, memory used should = memTotalReal - memBuffer - memCached - memAvailReal
And swap used should = memTotalSwap - memAvailSwap
And total memory should = memTotalSwap + memTotalReal

With these I created new CDEF's to do the math. Note, the default graphs use "Multiply by 1024". I used multiplied by 1000 instead because I wanted the numbers to all match ( cacti = snmp = cat /proc/meminfo ). Note, the stacked graphs tend to exceed Memory Total by a little. I believe this is because an averaged memory is being used and I think Cacti is doing some rounding errors.

Download my template, import, and enjoy. Shoot me some feedback if you find some improvements.

-Travis Sidelinger


Attachments:
memory2.png
memory2.png [ 36.99 KiB | Viewed 2849 times ]
cacti_graph_template_ucdnet_-_memory_usage2.zip [6.04 KiB]
Downloaded 228 times
Top
 Profile  
 
 Post subject: Re: Improved Linux memory graph
PostPosted: Wed Sep 12, 2012 6:35 am 
Offline
Cacti User

Joined: Thu Oct 06, 2005 5:03 am
Posts: 373
Functions perfect to cacti 0.8.8.a with my debian hosts! :-)

_________________
cacti rulez!


Top
 Profile  
 
 Post subject: Re: Improved Linux memory graph
PostPosted: Mon Oct 08, 2012 3:24 am 
Offline

Joined: Wed Oct 03, 2012 8:41 am
Posts: 3
Some problem with my host

snmpwalk OUUTPUT:

.iso.org.dod.internet.private.enterprises.ucdavis.memory.memIndex.0 = INTEGER: 0
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memErrorName.0 = STRING: swap
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalSwap.0 = INTEGER: 8385920 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memAvailSwap.0 = INTEGER: 8385920 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalReal.0 = INTEGER: 528139428 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memAvailReal.0 = INTEGER: 125757352 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalFree.0 = INTEGER: 134143272 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memMinimumSwap.0 = INTEGER: 16000 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memShared.0 = INTEGER: 0 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memBuffer.0 = INTEGER: 2813312 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memCached.0 = INTEGER: 392620128 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memSwapError.0 = INTEGER: noError(0)
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memSwapErrorMsg.0 = STRING:

but the graph shows like below :


Attachments:
44.png
44.png [ 18.43 KiB | Viewed 2707 times ]
Top
 Profile  
 
 Post subject: Re: Improved Linux memory graph
PostPosted: Mon Oct 08, 2012 8:08 am 
Offline

Joined: Mon Sep 10, 2012 10:29 am
Posts: 3
I created another version of this graph. Instead of adding both swap and physical memory to create a one virtual memory total, I stead subtract the swap memory and graph swap memory as a negative value.


Attachments:
memory_graph2-2.png
memory_graph2-2.png [ 48.64 KiB | Viewed 2701 times ]
File comment: Memory 2 template version 2
cacti_graph_template_ucdnet_-_memory_usage2.zip [6.04 KiB]
Downloaded 141 times
Top
 Profile  
 
 Post subject: Re: Improved Linux memory graph
PostPosted: Mon Oct 08, 2012 8:12 am 
Offline

Joined: Mon Sep 10, 2012 10:29 am
Posts: 3
> .iso.org.dod.internet.private.enterprises.ucdavis.memory.memSwapError.0 = INTEGER: noError(0)

Cacti needs a numeric value returned from SNMP. You'll have to get your error fixed:


Top
 Profile  
 
 Post subject: Re: Improved Linux memory graph
PostPosted: Mon Oct 08, 2012 9:39 am 
Offline

Joined: Wed Oct 03, 2012 8:41 am
Posts: 3
travissidelinger wrote:
I created another version of this graph. Instead of adding both swap and physical memory to create a one virtual memory total, I stead subtract the swap memory and graph swap memory as a negative value.


Thanks for reply

I tried this one but the graph looks like the old one :o

I have another host and snmpwalk shows:
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memIndex.0 = INTEGER: 0
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memErrorName.0 = STRING: swap
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalSwap.0 = INTEGER: 8388600 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memAvailSwap.0 = INTEGER: 7726808 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalReal.0 = INTEGER: 4048804 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memAvailReal.0 = INTEGER: 102184 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memTotalFree.0 = INTEGER: 7828992 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memMinimumSwap.0 = INTEGER: 16000 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memShared.0 = INTEGER: 0 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memBuffer.0 = INTEGER: 118472 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memCached.0 = INTEGER: 943752 kB
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memSwapError.0 = INTEGER: noError(0)
.iso.org.dod.internet.private.enterprises.ucdavis.memory.memSwapErrorMsg.0 = STRING:

but the graph is perfect :-?


Attachments:
11.png
11.png [ 19.39 KiB | Viewed 2699 times ]
Top
 Profile  
 
 Post subject: Re: Improved Linux memory graph
PostPosted: Thu Mar 09, 2017 7:09 am 
Offline
Cacti User

Joined: Thu Oct 06, 2005 5:03 am
Posts: 373
Activating an old post:

cacti_graph_template_ucdnet_-_memory_usage2.zip is same with the v1 zip.

Anyone has v2 to share?
Are available other more modern scripts for today usage?

Thank you

_________________
cacti rulez!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group