|
|
| Author |
Message |
mac_fly
Joined: 30 Jul 2008 Posts: 11
|
Posted: Fri Aug 08, 2008 3:40 am Post subject: Script memory |
|
|
Hello,
I have two data :
total memory
free memory
I would like to graph the used memory. I know that i have to do a simple subtraction but how to do that in cacti ?
thanks.
|
|
| Back to top |
|
 |
Linegod Developer
Joined: 20 Feb 2003 Posts: 518 Location: Canada
|
|
| Back to top |
|
 |
mac_fly
Joined: 30 Jul 2008 Posts: 11
|
Posted: Tue Aug 12, 2008 4:59 am Post subject: |
|
|
Thanks, i read the article but i hava a problem.
So when the cedf is like the first picture the result is good but when is like the second picture the result isn't good. Cacti do an addition.
Sorry for my poor english.
Any idea ?
| Description: |
|
| Filesize: |
10.04 KB |
| Viewed: |
1062 Time(s) |

|
| Description: |
|
| Filesize: |
12.84 KB |
| Viewed: |
1062 Time(s) |

|
|
|
| Back to top |
|
 |
mac_fly
Joined: 30 Jul 2008 Posts: 11
|
Posted: Wed Aug 13, 2008 7:46 am Post subject: |
|
|
Nobody have an idea ?
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Wed Aug 13, 2008 3:00 pm Post subject: |
|
|
For a graph with only a single data source, the second cdef will ALWAYS yield "0" as a result.
Reinhard
|
|
| Back to top |
|
 |
mac_fly
Joined: 30 Jul 2008 Posts: 11
|
Posted: Mon Aug 18, 2008 3:20 am Post subject: |
|
|
Hello,
I have two datasource :
+ free memory
+ total available memory
and i want the used memory so i have to subtract :
total available memory - free memory = used memory
But how can i do that ?
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Mon Aug 18, 2008 2:27 pm Post subject: |
|
|
| mac_fly wrote: | Hello,
I have two datasource :
+ free memory
+ total available memory
and i want the used memory so i have to subtract :
total available memory - free memory = used memory
But how can i do that ? | Assuming, that
a = free
b = total,
the cdef would be
cdef = b,a,-
Reinhard
|
|
| Back to top |
|
 |
mac_fly
Joined: 30 Jul 2008 Posts: 11
|
Posted: Tue Aug 19, 2008 3:55 am Post subject: |
|
|
| gandalf wrote: | Assuming, that
a = free
b = total,
the cdef would be
cdef = b,a,-
Reinhard |
Thanks gandalf,
Yes exactly but it work just when b is a value and not a datasource.(See screenshot).
|
|
| Back to top |
|
 |
Maestro_Ba
Joined: 06 Jun 2006 Posts: 34
|
Posted: Fri Aug 22, 2008 5:30 am Post subject: |
|
|
Hi. I made a template+script that shows the free memory and the total memory.
http://forums.cacti.net/viewtopic.php?p=142813
But the script I made also returns the used memory, I just chose not to graph it. Just make the appropriate changes.
|
|
| Back to top |
|
 |
|