顯示文章

這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。


文章 - gabril

頁: [1]
1
INCLUDES=-I /usr/include/httpd -I /usr/include/apr-0
这句什么意思,我找不到apr-0这个参数,我是源代码编译安装是不是就指向,安装目录的include呢

我安装到的目录是/opt/apache2
是不是就写成
INCLUDES = -I /opt/apache2/include/httpd -I /usr/include/apr
但是我没有找到apr-0这个目录
/ld.so.conf
写成
/opt/apache2/lib
我fastcgi不能成功解析,cgi能成功解析,所以来问问

2
代碼: [選擇]
filename = "sample.rrd"
rrd_version = "0003"
step = 600
last_update = 1178705986
ds[DS1].type = "COUNTER"
ds[DS1].minimal_heartbeat = 6000
ds[DS1].min = 0.0000000000e+00
ds[DS1].max = 1.0000000000e+02
ds[DS1].last_ds = "100"
ds[DS1].value = 9.7666666667e+00
ds[DS1].unknown_sec = 0
rra[0].cf = "MAX"
rra[0].rows = 1000
rra[0].pdp_per_row = 5
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = 1.6666666667e-02
rra[0].cdp_prep[0].unknown_datapoints = 0

这个ds[DS1].value = 9.7666666667e+00是如何出现的,并被计算的阿?
附上我的update log
代碼: [選擇]

rrdtool update sample.rrd  1178695186:1
rrdtool update sample.rrd  1178695786:2
rrdtool update sample.rrd  1178696386:3
rrdtool update sample.rrd  1178696986:4
rrdtool update sample.rrd  1178697586:5
rrdtool update sample.rrd  1178698186:6
rrdtool update sample.rrd  1178698786:7
rrdtool update sample.rrd  1178699386:8
rrdtool update sample.rrd  1178699986:9
rrdtool update sample.rrd  1178700586:10
rrdtool update sample.rrd  1178701186:20
rrdtool update sample.rrd  1178701786:30
rrdtool update sample.rrd  1178702386:40
rrdtool update sample.rrd  1178702986:50
rrdtool update sample.rrd  1178703586:60
rrdtool update sample.rrd  1178704186:70
rrdtool update sample.rrd  1178704786:80
rrdtool update sample.rrd  1178705386:90
rrdtool update sample.rrd  1178705986:100

3
代碼: [選擇]
filename = "sample.rrd"
rrd_version = "0003"
step = 600
last_update = 1178705986
ds[DS1].type = "COUNTER"
ds[DS1].minimal_heartbeat = 6000
ds[DS1].min = 0.0000000000e+00
ds[DS1].max = 1.0000000000e+02
ds[DS1].last_ds = "100"
ds[DS1].value = 9.7666666667e+00
ds[DS1].unknown_sec = 0
rra[0].cf = "MAX"
rra[0].rows = 1000
rra[0].pdp_per_row = 5
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = 1.6666666667e-02
rra[0].cdp_prep[0].unknown_datapoints = 0

这个ds[DS1].value = 9.7666666667e+00是如何出现的,并被计算的阿?
附上我的update log
代碼: [選擇]

rrdtool update sample.rrd  1178695186:1
rrdtool update sample.rrd  1178695786:2
rrdtool update sample.rrd  1178696386:3
rrdtool update sample.rrd  1178696986:4
rrdtool update sample.rrd  1178697586:5
rrdtool update sample.rrd  1178698186:6
rrdtool update sample.rrd  1178698786:7
rrdtool update sample.rrd  1178699386:8
rrdtool update sample.rrd  1178699986:9
rrdtool update sample.rrd  1178700586:10
rrdtool update sample.rrd  1178701186:20
rrdtool update sample.rrd  1178701786:30
rrdtool update sample.rrd  1178702386:40
rrdtool update sample.rrd  1178702986:50
rrdtool update sample.rrd  1178703586:60
rrdtool update sample.rrd  1178704186:70
rrdtool update sample.rrd  1178704786:80
rrdtool update sample.rrd  1178705386:90
rrdtool update sample.rrd  1178705986:100
[/code]

4
非常感谢,您说的1.6666666667e-02这个我明白,我问题是为什么只有一个值,不是应该有3个值么,那个1.66。。。我刚刚明白,是不是拿最大的差值除以step 600?

5
引用
所以,若我們再看一個例子
代碼:

rrdtool create sample.rrd -s 600 -b `date -d "2005/03/01" +%s` \
DS:DS1:COUNTER:6000:0:100 \
RRA:MAX:0.5:5:1000

如果 2005/03/01 後,每十分鐘各輸入
1 2 3 4 5 6 7 8 9 10 20 30 40 50 60 70 80 90 100
試問,若畫20050301 該天的圖, 會有幾個數據? 值為何 ? 為什麼 ?

答案為3個數據,值分別為 0.001666667/0.016666667/0.016666667 ,為什麼就看您的理解囉


我不是很明白如何得到这个结果所以写了脚本测试,结果跟是迷茫希望赐教下。
代碼: [選擇]
#!/usr/bin/perl -w

my $timestamp=`date  +%s`;
chomp $timestamp;
`rrdtool create sample.rrd -s 600 -b $timestamp DS:DS1:COUNTER:6000:0:100 RRA:MAX:0.5:5:1000`;
my @array = (1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100);

for ( my $i = 0;$i < 19;$i++){
$timestamp+=600;
print "rrdtool update sample.rrd  $timestamp:$array[$i]\n" ;
`rrdtool update sample.rrd  $timestamp:$array[$i]` ;

}
`rrdtool xport DEF:DS1=sample.rrd:DS1:MAX XPORT:DS1:MAX>sample.xml`;



代碼: [選擇]

<?xml version="1.0" encoding="ISO-8859-1"?>

<xport>
  <meta>
    <start>1178610000</start>
    <step>3000</step>
    <end>1178697000</end>
    <rows>30</rows>
    <columns>1</columns>
    <legend>
      <entry>MAX</entry>
    </legend>
  </meta>
  <data>
    <row><t>1178610000</t><v>NaN</v></row>
    <row><t>1178613000</t><v>NaN</v></row>
    <row><t>1178616000</t><v>NaN</v></row>
    <row><t>1178619000</t><v>NaN</v></row>
    <row><t>1178622000</t><v>NaN</v></row>
    <row><t>1178625000</t><v>NaN</v></row>
    <row><t>1178628000</t><v>NaN</v></row>
    <row><t>1178631000</t><v>NaN</v></row>
    <row><t>1178634000</t><v>NaN</v></row>
    <row><t>1178637000</t><v>NaN</v></row>
    <row><t>1178640000</t><v>NaN</v></row>
    <row><t>1178643000</t><v>NaN</v></row>
    <row><t>1178646000</t><v>NaN</v></row>
    <row><t>1178649000</t><v>NaN</v></row>
    <row><t>1178652000</t><v>NaN</v></row>
    <row><t>1178655000</t><v>NaN</v></row>
    <row><t>1178658000</t><v>NaN</v></row>
    <row><t>1178661000</t><v>NaN</v></row>
    <row><t>1178664000</t><v>NaN</v></row>
    <row><t>1178667000</t><v>NaN</v></row>
    <row><t>1178670000</t><v>NaN</v></row>
    <row><t>1178673000</t><v>NaN</v></row>
    <row><t>1178676000</t><v>NaN</v></row>
    <row><t>1178679000</t><v>NaN</v></row>
    <row><t>1178682000</t><v>NaN</v></row>
    <row><t>1178685000</t><v>NaN</v></row>
    <row><t>1178688000</t><v>NaN</v></row>
    <row><t>1178691000</t><v>NaN</v></row>
    <row><t>1178694000</t><v>NaN</v></row>
    <row><t>1178697000</t><v>1.6666666667e-03</v></row>
  </data>
</xport>


为什么是三十笔不应该是取1000笔的么,1。666。。如何取到的阿。迷茫阿
rrdtool info sample.rrd 的信息是
代碼: [選擇]

filename = "sample.rrd"
rrd_version = "0003"
step = 600
last_update = 1178705986
ds[DS1].type = "COUNTER"
ds[DS1].minimal_heartbeat = 6000
ds[DS1].min = 0.0000000000e+00
ds[DS1].max = 1.0000000000e+02
ds[DS1].last_ds = "100"
ds[DS1].value = 9.7666666667e+00
ds[DS1].unknown_sec = 0
rra[0].cf = "MAX"
rra[0].rows = 1000
rra[0].pdp_per_row = 5
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = 1.6666666667e-02
rra[0].cdp_prep[0].unknown_datapoints = 0


6
問題已經解決,封帖

7
1、系統 debian ,apt-get install snmpd
2、snmpd已開
3、161端口開放中
4、snmpwalk -c public -v 1 localhost system 命令正常显示
问题
1、从哪个rfc可以查到所有oid的号码,已看的rfc是1213 和 1155
2、命令
snmpwalk -c public -v 1 localhost ip
snmpwalk -c public -v 1 localhost udp
snmpwalk -c public -v 1 localhost tcp
snmpwalk -c public -v 1 localhost 1.3.6.1.2.1.2
etc(
  'interfaces' => '1.3.6.1.2.1.2',
    'ifNumber' => '1.3.6.1.2.1.2.1.0',
    'ifTable' => '1.3.6.1.2.1.2.2',
    'ifEntry' => '1.3.6.1.2.1.2.2.1',
    'ifIndex' => '1.3.6.1.2.1.2.2.1.1',
    'ifInOctets' => '1.3.6.1.2.1.2.2.1.10',
    'ifInUcastPkts' => '1.3.6.1.2.1.2.2.1.11',
    'ifInNUcastPkts' => '1.3.6.1.2.1.2.2.1.12',
    'ifInDiscards' => '1.3.6.1.2.1.2.2.1.13',
    'ifInErrors' => '1.3.6.1.2.1.2.2.1.14',
    'ifInUnknownProtos' => '1.3.6.1.2.1.2.2.1.15',
    'ifOutOctets' => '1.3.6.1.2.1.2.2.1.16',
    'ifOutUcastPkts' => '1.3.6.1.2.1.2.2.1.17',
    'ifOutNUcastPkts' => '1.3.6.1.2.1.2.2.1.18',
    'ifOutDiscards' => '1.3.6.1.2.1.2.2.1.19',
    'ifDescr' => '1.3.6.1.2.1.2.2.1.2',
    'ifOutErrors' => '1.3.6.1.2.1.2.2.1.20',
    'ifOutQLen' => '1.3.6.1.2.1.2.2.1.21',
    'ifSpecific' => '1.3.6.1.2.1.2.2.1.22',
    'ifType' => '1.3.6.1.2.1.2.2.1.3',
    'ifMtu' => '1.3.6.1.2.1.2.2.1.4',
    'ifSpeed' => '1.3.6.1.2.1.2.2.1.5',
    'ifPhysAddress' => '1.3.6.1.2.1.2.2.1.6',
    'ifAdminHack' => '1.3.6.1.2.1.2.2.1.7',  
    'ifAdminStatus' => '1.3.6.1.2.1.2.2.1.7',
    'ifOperHack' => '1.3.6.1.2.1.2.2.1.8',            
    'ifOperStatus' => '1.3.6.1.2.1.2.2.1.8',
    'ifLastChange' => '1.3.6.1.2.1.2.2.1.9',)
===============================================
問題是輸入以上命令后
得到的結果都只有一行
End MIB
===============================================
配置文件如下
/etc/snmp/snmpd.conf
com2sec paranoid  default         public
com2sec paranoid  172.18.30.0/24  public
group MyROSystem v1        paranoid
group MyROSystem v2c       paranoid
group MyROSystem usm       paranoid
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
group MyRWGroup v1         readwrite
group MyRWGroup v2c        readwrite
group MyRWGroup usm        readwrite
view all    included  .1                               80
view system included  .iso.org.dod.internet.mgmt.mib-2.system
view udpLocalAddress included .1.3.6.1.2.1.7.5.1.1
access MyROSystem ""     any       noauth    exact  system none   none
access MyROGroup ""      any       noauth    exact  all    none   none
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation China,Shanghai
syscontact <Chandle.WEi@gmail.com>
proc
disk / 10000
load 12 14 14

8
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 18:23 »
主要是對网路qos(就是流量平衡)的流量查看

9
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 18:21 »
munin難到提供數据源,可是述据不是都是基于snmp獲得的么,反正我先在搞各snmp腦子炸了快,net-snmp的文檔正在看。再次感謝阿

10
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 14:46 »
感覺用rdd跟加方便,我己為rdd看了很多文檔了,不想找別的了,thx

11
Linux 討論版 / 安裝的模快
« 於: 2006-07-13 14:08 »
debian:~# dpkg -l|grep snmp
ii  libnet-snmp-perl                 5.2.0-1                     Script SNMP connections
ii  libsnmp-base                     5.2.2-3                     NET SNMP (Simple Network Management Protocol
ii  libsnmp-perl                     5.2.2-3                     NET SNMP (Simple Network Management Protocol
ii  libsnmp-session-perl             1.08-1                      Perl support for accessing SNMP-aware device
ii  libsnmp9                         5.2.2-3                     NET SNMP (Simple Network Management Protocol
ii  snmp                             5.2.2-3                     NET SNMP (Simple Network Management Protocol
ii  snmpd                            5.2.2-3                     NET SNMP (Simple Network Management Protocol

12
Linux 討論版 / snmptest 的測試
« 於: 2006-07-13 14:06 »
debian:/usr/share/snmp# snmptest -v 2c -c public 127.0.0.1:161
Variable: system.sysDescr.0
Variable: system.sysContact.0
Variable:
Received Get Response from UDP: [127.0.0.1]:161
requestid 0x353EB53F errstat 0x0 errindex 0x0
SNMPv2-MIB::sysDescr.0 = STRING: Linux debian 2.6.15-1-686 #2 Mon Mar 6 15:27:08 UTC 2006 i686
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
Variable:  SNMPv2-MIB::sysORUpTime
 SNMPv2-MIB::sysORUpTime: Unknown Object Identifier (Sub-id not found: (top) -> system)

13
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 13:50 »
% snmpstatus -c netadmin -v 1 localhostt
Error in packet.
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: IP-MIB::ipOutRequests.0

Error in packet.
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: IP-MIB::ipInReceives.0

[UDP: [127.0.0.1]:161]=>[Linux debian 2.6.15-1-686 #2 Mon Mar 6 15:27:08 UTC 2006 i686] Up: 0:01:37.30
Error in packet.
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: IF-MIB::ifOutNUcastPkts

Interfaces: 0, Recv/Trans packets: 0/0 | IP: 0/0
===========================================================
debian:~# ps -ef |grep snmp
root      7131  6043  0 13:34 pts/2    00:00:00 man snmptest
snmp      7234     1  0 13:43 ?        00:00:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1
root      7269  7175  0 13:48 pts/4    00:00:00 grep snmp
=============================================================
debian:~# netstat -nap | grep :161
udp        0      0 127.0.0.1:161           0.0.0.0:*                          7234/snmpd

14
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 13:28 »
/usr/share/snmp/包含
mib2c-data  mibs  snmpconf-datamib2c-data
/usr/share/snmp/mibs/包含
AGENTX-MIB.txt                       OSPF-TRAP-MIB.txt
BGP4-MIB.txt                         RFC1155-SMI.txt
BRIDGE-MIB.txt                       RFC1213-MIB.txt
DISMAN-SCHEDULE-MIB.txt              RFC-1215.txt
DISMAN-SCRIPT-MIB.txt                RIPv2-MIB.txt
EtherLike-MIB.txt                    RMON-MIB.txt
GNOME-SMI.txt                        SMUX-MIB.txt
HCNUM-TC.txt                         SNMP-COMMUNITY-MIB.txt
HOST-RESOURCES-MIB.txt               SNMP-FRAMEWORK-MIB.txt
HOST-RESOURCES-TYPES.txt             SNMP-MPD-MIB.txt
IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt  SNMP-NOTIFICATION-MIB.txt
IANAifType-MIB.txt                   SNMP-PROXY-MIB.txt
IANA-LANGUAGE-MIB.txt                SNMP-TARGET-MIB.txt
IANA-RTPROTO-MIB.txt                 SNMP-USER-BASED-SM-MIB.txt
IF-INVERTED-STACK-MIB.txt            SNMP-USM-AES-MIB.txt
IF-MIB.txt                           SNMP-USM-DH-OBJECTS-MIB.txt
INET-ADDRESS-MIB.txt                 SNMPv2-CONF.txt
IP-FORWARD-MIB.txt                   SNMPv2-MIB.txt
IP-MIB.txt                           SNMPv2-SMI.txt
IPV6-ICMP-MIB.txt                    SNMPv2-TC.txt
IPV6-MIB.txt                         SNMPv2-TM.txt
IPV6-TCP-MIB.txt                     SNMP-VIEW-BASED-ACM-MIB.txt
IPV6-TC.txt                          SOURCE-ROUTING-MIB.txt
IPV6-UDP-MIB.txt                     TCP-MIB.txt
LM-SENSORS-MIB.txt                   TRANSPORT-ADDRESS-MIB.txt
NET-SNMP-AGENT-MIB.txt               UCD-DEMO-MIB.txt
NET-SNMP-EXAMPLES-MIB.txt            UCD-DISKIO-MIB.txt
NET-SNMP-EXTEND-MIB.txt              UCD-DLMOD-MIB.txt
NET-SNMP-MIB.txt                     UCD-IPFWACC-MIB.txt
NET-SNMP-TC.txt   AGENTX-MIB.txt                       OSPF-TRAP-MIB.txt
BGP4-MIB.txt                         RFC1155-SMI.txt
BRIDGE-MIB.txt                       RFC1213-MIB.txt
DISMAN-SCHEDULE-MIB.txt              RFC-1215.txt
DISMAN-SCRIPT-MIB.txt                RIPv2-MIB.txt
EtherLike-MIB.txt                    RMON-MIB.txt
GNOME-SMI.txt                        SMUX-MIB.txt
HCNUM-TC.txt                         SNMP-COMMUNITY-MIB.txt
HOST-RESOURCES-MIB.txt               SNMP-FRAMEWORK-MIB.txt
HOST-RESOURCES-TYPES.txt             SNMP-MPD-MIB.txt
IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt  SNMP-NOTIFICATION-MIB.txt
IANAifType-MIB.txt                   SNMP-PROXY-MIB.txt
IANA-LANGUAGE-MIB.txt                SNMP-TARGET-MIB.txt
IANA-RTPROTO-MIB.txt                 SNMP-USER-BASED-SM-MIB.txt
IF-INVERTED-STACK-MIB.txt            SNMP-USM-AES-MIB.txt
IF-MIB.txt                           SNMP-USM-DH-OBJECTS-MIB.txt
INET-ADDRESS-MIB.txt                 SNMPv2-CONF.txt
IP-FORWARD-MIB.txt                   SNMPv2-MIB.txt
IP-MIB.txt                           SNMPv2-SMI.txt
IPV6-ICMP-MIB.txt                    SNMPv2-TC.txt
IPV6-MIB.txt                         SNMPv2-TM.txt
IPV6-TCP-MIB.txt                     SNMP-VIEW-BASED-ACM-MIB.txt
IPV6-TC.txt                          SOURCE-ROUTING-MIB.txt
IPV6-UDP-MIB.txt                     TCP-MIB.txt
LM-SENSORS-MIB.txt                   TRANSPORT-ADDRESS-MIB.txt
NET-SNMP-AGENT-MIB.txt               UCD-DEMO-MIB.txt
NET-SNMP-EXAMPLES-MIB.txt            UCD-DISKIO-MIB.txt
NET-SNMP-EXTEND-MIB.txt              UCD-DLMOD-MIB.txt
NET-SNMP-MIB.txt                     UCD-IPFWACC-MIB.txt
NET-SNMP-TC.txt                      UCD-SNMP-MIB.txt
NOTIFICATION-LOG-MIB.txt             UDP-MIB.txt
OSPF-MIB.txt
                   UCD-SNMP-MIB.txt
NOTIFICATION-LOG-MIB.txt             UDP-MIB.txt
OSPF-MIB.txt

15
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 13:25 »
我怀疑是我的mib的問題
使終在 man 或者 google中找到解決的方法。
我是想弄rrd的,因為看到了abelyang的大作。
么想到一開始就卡住了,請各位大大指點指點洒

16
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 13:20 »
在man smnpwalk中看到的一段教本也非常讓人費解
里面有這痒一句
 snmpwalk -Os -c public -v 1 zeus system
我云行這命令
 snmpwalk -Os -c netadmin -v 1 debain system
sysDescr.0 = STRING: Linux debian 2.6.15-1-686 #2 Mon Mar 6 15:27:08 UTC 2006 i686
sysObjectID.0 = OID: dod.0.0.0.0.0.0.0
sysUpTime.0 = Timeticks: (596657) 1:39:26.57
sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
sysName.0 = STRING: debian
sysLocation.0 = STRING: Unknown (configure /etc/snmp/snmpd.local.conf)
sysORLastChange.0 = Timeticks: (2) 0:00:00.02
sysORID.1 = OID: ifMIB
sysORID.2 = OID: snmpMIB
sysORID.3 = OID: tcpMIB
sysORID.4 = OID: ip
sysORID.5 = OID: udpMIB
sysORID.6 = OID: vacmBasicGroup
sysORID.7 = OID: snmpFrameworkMIBCompliance
sysORID.8 = OID: snmpMPDCompliance
sysORID.9 = OID: usmMIBCompliance
sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-layers
sysORDescr.2 = STRING: The MIB module for SNMPv2 entities
sysORDescr.3 = STRING: The MIB module for managing TCP implementations
sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementations
sysORDescr.5 = STRING: The MIB module for managing UDP implementations
sysORDescr.6 = STRING: View-based Access Control Model for SNMP.
sysORDescr.7 = STRING: The SNMP Management Architecture MIB.
sysORDescr.8 = STRING: The MIB for Message Processing and Dispatching.
sysORDescr.9 = STRING: The management information definitions for the SNMP User-based Security Model.
sysORUpTime.1 = Timeticks: (1) 0:00:00.01
sysORUpTime.2 = Timeticks: (1) 0:00:00.01
sysORUpTime.3 = Timeticks: (1) 0:00:00.01
sysORUpTime.4 = Timeticks: (1) 0:00:00.01
sysORUpTime.5 = Timeticks: (1) 0:00:00.01
sysORUpTime.6 = Timeticks: (1) 0:00:00.01
sysORUpTime.7 = Timeticks: (2) 0:00:00.02
sysORUpTime.8 = Timeticks: (2) 0:00:00.02
sysORUpTime.9 = Timeticks: (2) 0:00:00.02
End of MIB
看起來很正常
里面的參數 (-Oc -c )netadmin
在man snmpwalk 中未發現該 這兩個參數的說明很迷茫

17
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 13:12 »
在rrd官方网站上有beginner tut 的這樣的腳本

#!/bin/sh
a=0
while [ "$a" == 0 ]; do
snmpwalk -c public 192.168.1.250 hrSWRunPerfMem > snmp_reply
    total_mem=`awk 'BEGIN {tot_mem=0}
                          { if ($NF == "KBytes")
                            {tot_mem=tot_mem+$(NF-1)}
                          }
                    END {print tot_mem}' snmp_reply`
    # I can use N as a replacement for the current time
    rrdtool update target.rrd N:$total_mem
    # sleep until the next 300 seconds are full
    perl -e 'sleep 300 - time % 300'
done # end of while loop
+++=============================
不是很明白這一句
snmpwalk -c public 192.168.1.250 hrSWRunPerfMem
我在cmd下運行
snmpwalk -c netadmin -v 1 debian hrSWRunPerfMem
我的host 就叫debian
云行解果是 End in MIB
如果不帶 -v 1得到的解果是
snmpwalk: No securityName specified (Sub-id not found: (top) -> hrSWRunPerfMem)

18
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 13:03 »
通過什么方法得到mem cpu 网卡流量,使用的是net-snmp,mib哪里設置,哪里得到呢,msn ariel_gabril@21cn.com mail chandle.wei@gmail.com

19
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 11:56 »
snmpwalk -v 1-c netadmin localhost uptime 現示正常
SNMPv2-MIB::sysUpTime.0 = Timeticks: (107971) 0:17:59.71

20
Linux 討論版 / 請教snmp問題
« 於: 2006-07-13 11:53 »
最近想使用snmp讀取本机的流量,cpu等
出現如下問題
system debian
install :apt-get install snmpd
snmpd.conf
 
com2sec paranoid  default         public
com2sec local   localhost       netadmin
com2sec mynetwork       172.18.30.0/24  netadmin
group MyROSystem v1        local
group MyROSystem v1        mynetwork
group MyROSystem v2c       paranoid
group MyROSystem usm       paranoid
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
group MyRWGroup v1         readwrite
group MyRWGroup v2c        readwrite
group MyRWGroup usm        readwrite
view all    included  .1                               80
view system included  .iso.org.dod.internet.mgmt.mib-2.system
view systemview include .1.3.6.1.2.1.1
view systemview include .1.3.6.1.2.1.25.1.1
view systemview include .1.3.6.1.2.1.2021.10.1.5
view systemview include .1.3.6.1.2.1.2021.11
view systemview include .1.3.6.1.2.1.25.2.3.1.6
view systemview include .1.3.6.1.2.1.2
view systemview include .1.3.6.1.2.1.2021.9.1.8
view systemview include .1.3.6.1.2.1.25.1.6
view systemview include .1.3.6.1.2.1.6.9
access MyROSystem ""     any       noauth    exact  system none   none
access MyROGroup ""      any       noauth    prefix all    none   none
access MyRWGroup ""      any       noauth    prefix all    all    all
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root <root@localhost> (configure etc/snmp/snmpd.local.conf)

%snmpwalk -v 1 -c netadmin localhost .1.3.6.1.2.1.2.2.1.10
End of MIB

21
看了一遍,接近一年的持需帖,真是感激涕零。几日前有相同的需求,尋找了很多方法。今天才找到這里,真是非常感謝阿

頁: [1]