Click to See Complete Forum and Search --> : MRTG.cfg -> inlast outlast ?


micro_sucks
06-14-2004, 05:05 AM
Greetings people, it's now 2:02 am and I have been working on trying to configure mrtg since 9 and now I give up and am at your mercy. The following problem happens when I try to run mrtg :

[root@cp root]# /usr/bin/mrtg /home/httpd/vhosts/****.com/httpdocs/mrtg/mrtg.cfg
ERROR: Target[mrtg][_IN_] ''/home/httpd/vhosts/westcs.com/httpdocs/mrtg/getstats.sh'' evaluated to '/home/httpd/vhosts/****.com/httpdocs/mrtg/getstats.sh' instead of a number
ERROR: Target[mrtg][_OUT_] ''/home/httpd/vhosts/****.com/httpdocs/mrtg/getstats.sh'' evaluated to '/home/httpd/vhosts/****.com/httpdocs/mrtg/getstats.sh' instead of a number
WARNING: Skipping Update of mrtg, inlast is not defined
WARNING: Skipping Update of mrtg, outlast is not defined

Here is my getstats.sh file :

#!/bin/sh

# 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 "westcs.com"


Here is my mrtg.cfg :


WorkDir: /home/httpd/vhosts/****.com/httpdocs/mrtg

Target[mrtg]: '/home/httpd/vhosts/westcs.com/httpdocs/mrtg/getstats.sh'
MaxBytes[mrtg]: 25000000
Title[mrtg]: Traffic and load analysis for ****.com
PageTop[mrtg]: <H1>Traffic and Load for ****.com</H1>


Can someone please tell me what I can do to fix this ? As always appreciated. Oh yeah forgot, I am running Mandrake linux 9.2 and I am using the rpm install of mrtg.

hard candy
06-14-2004, 05:42 AM
From the website:
This is a script you can point at a router of your choice; 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

This example above will create an mrtg config file in /home/mrtg/cfg assuming this is a directory visible on your webserver. You can read all about cfgmaker in the cfgmaker manpage. One area you might want to look at is the possibility of using --ifref=ip to prevent interface renumbering troubles from catching you.
And to start it:
/usr/local/mrtg-2/bin/mrtg /home/mrtg/cfg/mrtg.cfg

http://people.ee.ethz.ch/~oetiker/webtools/mrtg/mrtg-unix-guide.html

micro_sucks
06-14-2004, 05:51 AM
I tried using that but got a whole bunch of errors. Then I found an faq with exactly what I wanted to know, with my machine specifics and with running plesk. I followed the instructions and I get that error, I would be interested in knowing what is going on wrong, becuase I have also tried to use mrtg-eth and I get the same error.