13 MRTG An extention of traffic monitoring system using MRTG 1020324 2002 2 8
MRTG MRTG MRTG WWW MRTG MRTG, MRTG, PHP i
Abstract An extention of traffic monitoring system using MRTG MAEDA Asuka In the rise of a rapid expansion and importance of an information communication network, network employment and management are important. MRTG is in a useful tool by network management. MRTG can check the amount of traffic, can make the change legible graph, and can display it by WWW. However, the unusual judging of the amount of traffic of a machine cannot be performed, and MRTG cannot acquire a periodical value. Therefore, in this research, the notice function of an alarm of communication apparatus and the newest information display function are proposed. As mounting, the former is a function which notifies the alarm of the unusual traffic of a machine by mail, and is a function which the latter acquires the newest amount of traffic and displays. In the result, when the Threshols dose was exceeded, that an administrator is notified of mail checked the notice function of an alarm by practice. Moreover, in addition to the graph of MRTG, the newest information display function realized the display of the newest value. A future subject is about how the notice function of an alarm defines a Threshols dose. This must collect the amounts of traffic over a long period of time. Moreover, the newest information display function investigates whether it is the information which wants to know whether it is what it is easy to use, and it becomes a future subject to ii
extend a function further. key words network employment and management,mrtg,php iii
1 1 1.1.......................... 1 1.1.1.................................. 1 1.1.2.................... 2 1.1.3........................... 2 2 MRTG 4 2.1 SNMP.................................... 4 2.1.1 SNMP............................. 4 SNMP............................. 4 SNMP........................... 5 SNMP......................... 6 SNMP......................... 7 2.2 MIB..................................... 7 2.2.1 MIB MIB........................ 7 2.2.2 MIB..................... 8 2.3 UCD SNMP................................. 9 2.3.1 UCD SNMP.......................... 9 UCD-MIB.................... 10 UCD SNMP.................... 11............................. 11...................... 12 snmptrap.......................... 12 2.4 MRTG.................................... 13 iv
2.4.1 MRTG............................. 13 2.4.2 MRTG............................. 13 2.4.3 MRTG........................... 15 3 MRTG 17 3.1.................................. 17 3.1.1............................. 17 3.1.2........................... 17 3.2.................................. 18 3.2.1................................ 18 3.2.2.......................... 18.................... 18 MRTG......................... 19 3.2.3....................... 20 PHP.............................. 20 PHP ucd-snmp.................. 21 PHP.......................... 22 4 27 4.1................................. 27 4.1.1.................................. 28 4.2.............................. 29 4.2.1.................................. 31 5 32 33 v
34 A MRTG 35 A.1 MRTG................................ 35 A.1.1 A.1.2 A.1.3 A.1.4 A.1.5 A.1.6 A.1.7 A.1.8................................ 35 SNMP........................ 35 mrtg.cfg............................ 36 cfgmaker............................ 36 kaeru.cfg.................. 37 mrtg.............................. 38 cron.............................. 38........................... 38 A.2 SNMP............................. 39 A.2.1 SNMP...................... 39 B MRTG 42 B.1...................................... 42 B.1.1......................... 43 C ucd-snmp 48 D Apache 51 E PHP 54 vi
2.1 SNMP................................. 5 2.2 SNMP............................. 6 2.3 MIB................................. 8 2.4 UCD MIB MIB...................... 11 2.5 UCD-MIB.......................... 12 2.6 MRTG................................. 15 3.1.................................... 20 3.2 PHP................................ 22 4.1........................ 27 4.2........................ 28 4.3............................... 29 4.4................................. 29 4.5............................. 29 vii
2.1.............................. 13 2.2 snmptrap.................. 14 3.1.................................... 18 3.2 HTML..................... 23 3.3 PHP................................ 24 3.4 php3.................................. 25 3.5 interfaces (1.3.6.1.2.1.2)..................... 26 4.1 mib-2 (1.3.6.1.2.1)........................ 30 4.2 ucdavis (1.3.6.1.4.1.2021).................... 31 B.1............................. 42 B.4....................... 43 B.2.................... 43 B.3............................. 44 B.5........................ 47 viii
1 MRTG MRTG MRTG 2 MRTG 3 MRTG 4 6 1.1 1.1.1 1
1.1 1.1.2 1.1.3 MRTG (Multi Router Traffic Grapher), Seafelt, PyNG (the Python Network Grapher), RRDTools+ (Remstat, Cricket, ORCA, NRG) 1 MRTG MRTG MRTG WEB LAN 1 http://www.soi.wide.ad.jp/iw99/iw99 tut/slides/15/ 2
1.1 MRTG 3
2 MRTG MRTG MRTG SNMP MIB UCD SNMP MRTG MRTG 2.1 SNMP SNMP 2.1.1 SNMP SNMP TCP/IP 1989 1990 RFC [1] SNMP SNMP SNMP (Simple Network Managing Protocol) 4
2.1 SNMP (Management Information Base: MIB) 3 ( 2.1) MIB MIB 2.2 2.1 SNMP SNMP 1. SNMPv1 SNMPv1 SNMP SNMPv1 5 ( PDU) 2. SNMPv2 SNMPv1 SNMP 3. SNMPv3 SNMPv2 SNMPv2 5
2.1 SNMP SNMP 5 2.2 Get Request Get Next Request Set Request Get Response Trap 2.2 SNMP 6
2.2 MIB SNMP SNMP SNMP SNMP (Set Get) 2.2 MIB SNMP MIB (Management Information Base: ) MIB SMI (Structure of Management Information) 2.2.1 MIB MIB SNMP MIB MIB MIB-II MIB RFC MIB MIB MIB 7
2.2 MIB 2.2.2 MIB MIB SNMP MIB MIB 2.3 MIB 2.3 MIB 3 itu-t(0) iso(1) joint-iso-itu-t(2) MIB internet(1) internet(1) mgmt(2) mib-2(1) MIB-II MIB private(4) enterprises(1) 8
2.3 UCD SNMP MIB 1. 2. 3. (.) 4. iso.org.dod.internet.mgmt.mib-2.system 1.3.6.1.2.1.1 (OID: Object Identifier) 2.3 UCD SNMP UCD SNMP MIB UCD SNMP 2.3.1 UCD SNMP UCD SNMP SNMP MIB MIB (Get,GetNext,Set,Trap) UCD SNMP (snmpd) [1] MIB-II MIB-II UCD-MIB MIB UNIX 9
2.3 UCD SNMP SNMP SNMPv2/v3 SNMPv2 SNMPv3 UNIX UCD-MIB ( ) UNIX UCD SNMP MIB MIB MIB private.entrprises UCD-MIB.iso.org.dod.internet.private.enterprises.ucdavis (.1.3.6.1.4.1.2021) 2.4 UCD-MIB UCD-MIB 2.5 ucdavis 10
2.3 UCD SNMP UCD SNMP UCD SNMP SNMP snmpget UCD SNMP snmpget, snmpgetnext, snmpwalk, snmpbulkget, snmpset, snmptable, snmpdelta, snmpstatus, snmptest, snmpnetstat, snmpdf, snmpconf, snmptranslate snmpcomand [ ] [ ] 2.1 ( ) MIB system.syscontact Get 2.4 UCD MIB MIB 11
2.3 UCD SNMP %snmpget -d localhost private system.syscontact.0 -d SNMP ( ) 16 ASCII snmptrap SNMP SNMP snmptrap SNMP SNMP snmptrap [ ] OID [ ID ] 2.5 UCD-MIB 12
2.4 MRTG snmptrap 2.2 2.4 MRTG MRTG(Multi Router Traffic Grapher) MRTG SNMP WWW 2.4.1 MRTG MRTG MRTG SNMP (Simple Network Management Protocol) (2.6) 2.4.2 MRTG MRTG [2] Unix WindowsNT 2.1 snmpcomand -d,-h IP MIB ( ID) 13
2.4 MRTG HTML MRTG Web SNMP SNMP Package WEB WEB index MRTG SNMP Perl C Web WEB 2.2 snmptrap OID SNMP 14
2.4 MRTG MRTG 7 4 12 MRTG 2 1 2.4.3 MRTG MRTG 1 MRTG MRTG 2 2.6 MRTG 1 http://www.mrtg.jp/doc/mrtg.html 15
2.4 MRTG MRTG MRTG cron cron 1 16
3 MRTG 2.4.3 MRTG 3.1 3.1.1 2.4.3 1 MRTG 3.1.2 2.4.3 2 17
3.2 3.2 3.1 3.2.1?? 3.1 OS FreeBSD 4.3-RELEASE IP 172.21.43.250 WWW SNMP Apache-1.3.22, PHP-3.0.18 ucd-snmp-4.2.2 3.2.2 MRTG Perl 18
3.2 Alt-x set-file-coding-system(enter) File coding system : euc-jp-unix(enter) warning.pl #!/usr/bin/perl open(sendmail," /usr/sbin/sendmail -t -oi"); print SENDMAIL "From: asuka\@kikuken.org\n"; print SENDMAIL "To: asuka\@kikuken.org\n"; print SENDMAIL "Subject: MRTG \n\n"; print SENDMAIL " \n"; print SENDMAIL "\n"; print SENDMAIL " : ".$ARGV[0]."\n"; print SENDMAIL " : ".$ARGV[1]."\n"; print SENDMAIL " : ".$ARGV[2]."\n"; close(sendmail); 2 MRTG (out) MRTG MRTG Thresh- MaxI ThreshMaxO ThreshProgI ThreshProgO [3] MRTG thinkpad.cfg 19
3.2 400000 thinkpad.cfg ( 3.2.2) ThreshMaxI[172.21.43.250 9]: 400000 ThreshMaxO[172.21.43.250 9]: 400000 ThreshProgI[172.21.43.250 9]:/home/lab/kiku02/asuka/Warning/Perl/warning.pl ThreshProgO[172.21.43.250 9]:/home/lab/kiku02/asuka/Warning/Perl/warningout.pl 3.1 MRTG crontab 3.2.3 ucd-snmp ucd-snmp MRTG Web PHP 1 PHP( 3.2) HTML SNMP [4] PHP 1 http://www.php.net 20
3.2 HTML ( 3.2) HTML PHP HTML If for while do-while C Perl Perl Apache Oracle PostgreSQL MySQL msql DBMS ] PHP ucd-snmp 3.3 MRTG.html Extension MRTG php3 PHP 21
3.2 thinkpad.cfg Extension[172.21.43.250 9]: php3 php (PageTop ) <?php?> php 172.21.43.250 9.php3 php thinkpad.cfg 3.2.3 cfg PHP PHP 2 cfg PHP PHP PHP PHP snmpget 0 snmpwalk interfaces (.1.3.6.1.2.1.2).1.3.6.1.2.1.2.1 (ifnumber) ucd-snmp snmpget snmpwalk OID 9 3.2 PHP 22
3.2 interfaces 9 snmpwalk <?php $host = "172.21.43.250"; $community = "kikuken"; $sysdescr = snmpget("$host","$community","system.sysdescr.0"); $ifindex = snmpwalk("$host","$community",".1.3.6.1.2.1.2.2.1.1"); for ($i=0; $i<count($ifindex); $i++) { print "<tr><th></th>"; print "<td><center>$ifindex[$i]</center></td>"; print "</tr>";?> <?php echo date("y m d (D) h:i:s:a");?> PHP 2 cfg 3.2 HTML <HTML> <BODY> <?php echo( PHP )?> </BODY> </HTML> 23
3.2 <!-- Begin Head --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <TITLE>INTERFACES</TITLE> </HEAD> <META HTTP-EQUIV="Refresh" CONTENT="180"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" content="no-cache"> PHP </BODY> </HTML> Refresh 180 PHP interfaces snmpwalk 3.3 PHP snmpget snmpset snmpwalk snmpwalkoid snmp get quick print snmp set quick print SNMP SNMP SNMP UCD quick print UCB SNMP quick print 24
3.2 Extension[172.21.43.250_9]: php3 <TABLE> <TR><TD>System:</TD> <TD>kiku017.kikuken.info.kochi-tech.ac.jp in ThinkPad Server</TD></TR> <TR><TD>Maintainer:</TD> <TD>asuka@kikuken.org</TD></TR> <TR><TD>Description:</TD><TD>ep0 </TD></TR> <TR><TD>ifType:</TD> <TR><TD>ifName:</TD> <TR><TD>Max Speed:</TD> <TR><TD>Ip:</TD> <TD>ethernetCsmacd (6)</TD></TR> <TD></TD></TR> <TD>1250.0 kbytes/s</td></tr> <TD>172.21.43.250 (dhcp250.kikuken. info.kochi-tech.ac.jp)</td></tr> </TABLE><p><?php echo "php";?><br><a HREF="../../../../jikken/PHP/ php3/snmp/mrtg/interfaces.php3"> </A> \\ \hline \end{tabular} 3.4 php3 25
3.2 3.5 interfaces (1.3.6.1.2.1.2) OID 1.3.6.1.2.1.2.1 ifnumber 1.3.6.1.2.1.2.2 iftable 1.3.6.1.2.1.2.2.1 ifentry 1.3.6.1.2.1.2.2 1.1 ifindex 1.3.6.1.2.1.2.2.1.2 ifdescr 1.3.6.1.2.1.2.2.1.3 iftype 1.3.6.1.2.1.2.2.1.4 ifmtu 1.3.6.1.2.1.2.2.1.5 ifspeed 1.3.6.1.2.1.2.2.1.6 ifphysaddress 1.3.6.1.2.1.2.2.1.7 ifadminstatus 1.3.6.1.2.1.2.2.1.8 ifoperstatus 1.3.6.1.2.1.2.2.1.9 iflastchange 1.3.6.1.2.1.2.2.1.10 ifinoctets 1.3.6.1.2.1.2.2.1.11 ifinucastpkts 1.3.6.1.2.1.2.2.1.12 ifinnucastpkts 1.3.6.1.2.1.2.2.1.13 ifindiscards 1.3.6.1.2.1.2.2.1.14 ifinerrors 1.3.6.1.2.1.2.2.1.15 ifinunknownprotos 1.3.6.1.2.1.2.2.1.16 ifoutoctets 1.3.6.1.2.1.2.2.1.17 ifoutucastpkts 1.3.6.1.2.1.2.2.1.18 ifoutnucastpkts 1.3.6.1.2.1.2.2.1.19 ifoutdiscards 1.3.6.1.2.1.2.2.1.20 ifouterrors 1.3.6.1.2.1.2.2.1.21 ifoutqlen 1.3.6.1.2.1.2.2.1.22 ifspecific 26
4 4.1 ( 4.1) Delivered-To: asuka@kikuken.org Date: Thu, 17 Jan 2002 00:31:16 +0900 (JST) From: asuka@kikuken.org To: 020324p@ugs.kochi-tech.ac.jp Subject: MRTG : 172.21.43.250 9 : 400000 : 411226 4.1 27
4.1 4.1.1 4.1 2 1 Delivered-To: asuka@kikuken.org Date: Wed, 30 Jan 2002 17:56:57 +0900 (JST) From: asuka@kikuken.org To:020324p@ugs.kochi-tech.ac.jp Subject: MRTG (out) : 172.21.43.250 9 : 400000 : 873226 4.2 28
4.2 4.2 4.3 MRTG 4.4 PHP 4.5 4.4 4.4 4.3 4.5 6 PHP 29
4.2 mib-2 system icmp snmp ucdavis memory latable systemstats PHP mib-2 ucdavis snmpget snmpwalk MIB mib-2( 4.1) ucdavis( 4.2) 4.1 mib-2 (1.3.6.1.2.1) OID 1.3.6.1.2.1.1 system 1.3.6.1.2.1.2 interfaces 1.3.6.1.2.1.3 at 1.3.6.1.2.1.4 jp 1.3.6.1.2.1.5 icmp 1.3.6.1.2.1.6 tcp 1.3.6.1.2.1.7 udp 1.3.6.1.2.1.8 egp 1.3.6.1.2.1.9 transmission 1.3.6.1.2.1.11 snmp 30
4.2 4.2.1 MRTG MRTG mib-2 ucdavis 4.2 ucdavis (1.3.6.1.4.1.2021) OID 1.3.6.1.4.1.2021.2 prtable 1.3.6.1.4.1.2021.4 memory 1.3.6.1.4.1.2021.8 exttable 1.3.6.1.4.1.2021.9 dsktable 1.3.6.1.4.1.2021.10 latable 1.3.6.1.4.1.2021.11 systemstats 1.3.6.1.4.1.2021.14 ucddemomib 1.3.6.1.4.1.2021.15 filetable 1.3.6.1.4.1.2021.100 version 1.3.6.1.4.1.2021.101 snmperrs 1.3.6.1.4.1.2021.102 mrtable 31
5 MRTG MRTG 32
33
[1] Steve Maxwell. SNMP., October 2001. [2]. FreeBSD., April 2001. [3].., August 2001. [4],,. PHP., August 2000. 34
A MRTG MRTG 4 1. MRTG 2. SNMP 3. mrtg.cfg 4. mrtg A.1 MRTG 4 A.1.1 1. zlib 2. libpng 3. gd 4. mrtg A.1.2 SNMP kaeru (IP 172.21.43.2) SNMP 35
A.1 MRTG ( C) A.1.3 mrtg.cfg MRTG mrtg.cfg MRTG cfgmaker Perl MIB(Management Information Base) mrtg.cfg kaeru.cfg A.1.4 cfgmaker cfgmaker @ ( IP ) > kaeru.cfg > cfgmaker public@172.21.43.2 > kaeru.cfg kaeru.cfg ##################################################################### # System: kaeru # Description: Sun SNMP Agent, Ultra-60 # Contact: System administrator # Location: System administrators office ###################################################################### ### Interface 2 >> Descr: hme0 Name: Ip: 172.21.43.2 Eth: 08-00-20-b2-4e-ac ### Target[172.21.43.2_hme0]: \hme0:public@172.21.43.2: SetEnv[172.21.43.2_hme0]: MRTG_INT_IP="172.21.43.2" MRTG_INT_DESCR="hm e0" 36
A.1 MRTG MaxBytes[172.21.43.2_hme0]: 12500000 Title[172.21.43.2_hme0]: Traffic Analysis for hme0 PageTop[172.21.43.2_hme0]: <H1>Traffic Analysis for hme0 </H1> <TABLE> </TR> <TR><TD>System:</TD><TD>kaeru in System administrators office</td> <TR><TD>Maintainer:</TD><TD>System administrator</td></tr> <TR><TD>Description:</TD><TD>hme0 </TD></TR> <TR><TD> :</TD><TD>ethernetCsmacd (6)</TD></TR> <!--<TR><TD>ifName:</TD><TD></TD></TR>--> <TR><TD> :</TD><TD>12.5 MBytes/s</TD></TR> <TR><TD>Ip :</TD><TD>172.21.43.2 ()</TD></TR> </TABLE> # A.1.5 kaeru.cfg kaeru.cfg kaeru.cfg WorkDir: Web Directory[ ]: > cd public html > mkdir MRTG/kaeru kaeru.cfg 37
A.1 MRTG WorkDir: /home/lab/kiku02/asuka/public html/mrtg Directory[172.21.43.1 hme0]:kaeru A.1.6 mrtg mrtg Perl kaeru.cfg > mrtg kaeru.cfg 3 A.1.7 cron WWW kaeru.cfg 5 Unit cron crontab /5 * * * * /usr/local/bin/mrtg /home/lab/kiku02/asuka/mrtg/kaeru.cfg crontab cron > crontab crontab A.1.8 Title PageTop MRTG.html.html Perl mrtg mrtg 38
A.2 SNMP > su # xemacs /usr/local/bin/mrtg mrtg (890 ) <META HTTP-EQUIV-= Content-Type CONTENT= text/html;.&$loc ( charset=x-jis-jp ). \ > \ n ; A.2 SNMP MRTG Target Keyword: Targer SNMP SNMP Target[<target name>] <target kind> <community>@<address> <target name> <target kind> <community> string <address> A.2.1 SNMP Port (ifindex ) SNMP OID /SNMP MIB symbol Interface Address 39
A.2 SNMP Port (ifindex ) SNMP Client Port (ifindex) IfInOctets ifoutoctets 1 Target[gw1-3] 3 public@gw1.foo.co.jp gw1.foo.co.j ifindex=3 Interface ifinoctets/ifoutocters 2 Target[gw1-3] 3 public@gw1.foo.co.jp 1 In/Out SNMP OID /SNMP MIB symbol SNMP OID(Object ID) MIB symbol 1 2 & 3 Target[gw1-3] ifinerrors.3&ifouterrors.3 public@gw1.foo.co.jp ifinerrors/ifouterrors 4 Target[gw1-3] 1.3.6.1.2.1.2.2.1.14.3&1.3.6.1.2.1.2.2.1.20.3public@gw1.foo.co.jp OID Interface Address ifinoctets ifoutoctets 5 Target[gw1-3] /172.21.43.1 public@gw1.foo.co.jp 6 Target[gw1-3] /172.21.43.1 public@gw1.foo.co.jp 5 In/Out Interface addres OID/MIB symbol 7 Target[gw1-3] ifindiscards/172.21.43.1&ifoutdiscards/172.21.43.1 public@gw1.foo.co.jp ifoutdiscards/ifoutdiscards 8 Target[gw1-3] 1.3.6.1.2.1.2.2.1.13/172.21.43.1&1.3.6.1.2.1.2.2.1.19/172.21.43.1 40
A.2 SNMP public@gw1.foo.co.jp 7 OID Target[<target name>] <command> <targer name> <command> Target 41
B MRTG mrtg.cfg 5 WorkDir Target[ ] MaxBytes[ ] Title Page Top[ ] B.1 MRTG # B.1 Workdir Web WorkDir: /home/lab/kiku02/asuka/public html/mrtg 42
B.1 B.1.1 [ ] MRTG ( B.3) B.4 B.2 IconDir MRTG URL IconDir: /img Refresh 300 Refresh: 600 Language Language: iso2022jp 43
B.1 AbsMax[ ]: MaxBytes Unscaled[ ]: ymwd MaxBytes y=year,m=month,w=week,d=day WithPeak[ ]: y,m,w ymw Suppress[ ]: MRTG 4 ymwd Extension[ ]: MRTG.html B.3 Target[ ]: MaxBytes[ ]: MRTG Title[ ]: HTML PageTop[ ]: MRTG HTML 44
B.1 Directory[ ]: WorkDir MRTG Xsize[ ]: Xsize 20 600 Ysize[ ]: Ysize 20 YticsFactor[ ]: Factor[ ]: Options[ ]: growright, bits ( 8 ) nopercent Gauge Kilo[ ]: MRTG 1000 1024 Background[ Background HTML ]: Ylegend[ ]: ShortLegend[ ]: b/s LegendI[ ]: LegendI O 1 ( IN ) 2 ( OUT ) 45
B.1 Legend1[ ]: Legend1 2 3 4 1 ( IN ) 2 ( OUT ) WithPeak 1 WithPeak 2 46
B.1 B.5 ThreshDir[ ]: MRTG ThreshMinI[ % MaxBaytes ]: Thresh- Max Min I O 1 MinO[ ]: ( IN ) 2 ( ThreshMaxI[ OUT ) MaxO[ ]: ThreshDesc[ ]: THRESH DESC ThreshProgI[ Max Min ]: Thresh- ]: Thresh- ProgO[ ]: 47
C ucd-snmp ucd-snmp http://not-snmp.sourceforge.net ucd-snmp-4.2.2.tar.gz >cd /usr/local/src >tar xzvf ucd-snmp-4.2.2.tar.gz >cd ucd-snmp-4.2.2 >./configure with-libwrap=/usr/local/lib ( ) ) -press return to continu (Enter) system contact information: asuka@kikuken.org system location:thinkpad Server location to write logfile (/usr/log/snmpd.log):(enter) location to write persistent information (/var/ucd-snmp):(enter) >make >su #make install /usr/local/sbin/snmpd /usr/local/bin/snmpget 48
/usr/local/bin/smpwalk /usr/local/share/snmp/mibs snmp.conf EXAMPLE.conf /usr/local/share/snmp/ snmp.conf snmpd #cp EXAMPLE.conf /usr/local/share/snmp/snmp.conf #chmod 600 /usr/local/share/snmp/snmp.conf /usr/local/share/snmp/snmp.conf #vi snmp.conf sec.name source community com2sec local localhost private com2sec mynetwork 172.21.43.0/24 kikuken group sec.model sec.name #group MyPwGroup v1 local #group MyPwGroup v2c local #group MyPwGroup usm local group MyROGroup v1 mynetwork group MyPOGroup v2c mynetwork group MyPOGroup usm mynetwork # incl/excl subtree mask view all included.1 80 view system included system fe view mib2 included.iso.org.dod.internet.mgmt..mib-2 fc 49
# context sec.model sec.level match read write notif access MyROGroup any noauth exact all none none access MyRWGroup any noauth exact all all none syslocation ThinkPad Server syscontact Asuka Maeda<asuka@kikuken.org> snmpd >su #cd /usr/local/sbin #snmpd #exit >su >ps -ax grep snmpd >snmpwalk -v 1 localhost private system : #cd /etc #vi services snmp 161/tcp snmptrap 162/tcp snmp trap 162/udp 50
D Apache Apache http://httpd.apache.org apache 1.3.22.tar.gz >mkdir /usr/local/src >cd /usr/local/src >tar xzvf apache 1.3.22.tar.gz >cd apache 1.3.22 >env OPTIM=-O2./configure enable-module=so ( ) (DSO ) >make >su #make install httpd.conf #cd /usr/local/apache/conf #xemacs httpd.conf port 80 80 User nobody Group nobody serveradmin asuka@kikuken.org 51
#servername www.kikuken.org DocumentRoot /usr/local/apache/htdocs http://localhost/ Alias /icons /usr/local/apache/icons/ http://localhost/icons/ Script Alias /cgi-bin/ /usr/local/apache/cgi-bin/ http://localhost/cgi-bin/ UserDir public html http://localhost/ asuka/ public html <Direcory /usr/local/apache/htdocs > DocumentRoot Options Indexes FollowSymLinks ExecCGI AllowOverride None Drder allow,deny Allow from all </Directory> <Directory /home/*/public html> AllowOverride Authconfig FileInfo Indexes Limit Option ExecCGI CGI Option Indexes Deny from all Allow from 172.21.43.0/24 Allow from 127.0.0.1 localhost 172.21.43.0/24 </Directory> Directory index.html index.htm index.shtml index.cgi index.php 52
ErrorDocument 401/401.html 401(Unauthorized) ErrorDocument 403/403.html 403(Forbidden) ErrorDocument 404/404.html 404(NotFound) CGI AddHandler cgi-script.cgi <Directory /home/*/public html> AddCharset EUC-JP.html </Directory> #/usr/local/apache/bin/apachect/ start #/usr/local/apache/bin/apachect/ stop #/usr/local/apache/bin/apachect/ restart http://172.21.43.250 Apache 53
E PHP PHP http://www.php.gr.jp/project/i18n/ php-3.0.18-j18n-ja.2.tar.gz http://www.php.net/downloads.php php-4.0.6.tar.gz php3 >cd /usr/local/src >tar xvzf php-3.0.18-i18n-ja.2.tar.gz >cd php-3.0.18 >./configure with-pqsql with-zlib enable-track-vars with-apxs=/usr/local/apache/bin/apxs with-snmp enable-ucd-snmp-hack enable-i18n enable-mbregex >make >su #make install configure -with-apxs=/usr/local/apache/bin/apxs Apache DSO with-snmp, enable-ucd-snmp-hack SNMP 54
#cd /usr/local/src/php-3.0.18-i18n-ja-2/php3.ini-dist php3.ini /usr/local/lib/php3.ini php4 >cd /usr/local/src >cd php-4.0.6 >./configure with-pgsql wit-zlib with-apxs=/usr/local/apache/bin/apxs with-snmp enable-mbstring enable-mbstr-enc-trans enable-versionning >make >su #make install enable-versioing PHP3 PHP4 Apache ( ) PHP #cd /usr/local/apache/conf #vi httpd.conf PHP LoadFile /usr/local/lib/libpg.so LoadModule php3-module /usr/local/apache/libexec/libphp3.so LoadModule php4-module /usr/local/apache/libexec/libphp4.so AddModule mod-php3.c AddModule mod-php4.c # AddType application/x-httpd-php3.php3 55
AddType application/x-httpd-php3.html AddType application/x-httpd-php3-source.phps AddType application/x-httpd-php.php AddType application/x-httpd-php.html AddType application/x-httpd-php-source.phps Directory Index index.html index.htm index.shtml index.cgi index.php index.php3 #/usr/local/apache/bin/apachect/ configtest #/usr/local/apache/bin/apachect/ restart PHP >cd public html/jikken/php/php3/test.php3 <?php echo phpinfo();?> PHP www http://172.21.43.250/ asuka/jikken/php/php3/test.php3 php4 php3 56