Prerequisite software: NET-SNMP and MRTG related file settings You first install MRTG and Net-SNMP (this is not to say), as for why I don't say I have to go to Google, more than I said To detail; the specific setup content is as follows: apache2 / htdocs / mrtg-cfg / mrtg.conf Configuration Workdir: / usr / local / apache2 / htdocs / mrtg / system / testloadMibs: / usr / share / snmp / mibs / ucd-snmp Mib.txt, / usr / share / snmp / mibs / host-resources-mib.txt, / usr / share / snmp / mibs / tcp-mib.txt loadingmibs: / usr / local / share / snmp / mibs / UCD- SNMP-MIB.TXT TITLE [^]: System Statistics PageTop [^]:
. [disk]: gauge, nolegend, nopercent legendI [disk]: Total LegendO [disk]: Used Target [tcpopen]: tcpCurrEstab.0 & tcpCurrEstab.0: public @ test Options [tcpopen]: gauge, nopercent, growright MaxBytes [tcpopen]: 1000 YLegend [tcpopen]: Tcp Connections ShortLegend [tcpopen]: entries Legend1 [tcpopen]: tcpopen (entries) Legend2 [tcpopen]: legendI [tcpopen]: tcpopen: LegendO [tcpopen]: Title [tcpopen]: TCP [tcpopen] PageTop [TCPOpen]:
#! / Bin / sh / usr / local / mrtg / bin / mrtg /usr/local/apache2/htdocs/mrtg-cfg/mrtg.conf
Add the following in the snmpd.conf file to be able to display data normally: view systemview include .1.3.6.1.2.1.1 View systemview include .1.3.6.1.2.1.25.1.1 View SystemView Included .1.3.6.1.4.1. 2021.11 view systemview included .1.3.6.1.2.1.25.2.3.1.6 view systemview included .1.3.6.1.4.1.2021.9.1.8 view systemview included .1.3.6.1.2.1.25.1.6 view systemview included .1.3.6.1. 2.1.6.9 view systemview included .1.3.6.1.4.1.2021.4.5.0 view systemview included .1.3.6.1.4.1.2021.4.6.0 view systemview included .1.3.6.1.4.1.2021.9.1.6.1 view systemview included .1.3. 6.1.4.1.2021.9.1.8.1 view systemview included .1.3.6.1.4.1.2021.4.3.0 view systemview included .1.3.6.1.4.1.2021.4.4.0 view systemview included .1.3.6.1.2.1.2.2.1.10.2 view systemview included .1.3.6.1.4.1.2021.9.1.8.1 view systemview included .1.3.6.1.4.1.2021.9 view systemview included .1.3.6.1.4.1.2021.2 view systemview included .1.3.6.1.2.1.2.2.1.16 These are the code to view the code to view the device. If you don't understand, let's see if you have instructions. If your hard drive is inappropriate, you will take the #disk / 100000 annotations in snmpd.conf. The size or higher can be! ! ! !
The following: Disk / 1200000000 Disk / usr / local 2500000
Remember to modify SNMPD.conf to restart SNMP service! ! ! !
Finally, I define it in / etc / crontab: * / 5 * * * * /mrtg.sh executes my shell script every five points
After configuring the replication, you can use the corresponding file.