Network Traffic Monitor (MRTG) configuration

xiaoxiao2021-03-06  42

I saw a full Raiders on the network traffic monitor (Multi Router Traffic Grapher) MRTG, and did not think of it. This is not my main job. I don't know if the next time I need to use it, so I don't have to go everywhere after writing it.

Need software:

GD graphics processing library

Li

BPNG PNG processing library

Perl MRTG has some script with Perl

Z

li

B I don't know what it is, I have installed the software these days to say this.

Apache used to release test results

GCC C compiler, if you don't need it with RPM installation.

Net-SNMP Network Management Protocol Agent.

Previously, MRTG was always working in a similar sniper in the network, and the flow of each node was analyzed by the captain. And is a real-time analysis, when you see Neet-SNMP, you understand that it is not as imagined. MRTG is just a SNMP client (I only know some SNMP), acquire data from the SNMP agent of each device, and then generate a report in a graphic manner. The real traffic statistical analysis is completed by each node setting. After each time, MRTG takes a data from the settings and then updates the report. Careful thinking about this way of working is also possible, achieving simple, and strong scalability, as long as settings support SNMP management, and will not affect network communication quality due to network listening. After understanding the working principle of MRTG, it is not a mist to install it, just do it as someone else, it is wrong to solve it. MRTG installation mainly needs to be familiar with some of SNMP, at least the necessary concept, Apache also needs to be understood, at least know what the virtual directory is going. The front is equally configured, and MRTG is more simple (I just simply applied).

The following is to monitor the network traffic of this unit as an example: (redHat9.0)

1. Install Net-SNMP, there is a RPM installation package in the Redhat CD.

a) After installing, modify the configuration file /etc/snmp/snmpd.conf

Remove the following # symbol:

#view mib2 incruded .iso.org.dod.internet.mgmt.minb-2 fc

Put the following statement:

Access notconfiggroup "" Any Noauth Exact SystemView None None is modified: access notconfiggroup "Any Noauth exact mib2 None None

After completing, you can start SNMPD service.

# / sbin / service SNMPD START

2. Install MRTG, download the website: http://mrtg.matrix.com.br/

a) You can download the RPM package directly, pay attention to the previously dependent software version. I downloaded MRTG-

2.10.5

-1.i386.rpm, the result is GD and

li

The version of BPNG is too low, but also to find the corresponding upgrade package.

b) You can download Tar.gz to compile it, I started to get a button, but I didn't compile, mainly, I used to pass the relying on the RPM installation, all of some head files were not found. There is nothing complicated in compilation. It is to prepare the correct header file. If there is time to find it online.

c) Configure MRTG,

i. #cfgmaker --output = / etc / mrtg / mrtg.cfg public@202.115.29.94ii. Generate a configuration file name: /etc/mrtg/mrtg.cfg for device 202.115.29.94, after analyzing data Take it according to /etc/mrtg/mrtg.cfg. I have been configured in this time, I have not read it, it seems to be related to SNMP.

1. Modify the configuration files generated above.

#Vi /etc/mrtg/mrtg.cfg

A directory for Workdir: / var / www / html / mrtg #apache, generates this report file in the HTML format. Modify Options according to your actual situation [_]: GRO

WR

IgHT, BITS # is not clear what language: Big5 #, I will know what it is, but I don't know what to have, I will learn slowly.

d) Run MRTG

i. #mrtg /etc/mrtg/mrtg.cfg

Take data from the settings in the configuration file. But this is one-time, a picture of the report. This is also different, thinking that running is automatically read in the background.

When I was running, I was wrong with the following:

-------------------------------------------------- ---------------------

Error: MRTG WILL MOST

li

KELY 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 ...

-------------------------------------------------- ---------------------

This may be related to the Language: BIG5 setting, because I didn't find Language, so I didn't modify it. I have modified environment variables:

#export lang = c

run:

#mrtg /etc/mrtg/mrtg.cfg

The error message appeared twice, it seems to be mainly because SNMP has no initialization class, and it is normal after running.

After running successfully, you can generate the files of the HTML format and some PNG pictures of the HTML format. I will understand what is going on and explain it correctly when analyzing the working principle in front.

e) Generate the home page of the report.

I. Indexmaker MRTG.CFG --Output = / var / www / html / mrtg / index.html

f) Add MRTG to cron and run regularly to monitor the network traffic of the device.

# crontab -e

* / 5 * * * * root / usr / bin / mrtg /etc/mrtg/mrtg.cfg

g) Monitor multiple devices.

#. Chgmaker

#Crontab -e

#indexmaker >>

Finally:

Li

NUX's learning has always been intermittent. When there is time, I have learned it again. I have forgotten it if I have not left the note. I have to re-learn when I use it. Because I have been hovering in J2EE and

li

Between NUX, these both are really painful choices. I have a time recently.

Li

NUX finally grows from a beginner into a rookie, although it is delicious, but it is finally wings.

Since the company has been doing network data transmission, this morning suddenly, I intend to write a JDBC based on HTTP protocol, access remote databases via HTTP. It is also very simple to use a proxy to select the JDBC operation sequence to HTTP. Basically, the idea of ​​using the general EJB remote call framework in the bridge. This way

Li

NUX is a period of time.

转载请注明原文地址:https://www.9cbs.com/read-74769.html

New Post(0)