View Full Version : MRTG and install ufff
domus 08-07-2001, 10:49 PM well i tried to install mrtg on my server but with no success
now i folowed all the steps as on the offical mrtg page and evrything was ok until i camed to this
The next step is now to configure mrtg for monitoring an network device. This is done by creating an mrtg.cfg file which defines what you want to monitor. Luckily you don't have to dive straight in and start writing your own configuration file all by yourself. Together with mrtg you also got a copy of cfgmaker. This is a script you can point at a router of your choice; and it will create a mrtg configuration file for you. You can find the script in the bin subdirectory.
cfgmaker --global 'WorkDir: /home/httpd/mrtg' \
--global 'Options[_]: bits,growright' \
--output /home/mrtg/cfg/mrtg.cfg \
community@router.abc.xyz
ok so i went to my server and typed
/usr/local/mrtg-2/bin/cfgmaker --global 'WorkDir: /home/httpd/mrtg' --global 'Options[_]: bits,growright' --output /home/mrtg/cfg/mrtg.cfg public@212.43.244.7
212.43.244.7 that's the ip of my server
this is what i get
[root@ns1 bin]# /usr/local/mrtg-2/bin/cfgmaker --global 'WorkDir: /home/httpd/mrtg' --global 'Options[_]: bits,growright' --output /home/mrtg/cfg/mrtg.cfg public@212.43.244.7
--base: Get Device Info on public@212.43.244.7:
SNMP Error:
receiving response PDU: Connexion refusée
SNMPv1_Session (remote host: "212.43.244.7" [212.43.244.7].161)
community: "public"
request ID: 261193918
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 450
SNMPGET Problem for sysDescr sysContact sysName sysLocation sysObjectID on public@212.43.244.7:
at /usr/local/mrtg-2/bin/cfgmaker line 657
--base: Vendor Id:
--base: Populating confcache
--snpo: Skipping ifName scanning because public@212.43.244.7: does not seem to support it
--snpo: Skipping ifDescr scanning because public@212.43.244.7: does not seem to support it
--snpo: Skipping ipAdEntIfIndex scanning because public@212.43.244.7: does not seem to support it
--snpo: Skipping ifType scanning because public@212.43.244.7: does not seem to support it
--snpo: Skipping ifPhysAddress scanning because public@212.43.244.7: does not seem to support it
--base: Get Interface Info
--base: Walking ifIndex
SNMP Error:
receiving response PDU: Connexion refusée
SNMPv1_Session (remote host: "212.43.244.7" [212.43.244.7].161)
community: "public"
request ID: 261193924
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.1 on public@212.43.244.7:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifType
SNMP Error:
receiving response PDU: Connexion refusée
SNMPv1_Session (remote host: "212.43.244.7" [212.43.244.7].161)
community: "public"
request ID: 261193925
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.3 on public@212.43.244.7:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifSpeed
SNMP Error:
receiving response PDU: Connexion refusée
SNMPv1_Session (remote host: "212.43.244.7" [212.43.244.7].161)
community: "public"
request ID: 261193926
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.5 on public@212.43.244.7:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifAdminStatus
SNMP Error:
receiving response PDU: Connexion refusée
SNMPv1_Session (remote host: "212.43.244.7" [212.43.244.7].161)
community: "public"
request ID: 261193927
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.7 on public@212.43.244.7:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifOperStatus
SNMP Error:
receiving response PDU: Connexion refusée
SNMPv1_Session (remote host: "212.43.244.7" [212.43.244.7].161)
community: "public"
request ID: 261193928
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.8 on public@212.43.244.7:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Writing /home/mrtg/cfg/mrtg.cfg
please help
domus 08-07-2001, 10:55 PM ok now
i have found the f. router
by tracing to my ip and used ip before mine
and i geted this
[root@ns1 bin]# /usr/local/mrtg-2/bin/cfgmaker --global 'WorkDir: /home/httpd/mrtg' --global 'Options[_]: bits,growright' --output /home/mrtg/cfg/mrtg.cfg public@212.43.193.106
--base: Get Device Info on public@212.43.193.106:
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503170
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 450
SNMPGET Problem for sysDescr sysContact sysName sysLocation sysObjectID on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 657
--base: Vendor Id:
--base: Populating confcache
--snpo: Skipping ifName scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ifDescr scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ipAdEntIfIndex scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ifType scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ifPhysAddress scanning because public@212.43.193.106: does not seem to support it
--base: Get Interface Info
--base: Walking ifIndex
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503176
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.1 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifType
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503177
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.3 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifSpeed
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503178
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.5 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifAdminStatus
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503179
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.7 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifOperStatus
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503180
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.8 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Writing /home/mrtg/cfg/mrtg.cfg
is this ok and can i use mrtg now ?
i think there are too much errors ..... :)
what do you think ?
Planet Z 08-07-2001, 11:02 PM I'm not an MRTG guru, but my guess is either the device you're scanning doesn't support SMNP or public isn't a valid SNMP-enabled community name on the device.
davidb 08-07-2001, 11:06 PM well, if it worked, it will show up in the graphs, when i did mine, I did not go through all that. I found an example and worked off of it.
Below is mrtg.cfg
WorkDir: /home/htdocs/75megs/html/mrtg
Target[r1]: 4:public@216.36.96.145
MaxBytes[r1]: 130000
Title[r1]: 75 Megs Netopia Router
PageTop[r1]: <H1>Stats for 75Megs Server</H1>
thats my config file, then I just copied the image files and make r1.html in my mrtg dir. the thing in [] is the name I gave it.
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/bin/mrtg.cfg
then thats my cron, it all works fine.
I hope that helps somewhat, if you want some more help, ill be in irc.othersideirc.net #liek for acouple of more hours, username parplex.
domus 08-07-2001, 11:09 PM now when i run mrtg
/usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
with this commage
it just goes to next lne like it's done
now where are the pages
i got to /home/mrtg nothing there in /home/mrtg/cfg
there are two files
[root@ns1 cfg]# ls
mrtg.cfg mrtg.ok
[root@ns1 cfg]#
mrtg.ok
but where are graps now
domus 08-07-2001, 11:12 PM [root@ns1 cfg]# cat mrtg.cfg
# Created by
# /usr/local/mrtg-2/bin/cfgmaker --global 'WorkDir: /home/mrtg' --global 'Options[_]: bits,growright' --output /home/mrtg/cfg/mrtg.cfg public@212.43.193.106
### 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
WorkDir: /home/mrtg
Options[_]: bits,growright
######################################################################
# System:
# Description:
# Contact:
# Location:
######################################################################
[root@ns1 cfg]#
RackMy.com 08-07-2001, 11:26 PM You do not have SNMP installed on the equipment. You need to install SNMP.
RutRow 08-08-2001, 10:30 AM EEK..... why install snmp for just MRTG? Why not just write a shell script to output the 4 lines of info MRTG is looking for?
This is what I use:
========== CUT==========
#!/bin/bash
# Get transmit and receive bytes.
#
INFO=`grep eth0 /proc/net/dev | tr -s ' ' ' ' | cut -d: -f2`
RECEIVE=`echo $INFO | cut -d" " -f1`
TRANSMIT=`echo $INFO | cut -d" " -f9`
# Get uptime.
#
UPTIME=`uptime | tr -s ' ' ' ' | cut -d" " -f4-`
# Final output to MRTG
#
echo $RECEIVE
echo $TRANSMIT
echo $UPTIME
echo "HAL"
===========CUT===========
In your mrtg.conf file, just call the script...
Target[hal]: `/usr/bin/getstats.sh`
Then call MRTG from cron every 5 min.
P.S. .. this works on my RH 7.0 box. Modifications may be necessary for other OSes.
-Rut
domus 08-08-2001, 10:54 AM [root@ns1 cfg]# /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
WARNING: "Title[hal]" not specified
WARNING: "PageTop[hal]" is not specified.
WARNING: "MaxBytes[hal]" not specified
ERROR: Please fix the error(s) in your config file
script File: /usr/bin/gs.sh
#!/bin/bash
# Get transmit and receive bytes.
#
INFO=`grep eth0 /proc/net/dev | tr -s ' ' ' ' | cut -d: -f2`
RECEIVE=`echo $INFO | cut -d" " -f1`
TRANSMIT=`echo $INFO | cut -d" " -f9`
# Get uptime.
#
UPTIME=`uptime | tr -s ' ' ' ' | cut -d" " -f4-`
# Final output to MRTG
#
echo $RECEIVE
echo $TRANSMIT
echo $UPTIME
echo "HAL"
cfg file
UW PICO(tm) 3.7 File: mrtg.cfg Modified
Target[hal]: `/usr/bin/gs.sh`
domus 08-08-2001, 10:54 AM [root@ns1 cfg]# /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
ERROR: "WorkDir" not specified in mrtg config file
RutRow 08-08-2001, 03:37 PM Ahh.... you never had a working mrtg.conf.
This is what mine looks like..
=============cut==========
WorkDir: /home/tad/public_html/mrtg
Target[hal]: `/usr/bin/getstats.sh`
MaxBytes[hal]: 96000
Title[hal]: Traffic Analysis for HAL
PageTop[hal]: <H1>Traffic Analysis for HAL</H1>
<TABLE>
<TR><TD>System:</TD> <TD>Redhat 7.0</TD></TR>
<TR><TD>Maintainer:</TD> <TD>Tad</TD></TR>
<TR><TD>Description:</TD><TD>External Traffic</TD></TR>
<TR><TD>IfType:</TD> <TD>Ethernet</TD></TR>
<TR><TD>IfName:</TD> <TD>eth0</TD></TR>
<TR><TD>Max Speed:</TD> <TD>96.0 kBytes/s</TD></TR>
<TR><TD>IP:</TD> <TD>IP</TD></TR>
</TABLE>
XSize[hal]: 400
YSize[hal]: 200
Options[hal]: growright, bits
==========cut============
You will have to modify to suit your needs.
-Rut
domus 08-08-2001, 06:03 PM [root@ns1 cfg]# /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
ERROR: Line 8 (<TABLE>) in CFG file (/home/mrtg/cfg/mrtg.cfg) does not make sense
[root@ns1 cfg]# pico mrtg.cfg
RutRow 08-08-2001, 07:46 PM The <TABLE> and <TR> tags may need to be indented. This page removes the whitespace.
domus 08-08-2001, 08:34 PM indented what does that means sorry for my poor english
RutRow 08-08-2001, 09:06 PM Try it like this, with the whitespace before the tags..
WorkDir: /home/tad/public_html/mrtg
Target[hal]: `/usr/bin/getstats.sh`
MaxBytes[hal]: 96000
Title[hal]: Traffic Analysis for HAL
PageTop[hal]: <H1>Traffic Analysis for HAL</H1>
<TABLE>
<TR><TD>System:</TD> <TD>Redhat 7.0</TD></TR>
<TR><TD>Maintainer:</TD> <TD>Tad</TD></TR>
<TR><TD>Description:</TD><TD>External Traffic</TD></TR>
<TR><TD>IfType:</TD> <TD>Ethernet</TD></TR>
<TR><TD>IfName:</TD> <TD>eth0</TD></TR>
<TR><TD>Max Speed:</TD> <TD>96.0 kBytes/s</TD></TR>
<TR><TD>IP:</TD> <TD>IP</TD></TR>
</TABLE>
XSize[hal]: 400
YSize[hal]: 200
Options[hal]: growright, bits
domus 08-08-2001, 09:22 PM [root@ns1 cfg]# /usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg
WARNING: Running '/usr/bin/gs.sh': Permission non accordée
WARNING: Could not get any data from external command '/usr/bin/gs.sh'
Maybe the external command did not even start. (Permission non accordée)
Rateup WARNING: /usr/local/mrtg-2/bin/rateup could not read the primary log file for hal
Rateup WARNING: /usr/local/mrtg-2/bin/rateup The backup log file for hal was invalid as well
Rateup WARNING: /usr/local/mrtg-2/bin/rateup Can't remove hal.old updating log file
Rateup WARNING: /usr/local/mrtg-2/bin/rateup Can't rename hal.log to hal.old updating log file
my cfg file is
WorkDir: /home/mrtg
Target[hal]: `/usr/bin/gs.sh`
MaxBytes[hal]: 96000
Title[hal]: Traffic Analysis for HAL
PageTop[hal]: <H1>Traffic Analysis for HAL</H1>
<TABLE>
<TR><TD>System:</TD> <TD>Redhat 7.0</TD></TR>
<TR><TD>Maintainer:</TD> <TD>Tad</TD></TR>
<TR><TD>Description:</TD><TD>External Traffic</TD></TR>
<TR><TD>IfType:</TD> <TD>Ethernet</TD></TR>
<TR><TD>IfName:</TD> <TD>eth0</TD></TR>
<TR><TD>Max Speed:</TD> <TD>96.0 kBytes/s</TD></TR>
<TR><TD>IP:</TD> <TD>IP</TD></TR>
</TABLE>
XSize[hal]: 400
YSize[hal]: 200
Options[hal]: growright, bits
what does this error means ?
RutRow 08-08-2001, 09:33 PM Did you make the script executable?
# chmod +x /usr/bin/gs.sh
The other warning messages are normal the first 2 times mrtg is run.
-Rut
Fremont Servers 11-12-2001, 04:10 PM Originally posted by domus
[root@ns1 bin]# /usr/local/mrtg-2/bin/cfgmaker --global 'WorkDir: /home/httpd/mrtg' --global 'Options[_]: bits,growright' --output /home/mrtg/cfg/mrtg.cfg public@212.43.193.106
--base: Get Device Info on public@212.43.193.106:
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503170
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 450
SNMPGET Problem for sysDescr sysContact sysName sysLocation sysObjectID on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 657
--base: Vendor Id:
--base: Populating confcache
--snpo: Skipping ifName scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ifDescr scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ipAdEntIfIndex scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ifType scanning because public@212.43.193.106: does not seem to support it
--snpo: Skipping ifPhysAddress scanning because public@212.43.193.106: does not seem to support it
--base: Get Interface Info
--base: Walking ifIndex
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503176
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.1 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifType
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503177
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.3 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifSpeed
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503178
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.5 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifAdminStatus
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503179
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.7 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Walking ifOperStatus
SNMP Error:
no response received
SNMPv1_Session (remote host: "212.43.193.106" [212.43.193.106].161)
community: "public"
request ID: 771503180
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 540
SNMPWALK Problem for 1.3.6.1.2.1.2.2.1.8 on public@212.43.193.106:
at /usr/local/mrtg-2/bin/cfgmaker line 107
--base: Writing /home/mrtg/cfg/mrtg.cfg
Have anyone found a solutionto the above SNMP Error?
Fremont Servers 11-12-2001, 05:05 PM Nevermind! I got it :D
|