Results 1 to 13 of 13
  1. #1
    Join Date
    May 2005
    Posts
    76

    MRTG on Fedora......

    i've installed it but can't seem to get it started.
    my document root is /home/sites
    here is what i did:


    yum install mrtg

    vi /etc/httpd/conf.d/mrtg.conf

    made sure this was there:

    #
    # This configuration file maps the mrtg output (generated daily)
    # into the URL space. By default these results are only accessible
    # from the local host.
    #
    Alias /mrtg /home/sites/mrtg

    <Location /mrtg>
    Order deny,allow
    # Deny from all
    # Allow from localhost localhost.localdomain
    Deny from none
    Allow from all
    # Allow from .example.com
    </Location>



    vi /etc/mrtg/mrtg.cfg

    Change the line -

    WorkDir: /var/www/mrtg

    to -

    WorkDir: /home/sites/mrtg



    mv /var/www/mrtg /home/sites

    Edit the httpd.conf file -

    vi /etc/httpd/conf/httpd.conf


    DocumentRoot "/var/www/html"


    Change that to -

    DocumentRoot "/home/sites"


    Edit the i18n file -

    vi /etc/sysconfig/i18n


    Code:
    LANG="en_US.UTF-8"
    SUPPORTED="en_US.UTF-8:en_US:en"
    SYSFONT="latarcyrheb-sun16"

    comment out the top line and add this -

    Code:
    LANG="en_US"


    So my final entry (the entire file) will look like this -

    Code:
    #LANG="en_US.UTF-8"
    LANG="en_US"
    SUPPORTED="en_US.UTF-8:en_US:en"
    SYSFONT="latarcyrheb-sun16"



    /etc/init.d/httpd restart

    And finally start MRTG -

    /etc/mrtg start ***DIDN'T WORK***
    /etc/bin/mrtg start***DIDN'T WORK***
    or
    /usr/bin/mrtg start***GAVE AN ERROR***

    ERROR: Mrtg will most likely not work propperly when the environment
    variable LANG is set to UTF-8. Please run mrtg in an environment
    where this is not the case:

    env LANG=C /usr/bin/mrtg ...



    anyone know how to get MRTG started? or is there a step i am missing?

  2. #2
    Join Date
    May 2005
    Posts
    76
    when i go to servername/mrtg
    i just get the default mrtg page with all of the info etc.
    it is installed, just not running.

  3. #3
    Join Date
    Jun 2003
    Posts
    961

    Re: MRTG on Fedora......

    Originally posted by mr_dizzle
    /usr/bin/mrtg start***GAVE AN ERROR***

    ERROR: Mrtg will most likely not work propperly when the environment
    variable LANG is set to UTF-8. Please run mrtg in an environment
    where this is not the case:

    env LANG=C /usr/bin/mrtg ...
    anyone know how to get MRTG started? or is there a step i am missing?
    you need to cron mrtg to run each e.g. 5min, or run it as daemon (see http://people.ee.ethz.ch/~oetiker/we...nix-guide.html)

  4. #4
    Join Date
    May 2005
    Posts
    76
    mrtg was installed with yum. i don't think you need a cron for that. the fact that i can't get it started is the problem.

    here are some more details. this is what i did after getting the error above:

    ===================================

    ok, i did this command:

    env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

    but when i do:

    /usr/bin/mrtg start

    i get:

    ERROR: Mrtg will most likely not work propperly when the environment
    variable LANG is set to UTF-8. Please run mrtg in an environment
    where this is not the case:

    env LANG=C /usr/bin/mrtg ...


    and when i do:

    service mrtg start

    i get:


    mrtg: unrecognized service


    no clue how to get this started.

    =======================================

    [email protected] [/]# service mrtg start
    mrtg: unrecognized service

    [email protected] [/]# /etc/rc.d/init.d/mrtg restart
    -bash: /etc/rc.d/init.d/mrtg: No such file or directory

    [email protected] [/]# service mrtg stop
    mrtg: unrecognized service




    i have no problems on rhel boxes, i just can't get it started on fedora, i don't get it.

  5. #5
    Join Date
    Jun 2003
    Posts
    961
    what fedora version you used? and which mrtg rpm?
    did "env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg" report any errors? what does your mrtg.cfg file look like?

  6. #6
    Join Date
    May 2005
    Posts
    76
    i used "yum install mrtg"

    no errors on "env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg"
    but i still get :

    ERROR: Mrtg will most likely not work propperly when the environment
    variable LANG is set to UTF-8. Please run mrtg in an environment
    where this is not the case:

    env LANG=C /usr/bin/mrtg ...

    when i try to start it.

    here is my config file:



    ######################################################################
    # Multi Router Traffic Grapher -- Example Configuration File
    ######################################################################
    # This file is for use with mrtg-2.0
    #
    # Note:
    #
    # * Keywords must start at the begin of a line.
    #
    # * Lines which follow a keyword line which do start
    # with a blank are appended to the keyword line
    #
    # * Empty Lines are ignored
    #
    # * Lines starting with a # sign are comments.

    # Where should the logfiles, and webpages be created?

    # Minimal mrtg.cfg
    #--------------------

    WorkDir: /home/sites/mrtg
    #Target[r1]: 2:[email protected]
    #MaxBytes[r1]: 1250000
    #Title[r1]: Traffic Analysis
    #PageTop[r1]: <H1>Stats for our Ethernet</H1>

  7. #7
    Join Date
    May 2005
    Posts
    76
    i'm thinking i need to wget an rpm and try it or compile it from source.

  8. #8
    Join Date
    Jun 2003
    Posts
    961
    Originally posted by mr_dizzle
    i used "yum install mrtg"
    on which fedora version?

    # Minimal mrtg.cfg
    #--------------------

    WorkDir: /home/sites/mrtg
    #Target[r1]: 2:[email protected]
    #MaxBytes[r1]: 1250000
    #Title[r1]: Traffic Analysis
    #PageTop[r1]: <H1>Stats for our Ethernet</H1>
    since it dont have a "RunAsDaemon: Yes" entry, you need to cron it, else it will run and exit, never update again, cause it only updats when it runs or when its in daemon mode

  9. #9
    Join Date
    May 2005
    Posts
    76
    so add a cron or add a line to that config file?

    thanks

  10. #10
    Join Date
    Jun 2003
    Posts
    961
    Originally posted by mr_dizzle
    so add a cron or add a line to that config file?

    thanks
    best imo is to run it as daemon (=add the line) and start mrtg on boot up, e.g. from rc.local(?) or a dedicated init script
    beside your config file looks incomplete, "Target" is commented out, try "cfgmaker" program to fix one, or do it manually (see docs for info on config options)

  11. #11
    Join Date
    May 2005
    Posts
    76
    can you paste a sample config file so i know what is wrong with mine?

    i think i can run:

    To start when server boots up:

    Type chkconfig --add mrtg

    thanks,

  12. #12
    Join Date
    Jun 2003
    Posts
    961
    i just grabbed mrtg-2.10.15-1.i386.rpm from fc3
    it does include a cron entry /etc/cron.d/mrtg which makes mrtg run every 5mins, so no starting as daemon on boot up is needed
    the config you have is incomplete/missing the "target" where from to get the info
    for config examples take a look at http://people.ee.ethz.ch/~oetiker/we...reference.html (bottom)
    i guess you have a snmp daemon you want to query installed, right?

  13. You may be interested in this solution:

    http://redhat.hostinghacks.net/mrtg/

    snmp and some graphics libraries are necessary also:

    http://redhat.hostinghacks.net/snmp/
    http://redhat.hostinghacks.net/graphics.libraries/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •