[SOLVED] Graphs for Linux/Unix disks

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

MatsB
Cacti User
Posts: 57
Joined: Tue Jan 10, 2006 9:25 am

[SOLVED] Graphs for Linux/Unix disks

Post by MatsB »

What is the best templete or plugin to use if I wan't to graph the disk usage on a remote Linux and Unix server?
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

the best way IMHO is to set up Net-SNMP on your Unix boxes, and then use the "ucd/net SNMP" host template in Cacti.
[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]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Well, I slightly disagree with frederic (which I do very seldom). I'd like to advertise my pure SNMP solution posted to http://docs.cacti.net/node/227. Find the resources attached to the last chapter of that sequence.
It does exactly what the standard disk templates do, but is faster because it's SNMP only.
Be aware of the fact, that the HOST MIB support for DISK required for this is not available on all operating systems.
Reinhard
MatsB
Cacti User
Posts: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

Thanks for the tip.

I've tried created a new host templete and added ucd/net - Available Disk Space as Associated Graph Templates but I don't get any graphs.

Debug output:

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="MP - Hard Drive Space" \
--rigid \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
--slope-mode \
DEF:a="/var/www/rra/mp_hdd_free_4778.rrd":hdd_used:AVERAGE \
DEF:b="/var/www/rra/mp_hdd_free_4778.rrd":hdd_free:AVERAGE \
CDEF:cdefa=a,1024,* \
CDEF:cdefe=b,1024,* \
CDEF:cdefi=TIME,1202297594,GT,a,a,UN,0,a,IF,IF,TIME,1202297594,GT,b,b,UN,0,b,IF,IF,+,1024,* \
AREA:cdefa#F51D30:"Used" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
AREA:cdefe#002A97:"Available":STACK \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
LINE2:cdefi#000000:"Total" \
GPRINT:cdefi:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s"

RRDTool Says:

ERROR: opening '/var/www/rra/mp_hdd_free_4778.rrd': No such file or directory


These are the rrd files that was created in /var/www/rra:
-rw-r--r-- 1 www-data www-data 188744 2008-02-06 08:55 mp_hdd_free_4568.rrd
-rw-r--r-- 1 www-data www-data 188744 2008-02-06 12:35 mp_hdd_free_4794.rrd
-rw-r--r-- 1 www-data www-data 188744 2008-02-06 12:35 mp_hdd_total_4790.rrd
-rw-r--r-- 1 www-data www-data 188744 2008-02-06 12:35 mp_hdd_total_4791.rrd
-rw-r--r-- 1 www-data www-data 188744 2008-02-06 12:35 mp_hdd_total_4792.rrd

It's clear that there are a missmatch for these rrd files but why?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

If you're using the "ucd/net - Get Monitored Partitions" data query, can you try that :

Code: Select all

$ snmpwalk -v 1 -c yourcommunity xx.xx.xx.xx dskpath
[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]
MatsB
Cacti User
Posts: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

Polling my Linux server:

Code: Select all

admin@cacti:~$ snmpwalk -v 1 -c public 192.168.0.1 dskpath
UCD-SNMP-MIB::dskPath.1 = STRING: / 
Polling my Unix server

Code: Select all

admin@cacti:~$ snmpwalk -v 1 -c public 192.168.0.2 dskpath
End of MIB 
Last edited by MatsB on Wed Feb 06, 2008 8:22 am, edited 1 time in total.
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

What SNMP agent are you running on the second 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]
MatsB
Cacti User
Posts: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

I think we are running net-snmp 5.1.1 on our SUN Solaris server.

Does this answer your question?

Code: Select all

bash-3.00$ ps -ef | grep snmp
    root  1857     1   0   Aug 28 ?           0:11 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
    root  1881     1   0   Aug 28 ?           0:00 /usr/lib/dmi/snmpXdmid -s 
    root 29937     1   0   Oct 03 ?          40:23 /usr/sfw/sbin/snmpd
Last edited by MatsB on Wed Feb 06, 2008 8:29 am, edited 1 time in total.
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 yourcommunity xx.xx.xx.xx versiontag
[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]
MatsB
Cacti User
Posts: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

Code: Select all

admin@cacti:~$ snmpwalk -v 1 -c public 192.168.0.2 versiontag
UCD-SNMP-MIB::versionTag.0 = STRING: 5.1.1
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Did you add entries like that in snmpd.conf :

Code: Select all

disk /
disk /usr
[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]
MatsB
Cacti User
Posts: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

I have this in my snmpd.conf file

Code: Select all

disk /
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

On 192.168.0.2 ?
[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]
MatsB
Cacti User
Posts: 57
Joined: Tue Jan 10, 2006 9:25 am

Post by MatsB »

Sorry about that.

Code: Select all

disk /
was set on 192.168.0.1

Code: Select all

disk /
is not set on 192.168.0.2. I will try that.
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

You can also use "includeAllDisks" (see the HowTo in my signature).
[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 5 guests