Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MRTG and setup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Mon Oct 13, 2003 6:53 pm    Post subject: MRTG and setup Reply with quote

I emerged snmp and MRTG to monitor traffic on my server...

mrtgconfig.conf:
Code:
WorkDir: /home/httpd/htdocs/mrtg
 Target[r1]: 2:public@lukesteiner.com
 MaxBytes[r1]: 8000
 Title[r1]: Traffic Analysis ISDN
 PageTop[r1]: <H1>Stats for our ISDN Line</H1>


This is the basic setup from their site. I tried making one with CFGMAKER...but it always had an error if I tried to start mrtg.

I haven't received a graph or webpage yet from the service....

I started the service with:
Code:
root# mrtg /etc/mrtgconfig.conf



I waited 15 minutes...which should have made at least 1 graph....

SNMP is started as well...


any ideas?
Back to top
View user's profile Send private message
internet_pixie
n00b
n00b


Joined: 13 Oct 2003
Posts: 8

PostPosted: Mon Oct 13, 2003 8:29 pm    Post subject: RE: MRTG Reply with quote

mrtg is used to collect the data to generate the graph(s). You will need something like RRDTool to generate the graphs you want to see.

At least that is always how I have used MRTG

Cheers

internet_pixie
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Tue Oct 14, 2003 2:38 pm    Post subject: Reply with quote

Code:
 # mrtg /etc/mrtgconfig.conf
SNMP Error:
no response received
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 1882886554
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 458
SNMPGET Problem for ifInOctets.2 ifOutOctets.2 on public@127.0.0.1
 at /usr/bin/mrtg line 1678
WARNING: skipping because at least the query for ifInOctets.2 on  127.0.0.1 did not succeed
WARNING: no data for ifInOctets&ifOutOctets:public@127.0.0.1. Skipping further queries for Host 127.0.0.1 in this round.
ERROR: Target[name-of-machine][_IN_] ' $$target[0]{$mode} ' did not eval into defined data
ERROR: Target[name-of-machine][_OUT_] ' $$target[0]{$mode} ' did not eval into defined data


This is what I get when I run MRTG. SNMP is Running.

Here is my SNMP.conf:
Code:
## /etc/snmpd.conf:

## location of the config files:
party.conf:   /etc/party.conf
acl.conf:     /etc/acl.conf
view.conf:    /etc/view.conf
context.conf: /etc/context.conf

## public- and private-community string (for SNMP V1):
## default is "public" and "private"
public:       newpublic
private:      newprivate

## the entry of system.sysContact and system.sysLocation:
system contact:  sysadmin
system location: systemlocation

## system.sysName is per default determined from the hostname:
system name:     systemname
## trap sink ipaddress (trap destination) and community string.
## authentraps contains the value of snmpEnableAuthenTraps;
## (default is `no'' == disabled).
trap sink:       tcp_ip
trap community:  public
authentraps:     no



My MRTG.cfg is:
Code:
# Global configuration
WorkDir: /var/log/mrtg
WriteExpires: Yes
Logformat: rrdtool

#For every machine
Target[name-of-machine]: 2:public@127.0.0.1
MaxBytes[name-of-machine]: 12500000
Title[name-of-machine]:
PageTop[name-of-machine]:


Any Ideas?
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Tue Oct 14, 2003 5:27 pm    Post subject: Reply with quote

See if you can snmpwalk your localhost. That's usually a good test. Something like the following is good basic test.

snmpwalk -Os -c public -v 1 localhost system

If that doesn't work then you know it's your snmp server and not MRTG. You may want to to check out some docs I wrote on installing and running MRTG on Gentoo as well.

http://www.badapple.net/mrtg/index.html

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Tue Oct 14, 2003 10:15 pm    Post subject: Reply with quote

That didn't work...should I send anything here to help figure out what is going on?
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Tue Oct 14, 2003 10:46 pm    Post subject: Reply with quote

If an snmpwalk did not work I'd start troubleshooting your snmp daemon vs looking at MRTG. Start by making sure the daemon is actually running and then reading the threads on snmpd. Nothing jumped out at me in your config, but you might want to check the contents of your acl.conf to make sure you are allowing queries from you IP's and localhost.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Tue Oct 14, 2003 11:35 pm    Post subject: Reply with quote

I don't even have an acl.conf....:)

Any Ideas?


Do I need that file?
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Tue Oct 14, 2003 11:35 pm    Post subject: Reply with quote

I don't even have an acl.conf....:)

Any Ideas?


Do I need that file?
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Wed Oct 15, 2003 1:15 am    Post subject: Reply with quote

if I do an snmpwalk....
I get
Quote:
timeout: no response from localhost



Any ideas?
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Wed Oct 15, 2003 10:50 pm    Post subject: Reply with quote

start snmpd on localhost :roll:
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Thu Oct 16, 2003 4:18 am    Post subject: Reply with quote

It is started....


Any Ideas?
Back to top
View user's profile Send private message
Vergo
n00b
n00b


Joined: 19 Apr 2003
Posts: 42
Location: Oulu, Finland

PostPosted: Thu Oct 16, 2003 8:01 am    Post subject: Reply with quote

nightcanton wrote:
It is started....
Any Ideas?


I think the 'problem' is in your snmp.conf since it says that the public community will be renamed to newpublic. So instead of trying
Code:
snmpwalk -Os -c public -v 1 localhost system

you should try
Code:
snmpwalk -Os -c newpublic -v 1 localhost system


If that works then use newpublic also in mrtg.conf

BTW, if you don't need a webpage displaying graphs about traffic then you could try vnStat. It's console-based and doesn't need an snmpd running. See the webpage for few 'screenshots'.
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Tue Oct 21, 2003 4:56 am    Post subject: Reply with quote

Code:
snmp # snmpwalk -Os -c newpublic -v 1 localhost system
Timeout: No Response from localhost
root@lukesteiner snmp # /etc/init.d/snmpd start
 * WARNING:  "snmpd" has already been started.
root@lukesteiner snmp # snmpwalk -Os -c newpublic -v 1 localhost system
Timeout: No Response from localhost
root@lukesteiner snmp # snmpwalk -Os -c public -v 1 localhost system
Timeout: No Response from localhost
root@lukesteiner snmp # nano snmpd.conf
root@lukesteiner snmp # /etc/init.d/snmpd stop
 * Stopping net-snmpd...                                                  [ ok ]
root@lukesteiner snmp # /etc/init.d/snmpd start
 * Starting net-snmpd...                                                  [ ok ]
root@lukesteiner snmp # snmpwalk -Os -c public -v 1 localhost system
Timeout: No Response from localhost
root@lukesteiner snmp # snmpwalk -Os -c private -v 1 localhost system
Timeout: No Response from localhost


I tried what you told me to Vergo....then I changed the config to read "public"insead of "newpublic"...


Still same results.
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Tue Oct 21, 2003 5:12 am    Post subject: Reply with quote

Code:
htdocs # mrtg mrtg.cfg
SNMP Error:
no response received
SNMPv1_Session (remote host: "127.0.0.1" [127.0.0.1].161)
                  community: "public"
                 request ID: 1881147161
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/bin/../lib/mrtg2/SNMP_util.pm line 458
SNMPGET Problem for ifInOctets.1 ifOutOctets.1 sysUptime sysName on public@127.0.0.1
 at /usr/bin/mrtg line 1678
WARNING: skipping because at least the query for ifInOctets.1 on  127.0.0.1 did not succeed
WARNING: no data for ifInOctets&ifOutOctets:public@127.0.0.1. Skipping further queries for Host 127.0.0.1 in this round.
ERROR: Target[lukesteiner.com][_IN_] ' $$target[0]{$mode} ' did not eval into defined data
ERROR: Target[lukesteiner.com][_OUT_] ' $$target[0]{$mode} ' did not eval into defined data
WARNING: Skipping Update of lukesteiner.com, inlast is not defined
WARNING: Skipping Update of lukesteiner.com, outlast is not defined

This is what I get.
Back to top
View user's profile Send private message
nightcanton
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 249

PostPosted: Tue Oct 21, 2003 5:17 am    Post subject: Reply with quote

Do I need SNMP to make MRTG work? Or is there a way to leave it out....


I don't beleive so, but it is worth a shot. In the MAN and the HOW-TO files for MRTG, the documentation doesn't say anything about SNMP...
Back to top
View user's profile Send private message
cato`
Guru
Guru


Joined: 03 Jun 2002
Posts: 430
Location: Norway, Trondheim

PostPosted: Tue Oct 21, 2003 12:48 pm    Post subject: Reply with quote

You could try to use HotSaNIC instead of MRTG ... Does the same thing as MRTG (only HotSaNIC is easy to set up)
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Tue Oct 21, 2003 7:13 pm    Post subject: Reply with quote

MRTG queries snmp to get its data. If there is no snmp daemon there is no data. This goes for hotsanic, cricket, and most of the other graphing programs as well.

Rather then assume the init.d startup scripts worked, what does a
ps -ef | grep snmp
show? I highly doubt your snmp daemon is ACTUALLY RUNNING. You'll need to look at you logs and check the other snmpd threads in this forum to troubleshoot it. If it is running it might not be allowing access so you'll need to look at how the access control is setup.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum