Script memory

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
mac_fly
Posts: 11
Joined: Wed Jul 30, 2008 2:47 am

Script memory

Post by mac_fly »

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.
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
mac_fly
Posts: 11
Joined: Wed Jul 30, 2008 2:47 am

Post by mac_fly »

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 ?
Attachments
cdef.png
cdef.png (12.84 KiB) Viewed 3573 times
cedf_string_value.png
cedf_string_value.png (10.04 KiB) Viewed 3573 times
mac_fly
Posts: 11
Joined: Wed Jul 30, 2008 2:47 am

Post by mac_fly »

Nobody have an idea ? :cry:
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

For a graph with only a single data source, the second cdef will ALWAYS yield "0" as a result.
Reinhard
mac_fly
Posts: 11
Joined: Wed Jul 30, 2008 2:47 am

Post by mac_fly »

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 ?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

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
mac_fly
Posts: 11
Joined: Wed Jul 30, 2008 2:47 am

Post by mac_fly »

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).
Maestro_Ba
Posts: 36
Joined: Tue Jun 06, 2006 10:53 am

Post by Maestro_Ba »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests