leo900807 / netgraph-template-generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Netgraph Template Generator

This project is collaborate with Netgraph.

Installation

Please setup MRTG first, see MRTG Installation to get more information.

1. Clone netgraph template generator

$ git clone https://github.com/leo900807/netgraph-template-generator
$ cd netgraph-template-generator

2. Edit environment variables

Copy config.ini.sample to config.ini and edit variable values.
Copy current_flow.sh.sample to current_flow.sh and change value of SCRIPT_PATH to this directory.

3. Set cronjob

Add current_flow.sh into cronjob.

MRTG Installation

Installation

sudo apt-get install mrtg -y

MRTG configuration

1. Create MRTG working directories

sudo mkdir /var/www/mrtg
sudo mkdir /etc/mrtg

2. Generate config files by cfgmaker

sudo cfgmaker --output=/etc/mrtg/DESIRED_CONFIG_NAME.cfg NETWORK_DEVICE_COMMUNITY@NETWORK_DEVICE_IP --snmp-options=:::::SNMP_VERSION --global "WorkDir: /var/www/mrtg/" --global "RunAsDaemon: yes" --global "Options[_]: growright"

3. Aggregate config files into a single file:

  1. Create and Edit mrtg.cfg
vim /etc/mrtg/mrtg.cfg
  1. Include other config files in mrtg.cfg like this:
Include: CONFIG_FILE_1.cfg
Include: CONFIG_FILE_2.cfg
...

4. Run MRTG

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

You may have to execute the command until there're no error messages (typically three times).

5. Generate index page by indexmaker

sudo indexmaker --perhost --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg

About


Languages

Language:Python 98.0%Language:Shell 2.0%