SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

MRTG-eth-probe 1.5.4


MRTG-eth-probes enhances MRTG with the ability to plot graphs for simple network interfaces (eth, ippp, ppp). The most common "simple" interface probably is an ethernet interface, that's why I chose it for naming the script.

Since the starting of this project MRTG-eth-probe has been downloaded more than 1700 times (as of 2001-11-04). Thanks for this go first of all to Freshmeat for accepting the project and for redirecting so much people to my sourceforge projectpage ;-)
Additional thanks go to Michael Feger for sending me a patch to 1.5.2 which makes up the most important changes of this release.


Note: If upgrading from an earlier version, please not, that the parameters for the MRTG configfile have changed! The current version does not calculate the per second value between startups by itself, but relies on MRTG's own functions for this.


Configuration:

The following options can be set in mrtg-eth.pl:

        $ssh:           Path to ssh. You can find out the correct value to be
                        put here for your system by executing "which ssh" on
                        a shell of your choice.
                        Default: "/usr/bin/ssh"
        $ssh_opt:       Whatever ist specified in this variable is passed to
                        $ssh as commandline parameters
                        Default: -o 'Batchmode=yes'
                                 -o 'StrictHostKeyChecking=no'
        $devinfo:       Position of deviceinfo. On most linux systems this will
                        be "/proc/net/dev". You will probably never have to
                        change this.
                        Default: "/proc/net/dev"
        $in_pos:        These are the two most important values for correct
        $out_pos:       operation of mrtg-eth-probe. These numbers specify at
                        which position in $devinfo the numbers for transmitted
                        bytes can be found. You can find out the correct
                        numbers for your system with the help of "postion.pl".
                        Default: $in_pos=0; $out_pos=8;
        $reverse:       Will reverse output of mrtg-eth-probe. This can be
                        useful if MRTG confuses the numbers for input and
                        output in the graph (like it does on one of the
                        system I use mrtg-eth-probe on). If you encounter this
                        problem you will want to use this option, as MRTG's own
                        reverse options doesn't seem to work with external
                        targets (like mrtg-eth-probe)
                        Default: 0

mrtg-eth-probe will accept the following commandline switches:

        -d device       Device to be monitored (e.g. eth0, ippp1)
                        (Mandatory)
        -r host         If set, will try to connect to remote
                        host via ssh (SSH)
        -l login        user on remote host (SSH)
        -i identity     use this private-key to connect to remote host (SSH)
        --protocol      use Protocol 1 or 2 to connect to remote host (SH)
        --port p        remote-sshd listens on port p (SSH)
        
        --pos_in n      Position of bytes_in in /proc/net/dev
                        (Note: This will override your setting for $in_pos
                        in mrtg-eth.pl)
        --pos_out n     Position of bytes_out in /proc/net/dev
                        (Note: This will override your setting for $out_pos
                        in mrtg-eth.pl)
        -t              reverse in/out bytes in output
                        (Note: This will override your setting for $reverse
                        in mrtg-eth.pl)

Note: Options marked with '(SSH)' are only useful when connecting to a remote host using SSH


Some hints on SSH:
  • If you want to use SSH for connecting to a remote host you will probably want to do this via a public key. Public key authentication removes the need to provide a password on each connect. If you haven't done this before you can set up your public key in *** simple steps:
    1. Create public key with:

      $ ssh-keygen -f 'keyfile' -C 'MRTG-eth-probe' -N '' This will save a newly generated public key with no password to "keyfile.pub" and a corresponding private key to "keyfile". The string 'MRTG-eth-probe' will be save as a comment to this key.

    2. You may insert something like the beginning at the very beginning of your new public key:

      from="123.45.67.89",command="cat /proc/net/dev" This will limit the usage of your newly generated keyfile to issueing the command needed to read interface data and connections will only be accepted from the host given.

    3. Copy your public key (and ONLY the public key) to the remote system attach it to the authorized_keys file of the desired user. ( $ cat keyfile.pub >> ~/.ssh/authorized_keys )
    4. If you encounter any problems read man ssh-keygen, man ssh etc., but please don't ask me for help on configuring SSH. Thanks :-)

MRTG can be found at:
http://people.ee.ethz.ch/~oetiker/webtools/mrtg/


Mario Witte <mario.witte@chengfu.net>
MRTG-eth-probe: http://www.freshmeat.net/projects/mrtg-eth/


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.