Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Script memory

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
mac_fly



Joined: 30 Jul 2008
Posts: 11

PostPosted: Fri Aug 08, 2008 3:40 am    Post subject: Script memory Reply with quote

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: 501
Location: Canada

PostPosted: Sat Aug 09, 2008 10:22 am    Post subject: Reply with quote

Read these two articles:

http://docs.cacti.net/node/528
http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html
Back to top
mac_fly



Joined: 30 Jul 2008
Posts: 11

PostPosted: Tue Aug 12, 2008 4:59 am    Post subject: Reply with quote

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 ?



cedf_string_value.png
 Description:
 Filesize:  10.04 KB
 Viewed:  1036 Time(s)

cedf_string_value.png



cdef.png
 Description:
 Filesize:  12.84 KB
 Viewed:  1036 Time(s)

cdef.png


Back to top
mac_fly



Joined: 30 Jul 2008
Posts: 11

PostPosted: Wed Aug 13, 2008 7:46 am    Post subject: Reply with quote

Nobody have an idea ?
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12186
Location: Muenster, Germany

PostPosted: Wed Aug 13, 2008 3:00 pm    Post subject: Reply with quote

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

PostPosted: Mon Aug 18, 2008 3:20 am    Post subject: Reply with quote

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: 12186
Location: Muenster, Germany

PostPosted: Mon Aug 18, 2008 2:27 pm    Post subject: Reply with quote

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

PostPosted: Tue Aug 19, 2008 3:55 am    Post subject: Reply with quote

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

PostPosted: Fri Aug 22, 2008 5:30 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group