Confused as to why two values in this template are backwards
Moderators: Developers, Moderators
Confused as to why two values in this template are backwards
As shown in the graph below, the "Memory Used" and "Memory Free' values are reversed based on what is shown in "top" on that server.
The debug of the graph is below with the CDEFs shown. They appear to be correct, but the numbers aren't correct. What am I missing?
The debug of the graph is below with the CDEFs shown. They appear to be correct, but the numbers aren't correct. What am I missing?
Re: Confused as to why two values in this template are backwards
What is the type of the data input Method?
Before history, there was a paradise, now dust.
Re: Confused as to why two values in this template are backwards
They are using the Net-SNMP - Buffers, Net-SNMP - Cache, Net-SNMP - Free, Net-SNMP - Total "Get SNMP Data" data templates.
bsi-util-btp - Memory - Buffers bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.14.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_mem_buffers_3410.rrd
bsi-util-btp - Memory - Cache bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.15.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_mem_cache_3411.rrd
bsi-util-btp - Memory - Free bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.6.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_mem_free_3412.rrd
bsi-util-btp - Memory - memTotalReal bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.5.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_memtotalreal_3414.rrd
bsi-util-btp - Memory - Buffers bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.14.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_mem_buffers_3410.rrd
bsi-util-btp - Memory - Cache bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.15.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_mem_cache_3411.rrd
bsi-util-btp - Memory - Free bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.6.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_mem_free_3412.rrd
bsi-util-btp - Memory - memTotalReal bsi-util-btp SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.2021.4.5.0
RRD: /usr/local/cacti-1.2.9/rra/bsi-util-btp_memtotalreal_3414.rrd
Re: Confused as to why two values in this template are backwards
Can you log this into GitHub?
Before history, there was a paradise, now dust.
Re: Confused as to why two values in this template are backwards
IDone (https://github.com/Cacti/cacti/issues/3329). I didn't know if it was actually a bug or if I was just doing something wrong with CDEFs.
Re: Confused as to why two values in this template are backwards
Jimmy closed the issue on Github statng it is not a bug, so I am back to square one.
His comment was:
Memory free is d,c,-,1024,* Which is (MemoryTotalReal-MemFree)*1024 correct? Why would that be giving me the value of the memory used according to top on the server (and why is the "memory used" cdef giving me the total of the memory free according to top?
His comment was:
But that doesn't explain why the two values (memory free and memory used) seem to be backwards.So, this looks like a custom graph template, not written by The Cacti Group. Reviewing the Data Template, the specific OID's seem to be correct. Review the various Graph Items and ensure that they are using the CDEF "Multiply by 1024" each and that the base units of the Graph Template are also 1024. If you want the unit's to be SI (KiB, GiB), then you need to add a "Multiply by 1000" CDEF and change the base units for the Graph Template to 1000.
Memory free is d,c,-,1024,* Which is (MemoryTotalReal-MemFree)*1024 correct? Why would that be giving me the value of the memory used according to top on the server (and why is the "memory used" cdef giving me the total of the memory free according to top?
Last edited by stormonts on Mon Mar 09, 2020 7:49 am, edited 1 time in total.
- camerabob
- Cacti User
- Posts: 386
- Joined: Fri Feb 10, 2017 2:45 pm
- Location: Long Island, New York, USA
- Contact:
Re: Confused as to why two values in this template are backwards
I'm not a CDEF pro, but shouldn't there be a minus sign in that CDEF definition? Something like "d,c,-,1024,*"
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4
Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4
Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Re: Confused as to why two values in this template are backwards
There is, I just failed to type it correctly in that comment (comment is updated now).
Attached is the template if anyone wants to take a look and help me figure out where my math is wrong.
Attached is the template if anyone wants to take a look and help me figure out where my math is wrong.
Re: Confused as to why two values in this template are backwards
To me this calculation is not clear (I'm not an expert in CDEF):
Values collected:
a=mem_buffers
b=mem_cache
c=mem_free
d=memTotalReal
Is this the correct Calculation to get Memory Used?
Memory Used = c,a,b,-,+,1024,*
= (c + (a-b)) * 1024
The values on the Graph did not match with the values from "top" - Command
Top shows: 5.712.552 Free, your graph: 1,52 Current
You had checked each single value in the graph separately before starting caluculation wiht CDEF?
Values collected:
a=mem_buffers
b=mem_cache
c=mem_free
d=memTotalReal
Is this the correct Calculation to get Memory Used?
Memory Used = c,a,b,-,+,1024,*
= (c + (a-b)) * 1024
The values on the Graph did not match with the values from "top" - Command
Top shows: 5.712.552 Free, your graph: 1,52 Current
You had checked each single value in the graph separately before starting caluculation wiht CDEF?
Re: Confused as to why two values in this template are backwards
Yes, I did check them individually. What we are trying to show is the amount of physical memory that is used which does not include buffers/cache. (top shows "Used" as the total of buff/cache + actual memory usage).
If your break down of my equation is correct, then I guess I should change it to:
a=mem_buffers
b=mem_cache
c=mem_free
d=memTotalReal
Memory Used = d,a,b,+,-,1024,*
= (d - (a+b)) * 1024
Correct?
If your break down of my equation is correct, then I guess I should change it to:
a=mem_buffers
b=mem_cache
c=mem_free
d=memTotalReal
Memory Used = d,a,b,+,-,1024,*
= (d - (a+b)) * 1024
Correct?
- camerabob
- Cacti User
- Posts: 386
- Joined: Fri Feb 10, 2017 2:45 pm
- Location: Long Island, New York, USA
- Contact:
Re: Confused as to why two values in this template are backwards
I would go with:
Memory Used = d,a,-,b,-,1024,*
= (d - a - b) * 1024
Memory Used = d,a,-,b,-,1024,*
= (d - a - b) * 1024
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4
Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4
Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Re: Confused as to why two values in this template are backwards
Both of the last two Posts should provide the same results
Maybe it makes sense to start with one Value as Area and three values as Lines. Only a CDEF which does the calculation '* 1024'
Then compare the Current-Values with the Values shown in "top".
If these values will match do some calculation to check which formula you will need to get the desired values.
Then just define a matching CDEF.
Maybe it makes sense to start with one Value as Area and three values as Lines. Only a CDEF which does the calculation '* 1024'
Then compare the Current-Values with the Values shown in "top".
If these values will match do some calculation to check which formula you will need to get the desired values.
Then just define a matching CDEF.
Re: Confused as to why two values in this template are backwards
I finally figured it out, but now I have a different problem. I am using the same graph template on multiple servers, but the problem is that the values aren't coming in the same way across devices.
In the image below, you can see that the order of DEFs is MemTotalReal, then mem_buffers, then mem_cache, then mem_free.
This is from a system that is displaying incorrectly and the order of the DEFs is mem_buffers, then mem_cache, then mem_free, then MemTotalReal Shouldn't they always be uniform since the same template is in use and the servers are all running the same OS?
In the image below, you can see that the order of DEFs is MemTotalReal, then mem_buffers, then mem_cache, then mem_free.
This is from a system that is displaying incorrectly and the order of the DEFs is mem_buffers, then mem_cache, then mem_free, then MemTotalReal Shouldn't they always be uniform since the same template is in use and the servers are all running the same OS?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Confused as to why two values in this template are backwards
You may have multiple versions of the template installed. There is a Sync Template dropdown on the Graph Templates page. You should try that.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Re: Confused as to why two values in this template are backwards
Yes, agreed with Witness. I seems you are not using only one template for your servers. Maybe you selected a different Template for your second server?
If you are using two Templates and you will stay on two Templates: it might be an idea to validate the configuration of both Templates.
If you are using two Templates and you will stay on two Templates: it might be an idea to validate the configuration of both Templates.
Who is online
Users browsing this forum: No registered users and 2 guests