LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-26-2005, 04:48 AM   #1
Soulstealer
Member
 
Registered: Dec 2004
Location: Necropolis
Distribution: FreeBSD
Posts: 47

Rep: Reputation: 15
MRTG -> remote host


Hi, guys
I'm running MRTG on my linux box which is router for 2 machines.
The graphs are working fine for my internal and external interfaces.
But now I want separate graphs for the 2 machines behind the router.
How can I do this ?
I tried the following with cfgmaker
Code:
cfgmaker --global 'WorkDir: /var/www/htdocs/mrtg' --global 'Options[_]: bits,growright' public@localhost public@192.168.10.3 public@192.168.10.2 > /store/mrtg.cfg
for public@localhost everything is fine
but for the rest
I got
Code:
--base: Get Device Info on public@192.168.10.3:
Error:
  can't resolve "192.168.10.3" to IP address
 at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 426
SNMPWALK Problem for public@192.168.10.3::::::v4only
 at ./cfgmaker line 831
WARNING: Skipping public@192.168.10.3: as no info could be retrieved
can anyone help me ?

thank you
 
Old 06-26-2005, 09:47 PM   #2
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
for the two "remote" hosts that you want to graph, you need to have snmp services enabled on both. look for "mrtg snmp howto". if the two boxes are using MS Windows XP, you can insatll the snmp service from the installation CD.

the errors that you have are likely due to snmpd not installed or configured.
 
Old 06-27-2005, 12:56 PM   #3
Soulstealer
Member
 
Registered: Dec 2004
Location: Necropolis
Distribution: FreeBSD
Posts: 47

Original Poster
Rep: Reputation: 15
Thank you
But I don't like this solution...
I realized that iptables can give me the information for the traffic incoming and outgoing from the "remote" hosts.
But I can't understand how exactly to do this
Is something like:
ipt -N download
ipt -N upload
ipt -A FORWARD -j download
ipt -A FORWARD -j upload
ipt -A download -d 192.168.10.2 -j ACCEPT
ipt -A upload -s 192.168.10.2 -j ACCEPT

and then with iptables -L -n -v -x
I can see the bytes and packets
but how to build the target in mrtg.cfg ?

thank you
 
Old 06-27-2005, 06:11 PM   #4
demian
Member
 
Registered: Apr 2001
Location: Bremen, Germany
Distribution: Debian
Posts: 303

Rep: Reputation: 30
Setting up a rule like you said would work. Next thing is to write a script that reads out the second column of the output of iptables -nvxL upload and iptables -nvxL download say every five minutes. The output of the script _must_ consist of exactly four lines: the incoming counter, the outgoing counter, the uptime of the host (this will be hard to come by if you refuse to use snmp but you can just stick the localhost uptime in here and ignore this value) and some_name. Then you can setup a target in mrtg.cfg like so:

Target[some_name]:`/path/to/your/script`
Title[some_name]: blah blah
...

You might want to check out pmacct and consider using that rather than iptables. Also rrdtool handles non-snmp data a lot better than mrtg does and you're not restricted to integer data values or that four line output format. Might also be worth a look.
 
  


Reply



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
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 12:21 AM
Mount remote host mrbabis Linux - Newbie 1 10-24-2005 05:10 PM
Using SVN from a remote host? Paulra Linux - Software 1 10-24-2005 09:28 AM
Resolving <www.some remote host>.... failed: Host not found. koodoo Linux - Newbie 2 06-27-2005 08:48 AM
Best way to connect to a remote host? neilcpp Linux - Networking 1 09-01-2003 01:11 PM

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

All times are GMT -5. The time now is 06:05 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