LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-06-2011, 01:00 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
How to configure MRTG ?


Hi,
I am using Centos 5 as squid proxy server. I want to configure MRTG to monitor live visual representation of internet traffic. Kindly guide me that how can I do it?

thanks in advance
garden
 
Old 06-06-2011, 01:06 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

You can set up MRTG on CentOS by following one of the many guides found on the internet. You should know by now that LQ is not the place to come to when looking for step by step or copy / paste guides. Have a look at this site found through Google.

Kind regards,

Eric
 
Old 06-06-2011, 01:28 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks for the reply. Actually i have google it before poasting my question.but there is a confustion that in some configure it use apachi.The reason is not clear. Is it a reason fatching data from localhost? Without configureing Apachi I know MRTG will configure but what we will miss without Apachi?
garden
 
Old 06-06-2011, 01:36 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

For as far as I know MRTG doesn't come with a webserver to display your data/graphs. So you need a webserver like Apache for example to do that. The MRTG cfgmaker creates a html page that you need to save to your Apache document root (or another directory if you've set that up with Apache). After that you can browse to that URL to view your data/graphs in a webbrowser.

Kind regards,

Eric
 
Old 06-06-2011, 05:26 AM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
One thing more I want to clear instead of internet bandwidth, for Lan card sent/received bytes,CPU,Memory and Hard Disk I/O does MRTG gives facility about its statistics ?
 
Old 06-06-2011, 05:36 AM   #6
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Yess. with help of SNMP or your own script MRTG generate graphs as you expecting..
 
Old 06-06-2011, 05:52 AM   #7
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Sample mrtg.cfg file, it may help you to configure MRTG
Code:
# Created by 
# /usr/local/mrtg/bin/cfgmaker --global "WorkDir: /usr/local/mrtg/www" --global "Options[_]: bits,growright" --output /usr/local/mrtg/cfg/mrtg.cfg public@localhost


### Global Config Options

#  for UNIX
# WorkDir: /home/http/mrtg

#  or for NT
# WorkDir: c:\mrtgdata

### Global Defaults

#  to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits

EnableIPv6: no
WorkDir: /usr/local/mrtg/www
Options[_]: bits,growright
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt,/usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt

######################################################################
# System: Est-Master
# Description: Linux Est-Master 2.6.18-164.el5xen #1 SMP Thu Sep 3 04:47:32 EDT 2009 i686
# Contact: 
# Location:
######################################################################


### Interface 2 >> Descr: 'eth0' | Name: 'eth0' | Ip: '10.77.104.35' | Eth: ###

Target[localhost_2]: 2:public@localhost:
SetEnv[localhost_2]: MRTG_INT_IP="10.77.104.35" MRTG_INT_DESCR="eth0"
MaxBytes[localhost_2]: 1250000
Title[localhost_2]: Traffic Analysis for 2 -- Est-Master
PageTop[localhost_2]: <h1>Traffic Analysis for 2 -- Est-Master</h1>

#
#Est_Master Server mrtg.cfg
#CPU Load -2
Target[Est_Master_cpu]: ssCpuRawUser.0&ssCpuRawUser.0:public@localhost + ssCpuRawSystem.0&ssCpuRawSystem.0:public@localhost + ssCpuRawNice.0&ssCpuRawNice.0:public@localhost
MaxBytes[Est_Master_cpu]: 100
Title[Est_Master_cpu]: CPU Load -- Est_Master
PageTop[Est_Master_cpu]: <h1> Active CPU Load in Percentage -- Est_Master</h1>
Unscaled[Est_Master_cpu]: ymwd
ShortLegend[Est_Master_cpu]: %
YLegend[Est_Master_cpu]: CPU Utilization
Legend1[Est_Master_cpu]: Active CPU in % (Load)
Legend2[Est_Master_cpu]:
Legend3[Est_Master_cpu]:
Legend4[Est_Master_cpu]:
LegendI[Est_Master_cpu]: Active
LegendO[Est_Master_cpu]:
Options[Est_Master_cpu]: growright,nopercent
#
#Memory Monitoring (Total Versus Available Memory) -3
#
Target[Est_Master_memory]: memAvailReal.0&memTotalReal.0:public@localhost
Title[Est_Master_memory]: Total vs Available Memory -- Est_Master
PageTop[Est_Master_memory]: <h1> Total vs Available Memory -- Est_Master</h1>
MaxBytes[Est_Master_memory]: 100000000000
ShortLegend[Est_Master_memory]: B
YLegend[Est_Master_memory]: Bytes
LegendI[Est_Master_memory]: Free
LegendO[Est_Master_memory]: Total
Legend1[Est_Master_memory]: Free memory, not including swap, in bytes
Legend2[Est_Master_memory]: Total memory
Options[Est_Master_memory]: gauge,growright,nopercent
kMG[Est_Master_memory]: k,M,G,T,P,X
#
#Memory Monitoring (Percentage available) -4
#
Title[Est_Master_mempercent]: Percentage Free Memory -- Est_Master
PageTop[Est_Master_mempercent]: <h1> Percentage Free Memory -- Est_Master</h1>
Target[Est_Master_mempercent]: ( memAvailReal.0&memAvailReal.0:public@localhost ) * 100 / ( memTotalReal.0&memTotalReal.0:public@localhost )
options[Est_Master_mempercent]: growright,gauge,transparent,nopercent
Unscaled[Est_Master_mempercent]: ymwd
MaxBytes[Est_Master_mempercent]: 100
YLegend[Est_Master_mempercent]: Memory %
ShortLegend[Est_Master_mempercent]: %
LegendI[Est_Master_mempercent]: Free
LegendO[Est_Master_mempercent]: 
Legend1[Est_Master_mempercent]: Percentage Free Memory
Legend2[Est_Master_mempercent]:
#
# New TCP Connection Monitoring (per minute) -5
#
Target[Est_Master_newconns]: tcpPassiveOpens.0&tcpActiveOpens.0:public@localhost
Title[Est_Master_newconns]: Newly Created TCP Connections --Est_Master
PageTop[Est_Master_newconns]:<H1>New TCP Connections --Est_Master</H1>
MaxBytes[Est_Master_newconns]: 10000000000
ShortLegend[Est_Master_newconns]: c/s
YLegend[Est_Master_newconns]: Conns / Min
LegendI[Est_Master_newconns]: In
LegendO[Est_Master_newconns]: Out
Legend1[Est_Master_newconns]: New inbound connections
Legend2[Est_Master_newconns]: New outbound connections
Options[Est_Master_newconns]: growright,nopercent,perminute
#
# Est_Masterablished TCP Connections -6
#
Target[Est_Master_estabcons]: tcpCurrEstab.0&tcpCurrEstab.0:public@localhost
Title[Est_Master_estabcons]: Currently Est_Master Established TCP Connections --Est_Master
PageTop[Est_Master_estabcons]:<H1>Est_Master Established TCP Connections --Est_Master</H1>
MaxBytes[Est_Master_estabcons]: 10000000000
ShortLegend[Est_Master_estabcons]: c/s
YLegend[Est_Master_estabcons]: Connections
LegendI[Est_Master_estabcons]: In
LegendO[Est_Master_estabcons]:
Legend1[Est_Master_estabcons]: Est_Masterablished connections
Legend2[Est_Master_estabcons]:
Options[Est_Master_estabcons]: growright,nopercent,gauge
#
# Load Average -7
#
Target[Est_Master_loadavg]: laLoadInt.2&laLoadInt.3:public@localhost
MaxBytes[Est_Master_loadavg]: 5000
Title[Est_Master_loadavg]: Load Average * 100 --Est_Master
PageTop[Est_Master_loadavg]:<H1> Load Average * 100 --Est_Master</H1>
YLegend[Est_Master_loadavg]: Load Average
ShortLegend[Est_Master_loadavg]:%
Legend1[Est_Master_loadavg]: Load average 5 min
Legend2[Est_Master_loadavg]: Load average 15 min
LegendI[Est_Master_loadavg]: 5min load avg
LegendO[Est_Master_loadavg]: 15min load avg
Options[Est_Master_loadavg]: nopercent,growright,noinfo,gauge
#
#Root partition availability -8
Target[Est_Master-root]: dskAvail.1&dskTotal.1:public@localhost
Title[Est_Master-root]: Disk usage: Root partition on Est_Master
PageTop[Est_Master-root]:<H1> Disk usage: Root partition on Est_Master (/)</H1>
MaxBytes[Est_Master-root]: 8217464832
Options[Est_Master-root]: nopercent,gauge,noinfo,growright
LegendI[Est_Master-root]:  Available:
LegendO[Est_Master-root]:  Total:
Ylegend[Est_Master-root]: bytes
ShortLegend[Est_Master-root]: bytes
Legend1[Est_Master-root]: Total space
Legend2[Est_Master-root]: Available space
Legend3[Est_Master-root]: Maximum total space
Legend4[Est_Master-root]: Maximum available space
kMG[Est_Master-root] : k,M,G,T,P,X
#Unscaled[Est_Master-root]: dwmy
#Directory[Est_Master-root]: system
#
################################################################################################
#
# Memory Utilization -10
# -------------------
#Target[Est_Master_mem]: `free | awk '/buffers\/cache/ {printf("%d\n",$4*1024);printf("%d\n",$3*1024); printf("%d\n",$4*1024); printf("%d\n",$3*1024)}'`
Target[Est_Master_mem]: memBuffer.0&memCached.0:public@localhost
Options[Est_Master_mem]: nopercent,gauge,noinfo,growright
Title[Est_Master_mem]: Memory Utilization (Cache & Buffer)
PageTop[Est_Master_mem]:<H1> Memory Utilization (Cache & Buffers) on Est_Master</H1>
#MaxBytes[Est_Master_mem]: 385476
MaxBytes[Est_Master_mem]: 100000000000
kMG[Est_Master_mem]: k,M,G,T,P,X
YLegend[Est_Master_mem]: RAM Utilization
ShortLegend[Est_Master_mem]:
Legend1[Est_Master_mem]: Buffer Memory
Legend2[Est_Master_mem]: Cached Memory
Legend3[Est_Master_mem]: Maximum Buffer Memory
Legend4[Est_Master_mem]: Maximum Cached Memory
LegendI[Est_Master_mem]: Buffer Mem
LegendO[Est_Master_mem]: Cached Mem
#WithPeak[Est_Master_mem]: ymw
#Unscaled[Est_Master_mem]: dwmy
Directory[Est_Master_mem]: system
#
# users -11
Target[Est_Master-users]: `who | wc -l | awk '{print $1; print 0; print 0; print 0}'`
Title[Est_Master-users]: Logged in users on Est_Master
PageTop[Est_Master-users]:<H1>Logged in users on Est_Master</H1>
MaxBytes[Est_Master-users]: 10
Options[Est_Master-users]: growright,nopercent,gauge
LegendI[Est_Master-users]:  users: 
LegendO[Est_Master-users]: 
Ylegend[Est_Master-users]: count
ShortLegend[Est_Master-users]:  user(s) 
Legend1[Est_Master-users]: Number of logged in users spent in system mode
Directory[Est_Master-users]: system
#
# No of open files -12
#Target[Est_Master-files]: `lsof | wc -l | awk '{printf("%d\n",$1); printf("%d\n",0); printf("%d\n",0)}'`
Target[Est_Master-files]: `/usr/local/mrtg/scripts/openfiles_lsof.sh`
Title[Est_Master-files]: Number of open files Est_Master
PageTop[Est_Master-files]:<H1>Number of open files Est_Master</H1>
MaxBytes[Est_Master-files]: 4000
Options[Est_Master-files]: growright,unknaszero,nopercent,gauge
LegendI[Est_Master-files]:
LegendO[Est_Master-files]: No of files: 
Ylegend[Est_Master-files]: count
ShortLegend[Est_Master-files]:  files
Legend1[Est_Master-files]: Number of open files
Directory[Est_Master-files]: system
#
#
#Packet loss -14
Title[Est_Master-rtt]: RTT to Host
PageTop[Est_Master-rtt]: <H1>Host Round Trip Time</H1>
Target[Est_Master-rtt]: `/usr/local/mrtg/scripts/packet_loss.sh`
MaxBytes[Est_Master-rtt]: 2000
Options[Est_Master-rtt]: growright,unknaszero,nopercent,gauge
LegendI[Est_Master-rtt]: Pkt loss %
LegendO[Est_Master-rtt]: Avg RTT
YLegend[Est_Master-rtt]: RTT (ms)
ShortLegend[Est_Master-rtt]: p/s
#

Last edited by kirukan; 06-06-2011 at 05:58 AM.
 
1 members found this post helpful.
Old 06-06-2011, 06:54 AM   #8
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
kirukan really nice help
 
Old 09-13-2011, 08:19 AM   #9
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 73

Rep: Reputation: 21
uhhm, what about the mrtg/script scripts ????
 
Old 09-13-2011, 08:35 AM   #10
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by spatieman View Post
uhhm, what about the mrtg/script scripts ????
Make more clear your question
 
Old 09-14-2011, 03:39 AM   #11
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 73

Rep: Reputation: 21
mu excueses.
as what i see.
# No of open files -12
#Target[Est_Master-files]: `lsof | wc -l | awk '{printf("%d\n",$1); printf("%d\n",0); printf("%d\n",0)}'`
Target[Est_Master-files]: `/usr/local/mrtg/scripts/openfiles_lsof.sh`
above script, as far i guess, there is no scripts directory in mrtg default install.
i can be wrong, becouse i use openBSD 4.9 ...
and as for the loadmbits, usefull, ...
 
Old 09-14-2011, 03:51 AM   #12
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by spatieman View Post
mu excueses.
as what i see.
# No of open files -12
#Target[Est_Master-files]: `lsof | wc -l | awk '{printf("%d\n",$1); printf("%d\n",0); printf("%d\n",0)}'`
Target[Est_Master-files]: `/usr/local/mrtg/scripts/openfiles_lsof.sh`
above script, as far i guess, there is no scripts directory in mrtg default install.
i can be wrong, becouse i use openBSD 4.9 ...
and as for the loadmbits, usefull, ...
Yup in default the script not there in MRTG, but you can write own script to plot graph
 
Old 09-14-2011, 05:04 AM   #13
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 73

Rep: Reputation: 21
ya, i manage to script,cough,cough, some nice things.
uhm, and copy/past it (some from above,so ,thank you).
currently i also use statgrab, works great to.
but making a script for getting IFstats per machine is a bitch..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] can't configure mrtg-2.17 slackbuild on slack13.1 nass Slackware 3 02-07-2011 06:40 AM
How Configure MRTG to Monitor Network asraful islam Linux - Newbie 2 05-20-2009 01:20 PM
inastall & configure mrtg in fedora distro alnmostafa Linux - Networking 1 01-17-2007 11:25 AM
can't get mrtg going varun_saa Fedora 1 02-17-2005 08:40 AM
rrd mrtg & mrtg-rrd.cgi ducati620 Linux - Newbie 0 06-03-2004 07:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration