[SOLVED] Better Linux memory usage graphs ?

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

Moderators: Developers, Moderators

kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

[SOLVED] Better Linux memory usage graphs ?

Post by kriskaido »

Hi,

I just installed the latest version (0.8.7a) of Cacti.
Before that, I used to look at collectd graphs from my provider, but I wanted more flexibility and more graphs.
I'm dissapointed by the "default" Linux memory usage and its details ... Here below are both graphs to explain what I mean ...

First they don't say the same thing ... How can I interpret them with such a difference ?

Is there a way to have finegrained memory usage graphs like collectd ?

Thanks,

Kris.
Attachments
Server memory usage for last 24 hours<br />Cacti graph.
Server memory usage for last 24 hours
Cacti graph.
graph_image.png (31.08 KiB) Viewed 46659 times
Server memory usage for last 24 hours<br />Graph from collectd rrd file.
Server memory usage for last 24 hours
Graph from collectd rrd file.
hour.png (26.11 KiB) Viewed 46659 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

you can a better memory template for Linux in this thread

I've made another one based on SNMP (see the attachement), I'll post the template soon.
Attachments
memory_linux.png
memory_linux.png (30.9 KiB) Viewed 46616 times
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

Post by kriskaido »

Thanks.
I installed it but it didn't work (existing graph, but empty).
I then installed update of script here :
http://forums.cacti.net/viewtopic.php?t ... c&start=30
but still have empty graph ... :(

cacti.log says :

Code: Select all

11/26/2007 12:35:02 PM - CMDPHP: Poller[0] Host[1] DS[60] WARNING: Result from CMD not valid.  Partial Result: failed:  0
I'm using 0.8.7a
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Try this one (exported from 0.8.7a).
Attachments
cacti_graph_template_ucdnet_-_memory_usage_linux.xml
(33.12 KiB) Downloaded 2931 times
cacti_graph_template_ucdnet_-_swap_usage.xml
(20.73 KiB) Downloaded 2029 times
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

Post by kriskaido »

Still nothing ... empty graph.
Could you give your netsnmp_memory_usage.php script too ?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

The 2 graph templates I've posted are SNMP based, so they don't need any script.

Could you check your poller cache ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

Post by kriskaido »

The poller cache says :

Code: Select all

Localhost - Memory Usage   	 Script: /usr/bin/php -q /home/orvo/sd/monitor/www/tools/cacti/scripts/netsnmp_memory_usage.php 127.0.0.1, public, 0, , , 161, 500
	RRD: /home/orvo/sd/monitor/www/tools/cacti/rra/localhost_usedreal_61.rrd
I even removed the netsnmp_memory_usage.php file, rebuilt the poller cache but this line stays ... ?
I stills have this in the logs :

Code: Select all

CMDPHP: Poller[0] Host[1] DS[61] WARNING: Result from CMD not valid.  Partial Result:
I also removed the rrd file, waited for the cron to run the poller, then the file localhost_usedreal_61.rrd file is recreated but graph is still empty
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Could you try to delete/rename the old graph template, and import the new one once again ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

Post by kriskaido »

I created the following graph :

Code: Select all

Localhost - Memory Usage  	ucd/net - Memory Usage (Linux)
Now I have no more errors in cacti.log, but I don't have any graph (not even empty).
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Can you display the graph with "debug mode" activated ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

Post by kriskaido »

Indeed there's an error :

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Localhost - Memory Usage" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
--slope-mode \
--font TITLE:8: \
--font AXIS:7: \
--font LEGEND:7: \
--font UNIT:7: \
DEF:a="/path/to/cacti/rra/localhost_mem_buffers_75.rrd":mem_buffers:AVERAGE \
DEF:b="/path/to/cacti/rra/localhost_mem_buffers_75.rrd":mem_buffers:MAX \
DEF:c="/path/to/cacti/rra/localhost_mem_cache_76.rrd":mem_cache:AVERAGE \
DEF:d="/path/to/cacti/rra/localhost_mem_cache_76.rrd":mem_cache:MAX \
DEF:e="/path/to/cacti/rra/localhost_mem_free_77.rrd":mem_free:AVERAGE \
DEF:f="/path/to/cacti/rra/localhost_mem_free_77.rrd":mem_free:MAX \
DEF:g="/path/to/cacti/rra/localhost_mem_total_78.rrd":mem_total:AVERAGE \
DEF:h="/path/to/cacti/rra/localhost_mem_total_78.rrd":mem_total:MAX \
CDEF:cdefa=d,c,-,b,-,a,-,1024,* \
CDEF:cdeff=a,1024,* \
CDEF:cdefj=b,1024,* \
CDEF:cdefba=c,1024,* \
CDEF:cdefbe=d,1024,* \
CDEF:cdefbf=e,1024,* \
CDEF:cdefbj=f,1024,* \
CDEF:cdefca=g,1024,* \
CDEF:cdefcb=h,1024,* \
AREA:cdefa#FFF200FF:"Memory Used"  \
GPRINT:cdefa:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdeff#6EA100FF:"Memory Buffers":STACK \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdeff:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefj:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdefba#942D0CFF:"Memory Cached":STACK \
GPRINT:cdefba:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefba:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefba:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefbe:MAX:"Max\:%8.2lf %s\n"  \
AREA:cdefbf#12B3B5FF:"Memory Free":STACK \
GPRINT:cdefbf:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefbf:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefbf:MIN:"Min\:%8.2lf %s"  \
GPRINT:cdefbj:MAX:"Max\:%8.2lf %s\n"  \
LINE1:cdefca#000000FF:"Memory Total"  \
GPRINT:cdefcb:MAX:"  Current\:%8.2lf %s" 

RRDTool Says:

ERROR: opening '/path/to/cacti/rra/localhost_mem_buffers_75.rrd': No such file or directory
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Which host template are you using for this host ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

Post by kriskaido »

OK. This was an SNMP community configuration problem.

Thank you very much for your help and time.

Kris.
kriskaido
Posts: 18
Joined: Wed Oct 26, 2005 10:15 am

Post by kriskaido »

I now have a graph, but it looks not okay. There are negative values and no "used memory".
Do you have any idea ?
Attachments
graph_image.png
graph_image.png (34.76 KiB) Viewed 46562 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Can you run that :

Code: Select all

$ snmpwalk -v 1 -c public localhost memory
UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 1004052 kB
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 1000472 kB
UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 905844 kB
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 23912 kB
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 1024384 kB
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB
UCD-SNMP-MIB::memShared.0 = INTEGER: 0 kB
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 125132 kB
UCD-SNMP-MIB::memCached.0 = INTEGER: 456184 kB
UCD-SNMP-MIB::memSwapError.0 = INTEGER: noError(0)
UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING:
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest