This project is collaborate with Netgraph.
Please setup MRTG first, see MRTG Installation to get more information.
$ git clone https://github.com/leo900807/netgraph-template-generator
$ cd netgraph-template-generator
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.
Add current_flow.sh
into cronjob.
sudo apt-get install mrtg -y
sudo mkdir /var/www/mrtg
sudo mkdir /etc/mrtg
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"
- Create and Edit
mrtg.cfg
vim /etc/mrtg/mrtg.cfg
- Include other config files in
mrtg.cfg
like this:
Include: CONFIG_FILE_1.cfg
Include: CONFIG_FILE_2.cfg
...
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).
sudo indexmaker --perhost --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg