Linux installation and configuration of mrtg method

  

mrtg can be used to monitor network link traffic load, including Juniper firewall traffic monitoring, then in Linux system, how to install and use mrtg? Let's take the mrtg monitoring Juniper firewall traffic as an example to introduce the method of installing and configuring mrtg in Linux.

First, Juniper opens SNMP

Second, install and configure mrtg

1. Install

The official page of mrtg is http://oss.oetiker. Ch/mrtg/, the latest version is 2.17.4. You can choose to compile and install using the source package, or you can choose to install the system source.

Code is as follows

#yum -y install mrtg mrtg-libs

It should be noted that mrtg also has windows version, because the personal habit of using linux here is still centos/Redhat is an example.

2, cfgmaker generates configuration file

Code is as follows

#cfgmaker --global “WorkDir:/var/www/mrtg” --output /etc/mrtg/Mrtg.cfg [email protected]

cfgmaker can be followed by more parameters, the parameters of the returned parameters are written to the generated mrtg.cfg file, or can be modified after generation. Edit mrtg.cfg especially pay attention to the following lines:

The code is as follows

#Time is displayed from left to right, the smallest unit bits, growright is not open, the default is from right to left time display Order

Options[_]: growright, bits

#Page refresh rate, 300s

Refresh: 300

#also refresh rate, 5 minutes< Br>

Interval: 5

#mrtgThe default data exists in text format. It can be generated in the format of rrdtool database after adding the following content

#LogFormat: rrdtool

#rrdtool directory where

#PathAdd: /usr/bin/

EnableIPv6: no

WorkDir:/var/www/mrtg

In addition to the above, some other parameters may also be used, here are also listed:

WorkDir //Set the working directory, store the data collected by mrtg and generated statistical files

Language //Set the language displayed on the WEB page=Chinese gb2312

growright //Indicating the traffic graph over time Change to the right

Target //Indicates the monitored device;

Device representation = port:community@router;

commnunity //indicates snmp communication password

Directory indicates the location where the relevant files of the monitoring device are saved =/var/www/mrtg/eth0/;

The default is saved in the WorkDir working directory

MaxBytes //indicates The maximum value of the collected data. If the collected data is larger than this value, MRTG will ignore and keep the last collected data value

Kmg //Indicating the multiplier unit (default is one unit per thousand)

YLegend //indicates the unit mark of the Y axis (cannot be used in Chinese)

ShortLegend //indicates the unit mark of the data

Legend1, 2, 3, 4 indicate the text description of the four different color statistical lines

Legend1: //Text description of the average inflow of data every 5 minutes

Legend2: //Text description of the average outflow of data every 5 minutes

Legend3: //Text description of the maximum inflow of data every 5 minutes

Legend4: //Text description of the maximum outflow of data every 5 minutes

LegendI, O //respectively describe the outflow and outflow of data Description

WithPeak //Instructs how to display the flow graph

There are four statistical lines of different colors, green for average inflow, blue for average outflow, dark green for maximum inflow, purple for maximum outflow

n means not setting w for each Chart, representing the monthly chart, y for the annual chart

Not setting WithPeak, only green inflow and blue outflow

PageTop //Instructing the HTML code added to the head of the web page for Customized web pages

The "TABLE" and "TABLE" sections starting with spaces are all part of PageTop, which are directly used as HTML code.

Note: When using rrdtool format to save data, you need to view the page. Cgi calls data. Available cgi plugins are mrtg-rrd, routers2.cgi, 14all.cgi.
Previous123Next page Total 3 pages

Copyright © Windows knowledge All Rights Reserved