¡m¤À¨É¡nLinux Resource Threshold | |
Linux¦b±Ò¥ÎSNMP«á¡AResource Graphs¤w¥i±o¨ìCPU/Memory/Diskµ¥¬y¶q¹Ï¡C
CPU
Memory
Disk
Disk-inodes
¦Ó¨ä°Ñ·Óªº³]©w«h©w¸q¦bnetsnmp.xml¤¤¡A¸ô®|¦p¤U¡C
/usr/share/opennms/etc/datacollection/netsnmp.xml
##### CPU #####
<group name="ucd-loadavg" ifType="ignore">
<mibObj oid=".1.3.6.1.4.1.2021.10.1.5" instance="1" alias="loadavg1" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.10.1.5" instance="2" alias="loadavg5" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.10.1.5" instance="3" alias="loadavg15" type="integer" />
</group>
##### Memory #####
<group name="ucd-memory" ifType="ignore">
<!-- Total Swap Size configured for the host. -->
<mibObj oid=".1.3.6.1.4.1.2021.4.3" instance="0" alias="memTotalSwap" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.4.4" instance="0" alias="memAvailSwap" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.4.5" instance="0" alias="memTotalReal" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.4.6" instance="0" alias="memAvailReal" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.4.11" instance="0" alias="memTotalFree" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.4.13" instance="0" alias="memShared" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.4.14" instance="0" alias="memBuffer" type="integer" />
<mibObj oid=".1.3.6.1.4.1.2021.4.15" instance="0" alias="memCached" type="integer" />
<!-- Error flag. 1 indicates very little swap space left -->
<mibObj oid=".1.3.6.1.4.1.2021.4.100" instance="0" alias="memSwapError" type="integer" />
</group>
##### Disk #####
<group name="net-snmp-disk" ifType="all">
<mibObj oid=".1.3.6.1.4.1.2021.9.1.2" instance="dskIndex" alias="ns-dskPath" type="string" />
<mibObj oid=".1.3.6.1.4.1.2021.9.1.6" instance="dskIndex" alias="ns-dskTotal" type="gauge" />
<mibObj oid=".1.3.6.1.4.1.2021.9.1.7" instance="dskIndex" alias="ns-dskAvail" type="gauge" />
<mibObj oid=".1.3.6.1.4.1.2021.9.1.8" instance="dskIndex" alias="ns-dskUsed" type="gauge" />
<mibObj oid=".1.3.6.1.4.1.2021.9.1.9" instance="dskIndex" alias="ns-dskPercent" type="gauge" />
</group>
<group name="net-snmp-disk-more" ifType="all">
<mibObj oid=".1.3.6.1.4.1.2021.9.1.3" instance="dskIndex" alias="ns-dskDevice" type="string" />
<mibObj oid=".1.3.6.1.4.1.2021.9.1.10" instance="dskIndex" alias="ns-dskPercentNode" type="gauge" />
</group>
¦³¤F³o¨Çoid©w¸q¡A¤S¯à¥H³o¨Ç¼Æ¾Úø»s¬y¶q¹Ï¡A
§ÚÌ·íµM¤]¥i¥H¨Ï¥Î³o¨Ç¼Æ¾Ú¨Ó³]©w¬ÛÃöthresholdªº§iĵ¾÷¨î¡C
¥H¤W³]©w¡A³£¬O®³¨t²Î¹w³]ªºthreshold¨Ó°µ¥Ü½d¡A
§ÚÌ¥i¥Hª½±µ×§ï®M¥Î¡A©Î¥H¥¦¬°½d¥»¨Ó·s¼W¦Û¤v»Ýnªºthreshold¡C
¦Ó³o¨Çthresholdªº¤º®e´N¦s©ñ¦b¥H¤U¸ô®|ªº thresholds.xml Àɮפ¤¡C
/usr/share/opennms/etc/thresholds.xml
¦bthresholds.xmlªº³]©w¤¤¡A§ÚÌ¥u¯à®³¦PÄݤ@Ógroupªºoid¨Ó°µ¹LÂo±ø¥ó¡A
¦p¤W¨Òdisk threshold¤¤¡A§ÚÌ¥Hns-dskPath°µ¬°¹LÂo±ø¥ó¡C
Y§ÚÌ»Ýn¥HIP¨Ó°µ¬°±ø¥ó¡A©Î¬Oקï¨C5¤ÀÄÁªº°»´ú¶¡¹j¡A
¥²»Ý³z¹Lקï¥t¤@Ó³]©wÀÉ threshd-configuration.xml ¨Ó§¹¦¨¡C
/usr/share/opennms/etc/threshd-configuration.xml
threshd-configuration.xml »P thresholds.xml ³o¨âÓ³]©wÀɬO¬Û¤¬©IÀ³ªº¡A¥H¸É©¼¦¹¤£¨¬¡C
Â^¨úthreshd-configuration.xml¤¤ netsnmp ªº³]©w¬°¨Ò
<package name="netsnmp">
<filter>IPADDR != '0.0.0.0' & (nodeSysOID LIKE '.1.3.6.1.4.1.2021.%' | nodeSysOID LIKE '.1.3.6.1.4.1.8072.%')</filter>
<include-range begin="1.1.1.1" end="254.254.254.254"/>
<include-range begin="::1" end="ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" />
<service name="SNMP" interval="300000" user-defined="false" status="on">
<parameter key="thresholding-group" value="netsnmp"/>
</service>
</package>
§ÚÌ¥i¥H¬Ý¨ì¦bnetsnmp³oÓpackageùØ¡A©w¸q¤F°»´ú®É¶¡¶¡¹j»PIP½d³òµ¥¦h¶µ°Ñ¼Æ¡C
¦Ó¨ä¤¤³othresholding-group³oÓkeyÈ¡A«h²M·¡©w¸q³oÓpackage¬O»Pnetsnmp³oÓgroup¤¬¬Û©IÀ³ªº¡C
¦bthreshd-configuration.xml¤¤¡A¹w³]ªº°»´ú®É¶¡¶¡¹j¬°300000²@¬í¡A¤]´N¬O5¤ÀÄÁ¡A
Y·QÁYµu®É¶¡¶¡¹j¬°1¤ÀÄÁ¡A¥iª½±µ×§ï interval °Ñ¼Æ¨Ó¹F¦¨¡C
Y·Q¥HIP°µ¬°±ø¥ó¹LÂo¡A¤]¥i©ó¦¹³]©wÀɤ¤¡A³z¹Lקï IPADDR ªºÅÞ¿è§PÂ_¡A©Î¹ï include-range ªº begin & end¨Ó½Õ¾ã¹ïÀ³ªºIP½d³ò¡C
*½Ðª`·N¡A
קï threshd-configuration.xml¡A»Ý«±ÒªA°È³]©w¤~·|¥Í®Ä¡I
Linuxªºthreshold³]©w¨ì¦¹§i¤@¬q¸¨¡ã
°Ñ¦Ò¸ê®Æ
Âø¶Ãªº¾Ç²ßµ§°O¥»
♥¶¶¤l¦Ñ±Cªººô©ç¡A½Ð¦hÃö·Ó¡ã
If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!
|