View previous topic :: View next topic |
Author |
Message |
anidabi Tux's lil' helper
Joined: 05 Feb 2005 Posts: 102 Location: Finland
|
Posted: Tue Mar 29, 2005 2:19 pm Post subject: |
|
|
First I have to say that this is very good and easy HOWTO. Thanks for that.
But I have a broblem. That being that mrtg doesn't generate the images for the web page. Actually it doesnt generate or have any images on the page, only the slots where they should be. Not even the mrtg advertisement at the bottom of the web page.
I did everything as told and I didn't get any errors what so ever, except "/usr/bin/mrtg: bad interpreter: No such file or directory" when running the scripts. In HOWTO there was said that ignore any errors concerning running the scripts, so I guess that it's perfectly normal? Or am I deeply lost on this one? Are those scripts the ones tha generate the images? Then I thought that maeby my snmp doesn't work, but when running this command "snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex", it showed all my ethernet ip's correctly for every ethernet devices. A bit stange is that I didn't change the snmpd.conf at all, still it did show my ip addresses correctly. Is that what it suppose to do?
Does anyone gnow what might be the broblem, have I missed something? _________________ How do you do the things you do... |
|
Back to top |
|
|
anidabi Tux's lil' helper
Joined: 05 Feb 2005 Posts: 102 Location: Finland
|
Posted: Wed Mar 30, 2005 3:52 pm Post subject: |
|
|
I'm going to answer myself to my own question.
n00b mode *ON*
That bad interpreter wans't what supposet to happen, and thank god for google. I found out that the /etc/cron.mrtg/*.sh files did have everything in same line. Of course it supposed to be that the #!/bin/sh has to be on it's own line and the rest on it's own. So here is a little pointer for those who have this same broblen and is running n00b mode *ON*.
n00b mode *OFF* _________________ How do you do the things you do... |
|
Back to top |
|
|
Tuinslak Tux's lil' helper
Joined: 26 Nov 2003 Posts: 129 Location: Belgium
|
Posted: Sat Apr 16, 2005 11:38 am Post subject: |
|
|
Some people pm'ed me for my mrtg cfg's and so on, so from now on I've set them online right here
With those configs you should be able to make these stats.
All credits go to whoever made parts of the config and the .sh or .pl script(s). most of it came from Google or Gentoo forums. _________________ Tuinslak |
|
Back to top |
|
|
SilverOne Apprentice
Joined: 10 Nov 2003 Posts: 161
|
Posted: Sat Apr 16, 2005 11:53 am Post subject: |
|
|
looking good!
I've got similar stats, just without the lm_sensor stuff.
Question: I don't see you using uptime.cfg or the mrtg-countapps.sh, any particular reason?
EDIT: looking back through this thread, I notice I haven't even thanked the author!
So I'd like to thank khazad-dum and the others in this thread for the excellent how-to!
I've been using the stats as a quick rundown of system status for a year now, and it works great!
Last edited by SilverOne on Sat Apr 16, 2005 12:08 pm; edited 1 time in total |
|
Back to top |
|
|
Tuinslak Tux's lil' helper
Joined: 26 Nov 2003 Posts: 129 Location: Belgium
|
Posted: Sat Apr 16, 2005 12:00 pm Post subject: |
|
|
I use mrtg-numprocs.sh instead of countapps (worked better I think)
And I dont use uptime.cfg because I couldn't set it to display monthly or yearly instead of daily (on mrtg.rootspirit.com).
When I changed the index (using indexmaker) it sets all scripts to yearly instead of only the uptime script. _________________ Tuinslak |
|
Back to top |
|
|
SilverOne Apprentice
Joined: 10 Nov 2003 Posts: 161
|
Posted: Sat Apr 16, 2005 12:10 pm Post subject: |
|
|
That explains why I couldn't quickly determine what new functionality countapps would give
thanks. |
|
Back to top |
|
|
qriff n00b
Joined: 04 Dec 2003 Posts: 73
|
Posted: Mon Apr 18, 2005 9:31 am Post subject: |
|
|
Should be (4 typo-errors):
Code: |
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
WorkDir: /var/www/localhost/htdocs/mrtg
Target[localhost.partition-name]:hrStorageSize.1&hrStorageUsed.1:public@localhost
MaxBytes[localhost.partition-name]: 3000000
Title[localhost.partition-name]: Disk / Usage
PageTop[localhost.partition-name]: <H1>Disk / Usage</H1>
ShortLegend[localhost.partition-name]: B
kMG[localhost.partition-name]: k,M,G,T,P
kilo[localhost.partition-name]: 1024
YLegend[localhost.partition-name]: DISK / Utilization
Legend1[localhost.partition-name]: Root disk size
Legend2[localhost.partition-name]: Root disk usage
Legend3[localhost.partition-name]:
Legend4[localhost.partition-name]:
LegendI[localhost.partition-name]: Root disk size
LegendO[localhost.partition-name]: Root disk usage
Options[localhost.partition-name]: gauge,nopercent
|
corrected
khazad-dum wrote: | Disk usage:
Code: |
/usr/bin/snmpwalk -v 1 -c public localhost | grep hrStorageDescr
|
Now, you have the map of your disk (for example: hrStorageDescr.1 is /, hrStorageDescr.2 is /home...etc etc)
After that, you can get the value of partitions:
Code: |
/usr/bin/snmpwalk -v 1 -c public localhost hrStorageUsed.1
HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 1640653
|
Mrtg's config file must have 2 value: hrStorageSize.1 and hrStorageUsed.1.
Code: |
/bin/cat -s > /etc/mrtg/disk.cfg
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
WorkDir: /var/www/localhost/mrtg
Target[localhost.partition-name]:hrStorageSize.1&hrStorageUsed.1:public@localhost
MaxBytes[localhost.partition-name]: 3000000
Title[localhost.partition-name]: Disk / Usage
PageTop[localhost.partition-name]: <H1>Disk / Usage</H1>
ShortLegendlocalhost.partition-name[]: B
kMG[localhost.partition-name]: k,M,G,T,P
kilo[localhost.partition-name]: 1024
YLegend[localhost.partition-name]: DISK / Utilization
Legend1localhost.partition-name[]: Root disk size
Legend2[localhost.partition-name]: Root disk usage
Legend3[localhost.partition-name]:
Legend4[localhost.partition-name]:
LegendIlocalhost.partition-name]: Root disk size
LegendO[localhost.partition-name]: Root disk usage
Options[localhost.partition-name]: gauge,nopercent
|
Now just press [ctrl+d]
Memory usage was described in the first post.
khazad-dum |
|
|
Back to top |
|
|
qriff n00b
Joined: 04 Dec 2003 Posts: 73
|
Posted: Mon Apr 18, 2005 10:13 am Post subject: |
|
|
I also recommend increasing the timeout for snmpwalking to 3 or more (retry times default to 5)...
Code: |
snmpwalk -v 2c -t 3 -c public localhost > snmp-list.txt
|
|
|
Back to top |
|
|
[sinz] n00b
Joined: 08 Jun 2004 Posts: 71
|
Posted: Tue Apr 19, 2005 5:40 am Post subject: |
|
|
used bits and pieces of this and it was extremely helpful, thanks. |
|
Back to top |
|
|
hellraiser Guru
Joined: 14 Jun 2003 Posts: 431 Location: Pescara [Italy]
|
Posted: Tue Nov 22, 2005 5:05 pm Post subject: |
|
|
I would want that they give all info of the net interfaces are in kb and not in bits
How to??
Sorry for my english... _________________ Io non sono nessuno...ma nessuno è come me!
"Open Source is a good idea..." |
|
Back to top |
|
|
zaphyr Guru
Joined: 07 Dec 2004 Posts: 312 Location: Copenhagen, Denmark
|
Posted: Sat Dec 24, 2005 11:04 pm Post subject: |
|
|
Great HOW-TO!
Is there any way I can get to see the actual traffic...like which IP's I am connecting to and vice versa?
Thanks! _________________ emerge IQ |
|
Back to top |
|
|
debak n00b
Joined: 11 Feb 2007 Posts: 1
|
Posted: Sun Feb 11, 2007 1:32 pm Post subject: Making mrgg.cfg |
|
|
wHEN I run this, i have an error, and i don't know why
******************************
Code: | cfgmaker --global "WorkDir: /var/www/localhost/htdocs/mrtg/" \
> --global "Options[_]: growright,bits" \
> --ifref=ip \
> public@localhost > /etc/mrtg/mrtg.cfg |
I recieved:
Code: | SNMP Error:
no response received
SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)
community: "public"
request ID: 332966126
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.1 on public@localhost::::::v4only
at /usr/bin/cfgmaker line 918
WARNING: Skipping public@localhost: as no info could be retrieved |
***************************************************
Alghout /etc/mrtg/mrtg.cfg was created
What is wrong?
I have NET-SNMP version: 5.2.1.2
THX for help |
|
Back to top |
|
|
suprnaut n00b
Joined: 14 Apr 2007 Posts: 5
|
Posted: Sat Apr 14, 2007 11:55 am Post subject: localhost_eth0.html not found |
|
|
Hi guys. I have trouble running MRTG on my gentoo installation.
I am running apache webserver and it works fine (the docs are located at /var/www/localhost/htdocs/).
I ran through the howto described first in this post, and I got no errors at all. *EDIT* When i run /etc/cron.mrtg/traffic.sh I get this error, saying: "bash: /etc/cron.mrtg/traffic.sh: Permission denied" - but it said in the howto to ignore warnings. .."
EDIT AGAIN (sorry, ftw) - my traffic.sh was not executable.. So i CHMOD it (700), ran it three times (got warnings), and it is working just fine.
I only followed the "traffic guide" though, as this is my main interest, thus only mrtg and net-snmp have been installed. When I come to think of it, maybe this is why I have the problem I have.. I'll post this reply anyways..
When I try to use http://colonel/mrtg (as colonel is the machine name) I have the option to press "localhost_eth0 Traffic Graph" as a link. When I do that, I am being redirected to http://colonel/mrtg/localhost_eth0.html, but that file is not present at all (404 Not Found) in the mrtg folder.
I saw in the source code of the mrtg/index.html that it was supposed to be an *.png file there, as an image, but it won't be displayed (it's not present in mrtg folder either).
What have I done wrong, and what can be done to show them stats? I have read through this MRTG guide and the other one.. Couldn't find any answers. |
|
Back to top |
|
|
lorano n00b
Joined: 27 Sep 2003 Posts: 66
|
Posted: Sat Aug 18, 2007 6:37 am Post subject: |
|
|
I've tried
Quote: |
/bin/cat -s > /etc/mrtg/traffic.cfg
WorkDir: /var/www/localhost/htdocs/mrtg
Options[_]: bits,growright
Target[localhost_eth0]: 2:public@localhost:
SetEnv[localhost_eth0]: MRTG_INT_IP="" MRTG_INT_DESCR="eth0"
MaxBytes[localhost_eth0]: 1250000
Title[localhost_eth0]: Title
PageTop[localhost_eth0]: <H1>PageTop</H1>
<TABLE>
<TR><TD>System:</TD> <TD>System</TD></TR>
<TR><TD>Maintainer:</TD> <TD>Maintainer</TD></TR>
<TR><TD>Description:</TD><TD>eth0 </TD></TR>
<TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
<TR><TD>ifName:</TD> <TD></TD></TR>
<TR><TD>Max Speed:</TD> <TD>xxx Mbits/s</TD></TR>
<TR><TD>Ip:</TD> <TD>Ip()</TD></TR>
</TABLE>
|
And I still don't get quite what I'm looking for. I'd like to monitor eth0 and eth1 just to watch the traffic between the two if possible. Eth0 is connected to my cable modem, and eth1 is connected up to my switch internal. Any way to do that? |
|
Back to top |
|
|
|