MRTG setup on a server

Ok i installed the newest MRTG via RPM, i used some info i found at serverexpert.com and adapted it to my system.

Heres my mrtg.cfg script


WorkDir: /home/ty566t/www/mrtg

Target[mrtg]: `/etc/mrtg/getstat.sh/`
MaxBytes[mrtg]: 96000
Title[mrtg]: Traffic Analysis for server #1
PageTop[mrtg]: <H1>Stats for our Ethernet</H1>
XSize[mrtg]: 400
YSize[mrtg]: 200

and my getstat.sh script

#!/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 "auroagroup.com"

and the error i am getting.
root@web1 [~]# mrtg /etc/mrtg/mrtg.cfg
Can't exec "/etc/mrtg/getstat.sh/": Not a directory at /usr/bin/mrtg line 1491.
WARNING: Running '/etc/mrtg/getstat.sh/': Not a directory
WARNING: Could not get any data from external command '/etc/mrtg/getstat.sh/'
Maybe the external command did not even start. (Not a directory)

WARNING: Problem with External get '/etc/mrtg/getstat.sh/':
Expected a Number for 'in' but nothing'

WARNING: Problem with External get '/etc/mrtg/getstat.sh/':
Expected a Number for 'out' but nothing'

ERROR: Target[mrtg][_IN_] ' $$target[0]{$mode} ' did not eval into defined data
ERROR: Target[mrtg][_OUT_] ' $$target[0]{$mode} ' did not eval into defined data
WARNING: Skipping Update of mrtg, inlast is not defined
WARNING: Skipping Update of mrtg, outlast is not defined

 

 

 

 

Top