/etc/modules.conf or /etc/conf.modules: #----cut here---- # I2C module options alias char-major-89 i2c-dev #----cut here---- To load everything that is needed, add this to some /etc/rc* file: #----cut here---- # I2C adapter drivers modprobe i2c-i801 modprobe i2c-isa # I2C chip drivers modprobe eeprom modprobe w83781d # sleep 2 # optional /usr/local/bin/sensors -s # recommended #----cut here----
# sec.name source community com2sec sec_jamfunk localhost snmp_jamfunk com2sec sec_jamfunk 172.16.0.0/16 snmp_jamfunk com2sec sec_jamfunk 202.171.139.208/29 snmp_jamfunk # groupName securityModel securityName group grp_jamfunk v1 sec_jamfunk group grp_jamfunk v2c sec_jamfunk group grp_jamfunk usm sec_jamfunk # name incl/excl subtree mask(optional) view view_all included .1 80 # group context sec.model sec.level prefix read write notif access grp_jamfunk "" any noauth exact view_all none none # そのほか、管理者情報とか syslocation Katae.JamFunk.jp syscontact Admin <support_at_jamfunk.jp> # ディスク関連のパスを指定 disk / disk /home # lm_sensorsのCPU温度 extend .1.3.6.1.4.1.2021.53 sensors /usr/local/bin/sensors2netsnmp
#!/usr/bin/perl # format convert lm_sensors to net-snmp # module for get temperature $MODULENAME = "w83627hf-isa-0290"; # column of temperature 1 $TEMP1NAME = "temp1"; # column of temperature 2 $TEMP2NAME = "temp2"; open SENSORS, "/usr/local/bin/sensors $MODULENAME |"; while($getstr = <SENSORS>) { if($putstr1 eq '' && $getstr =~ /^${TEMP1NAME}:\s+[+-\s]([\d\.]+)/) { $putstr1 = "$1"; } elsif($putstr2 eq '' && $getstr =~ /^${TEMP2NAME}:\s+[+-\s]([\d\.]+)/) { $putstr2 = "$1"; } if($putstr1 ne '' && $putstr2 ne '') { last; } } close SENSORS; $putstr1 = int($putstr1); $putstr2 = int($putstr2); print "$putstr1\n$putstr2\n"; exit 0;
[root@Haruko ~]# sensors w83627hf-isa-0290 # ←モジュール名 (略) temp1: +38.0 C (high = +50.0 C, hyst = +45.0 C) sensor = thermistor temp2: -48.0 C (high = +75.0 C, hyst = +70.0 C) sensor = thermistor # ↑ここの項目名、、、temp2値の正負がおかしい?w
snmpd: 172.16.0.0/255.255.0.0
$ wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.17.2.tar.gz $ tar zxvf mrtg-2.15.2.tar.gz $ cd mrtg-2.15.2 $ ./configure # 途中でoetikerさんへcdとかdvd購入の送金をされるw $ make $ su # make install
### Global Defaults RunAsDaemon: Yes Interval: 5 NoDetach: Yes WorkDir: /home/jamfunk/public_html/mrtg EnableIPv6: no Language: eucjp IconDir: /mrtg/icons/ Options[^]: growright, nopercent, pngdate, printrouter, withzeroes, unknaszero
# Traffic Title[eth0]: Traffic of Hibaru.JamFunk.jp(eth0) PageTop[eth0]: <H1>Traffic of Hibaru.JamFunk.jp(eth0)</H1> Target[eth0]: 1.3.6.1.2.1.2.2.1.10.2&1.3.6.1.2.1.2.2.1.16.2:snmp_jamfunk@localhost Options[eth0]: bits MaxBytes[eth0]: 12500000 LegendI[eth0]: incoming LegendO[eth0]: outgoing Legend1[eth0]: incoming bits Legend2[eth0]: outgoing bits YLegend[eth0]: Traffic (bps) ShortLegend[eth0]: bps # CPU Load Average Title[cpuload]: CPU Load Average of Hibaru.JamFunk.jp PageTop[cpuload]: <H1>CPU Load Average of Hibaru.JamFunk.jp</H1> Target[cpuload]: 1.3.6.1.4.1.2021.10.1.5.2&1.3.6.1.4.1.2021.10.1.5.1:snmp_jamfunk@localhost Options[cpuload]: gauge MaxBytes[cpuload]: 100 AbsMax[cpuload]: 1000 Unscaled[cpuload]: dwmy YTics[cpuload]: 10 LegendI[cpuload]: avg. (5min.) LegendO[cpuload]: avg. (1min.) Legend1[cpuload]: CPU load average (percentage per 5 minute) Legend2[cpuload]: CPU load average (percentage per 1 minutes) YLegend[cpuload]: CPU LoadAvg (%) ShortLegend[cpuload]: % # Memory Used Title[mem]: Memory Used of Hibaru.JamFunk.jp PageTop[mem]: <H1>Memory Used of Hibaru.JamFunk.jp</H1> Target[mem]: 1.3.6.1.4.1.2021.4.6.0&1.3.6.1.4.1.2021.4.4.0:snmp_jamfunk@localhost Options[mem]: gauge MaxBytes1[mem]: 1033044 MaxBytes2[mem]: 2097136 kilo[mem]: 1024 kMG[mem]: k,M LegendI[mem]: Real LegendO[mem]: Swap Legend1[mem]: Real Memory Used (Bytes) Legend2[mem]: Swap Memory Used (Bytes) YLegend[mem]: Memory Used (Bytes) ShortLegend[mem]: B # Disk Used Title[disk]: Disk Used of Hibaru.JamFunk.jp PageTop[disk]: <H1>Disk Used of Hibaru.JamFunk.jp</H1> Target[disk]: 1.3.6.1.4.1.2021.9.1.8.1&1.3.6.1.4.1.2021.9.1.8.2:snmp_jamfunk@localhost Options[disk]: gauge MaxBytes1[disk]: 20635700 MaxBytes2[disk]: 136037512 Unscaled[disk]: dwmy YTics[disk]: 6 kilo[disk]: 1024 kMG[disk]: k,M,G LegendI[disk]: /(route) LegendO[disk]: /home Legend1[disk]: /(route) used (Bytes) Legend2[disk]: /home used (Bytes) YLegend[disk]: Disk Used (B) ShortLegend[disk]: B