Linux ¼à¿Ø/SNMPÅäÖÃ
LinuxϵͳµÄSNMP·þÎñÉèÖÃ
1) °²×°SNMP
ÂÔ£¬Çë²ÎÔÄLINUXϵͳSNMP°²×°ËµÃ÷£¬Ò»°ãÇé¿öÏÂLinuxÖеľùÒѾ×Ô¶¯°²×°ÁËSNMP·þÎñ¡£ÒÔÏÂÃüÁî¿ÉÒÔ¼ì²âSNMP·þÎñÊÇ·ñ°²×°ÒÔ¼°°²×°µÄÎļþ°ü¡£
[root@idc ~]# rpm -qa |grep snmp
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-5.1.2-11.EL4.7
2) ÅäÖÃSNMP
°´ÕÕÈçÏ·½Ê½ÐÞ¸Ä/etc/snmp/snmpd.confÎļþ
A¡¢ÐÞ¸ÄĬÈϵÄcommunity string£¨SUMÖÐSNMP¶ÁÖµÃÜÂ룩
com2sec notConfigUser default public
½«publicÐÞ¸ÄΪÄã²ÅÖªµÀµÄ×Ö·û´®
½«“default”¸ÄΪÄãÏëÄĄ̈»úÆ÷¿ÉÒÔ¿´µ½ÄãµÄsnmpÐÅÏ¢,±ÈÈçSUMËùÔÚIPΪ£º10.10.10.10£¬¾Í¸Ä³ÉÕâ¸öIP¡£²»¸Ä±íʾËùÓлúÆ÷³äÐí¡£
B¡¢°ÑÏÂÃæµÄ#ºÅÈ¥µô
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
ÆôÓÃÈ«²¿¹¦ÄÜ¿ÉÒÔʹÓÃÈçÏÂÒ»ÐУ¨Èç¹ûûÓпÉÒÔ¼ÓÈëÒ»ÐУ©£º
view all included .1 80
C¡¢°ÑÏÂÃæµÄÓï¾ä
access notConfigGroup "" any noauth exact systemview none none
¸Ä³É£º
access notConfigGroup "" any noauth exact mib2 none none
»òÊÇ£º
access notConfigGroup "" any noauth exact all none none
3) Æô¶¯ÓëÍ£Ö¹SNMP
Ò»°ãʹÓãºservice snmpd start|stop|restartÃüÁî¡£»òÊÇ£º
#/etc/rc.d/init.d/snmpd restart
4) ·À»ðǽ
Èç¹ûLinuxÆô¶¯ÁË·À»ðǽ£¬Ç뿪·ÅUDPµÄ161¶Ë¿Ú¡£È·±£LinuxµÄiptables·À»ðǽ¶ÔSUM¼à¿Ø·þÎñÆ÷¿ª·ÅÁËudp 161¶Ë¿ÚµÄ·ÃÎÊȨÏÞ
¿ÉʹÓÃiptables ?L ?n ²é¿´µ±Ç°iptables¹æÔò
¿É±à¼/etc/sysconfig/iptablesÎļþÀ´ÐÞ¸Äiptables¹æÔò¡£
------ÕÜÌοƼ¼¼¼ÊõÑз¢ÖÐÐÄ
Ïà¹ØÎĵµ£º
2010-3-8
Ò»¡¢gccµ÷ÊÔ£º
Èç¹û±àÒëʱ£¬Ê¹ÓÃÏÂÃæµÄÖ¸Áî(Ôö¼ÓÁ˲ÎÊý-g)£¬¾Í»áÉú³É´øÔ´´úÂëµ÷ÊÔ·ûºÅµÄ¿ÉÖ´ÐÐÎļþ¡£±àÒëÐγɵĿÉÖ´ÐÐÎļþÓÐ7KB¡£Ö®ËùÒÔÔö¼ÓÁË2KB£¬¾ÍÊÇÒòΪÔö¼ÓµÄµ÷ÊÔ·ûºÅ¡£
gcc -o calc calcutlator.c -g
½øÒ»²½µØ£¬¾Í¿ÉÒÔÖ´ÐÐÏÂÃæµÄÖ¸ÁîÆô¶¯µ÷ÊÔ¹¤¾ß½øÈëµ÷ÊÔ»·¾³¶Ô³ÌÐò½øÐе÷ÊÔÁË¡£
gdb calc
ÔÚµ÷ÊÔ»·¾³Ï ......
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define NTP_SERVER "clock.via.net"
#define ......
Çл»µ½rootÓû§ÏÂ,
service iptables status ÓÃÓڲ鿴ÊÇ·ñÓпªÆô·À·½Ç½.
service iptables stop ÓÃÓڹرշÀ»ðǽ.
service iptables start ÓÃÓÚ´ò¿ª·À»ðǽ.
·À»ðǽµÄ¿ªÆôÓÐʱ»áÏÞÖÆÍⲿ·ÃÎÊ·þÎñÆ÷ÉϵĶ˿Úʧ°Ü. ......
nmÃüÁî
[
ÔÚGNU CÓïÑÔ¿âÌṩµÄÄÚÈÝÖУ¬ÓнӿڿÉÒÔÓÃÀ´×öÕâ¼þÊ¡£ÓÃÏÂÃæµÄÃüÁî²é¿´£º
nm -D /lib/libc.so.6 | grep log
]
nmÃüÁÊDZȽϼòµ¥¶øÇÒÇ¿´óµÄ¡£ËüÓÃÀ´ÁгöÒ»¸öÄ¿±êÎļþÖеĸ÷ÖÖ·ûºÅ¡£·ûºÅµÄÖÖÀàºÜ¶à£¬ÒÔÏÂÊÇһЩ³£¼ûµÄ·ûºÅÀàÐÍ
nmÊä³ö×Ö·û
º¬Òå
R
Read only symbol. ±ÈÈçÔÚ´úÂëÖÐÓÐÒ»¸öconst MAXDATA ......