linux snmp扫描工具,Linux开启snmp及查询

1.Linux snmp

1、安装snmp

yum install -y net-snmp*

2、备份snmp配置

cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak

3、添加文本

> /etc/snmp/snmpd.conf ; cat > /etc/snmp/snmpd.conf<

rocommunity SZ-SNMP-PRIVATE

group notConfigGroup v1 notConfigUser

group notConfigGroup v2c notConfigUser

access notConfigGroup "" any noauth exact all none none

view all included .1 80

syslocation Unknown (edit /etc/snmp/snmpd.conf)

syscontact Root root@localhost (configure /etc/snmp/snmp.local.conf)

dontLogTCPWrappersConnects yes

EOF

注:rocommunity:允许IP根据团体名以只读方式获取snmp数据,格式为: rocommunity 团体名 乐维采集服务器IP地址(不填默认为允许全部)

rocommunity SZ-SNMP-PRIVATE(团体名) 10.245.119.44

4、重启snmp

service snmpd restart

5、查看主机SNMP

snmpwalk -v 2c -c SZ-SNMP-PRIVATE 192.168.1.145

(显示主机所有的snmp)

6、选取有用的信息:

常用主机参数:

系统参数(1.3.6.1.2.1.1)

OID

描述

备注

.1.3.6.1.2.1.1.1.0

获取系统基本信息

SysDesc

.1.3.6.1.2.1.1.3.0

监控时间

sysUptime

.1.3.6.1.2.1.1.4.0

系统联系人

sysContact

.1.3.6.1.2.1.1.5.0

获取机器名

SysName

.1.3.6.1.2.1.1.6.0

机器坐在位置

SysLocation

.1.3.6.1.2.1.1.7.0

机器提供的服务

SysService

.1.3.6.1.2.1.25.4.2.1.2

系统运行的进程列表

hrSWRunName

.1.3.6.1.2.1.25.6.3.1.2

系统安装的软件列表

hrSWInstalledName

snmpwalk -v 2c -c SZ-SNMP-PRIVATE 192.168.1.145 .1.3.6.1.2.1.1.1.0

SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64

主机常用OID: http://www.ttlsa.com/monitor/snmp-oid/

linux环境下的snmp测试脚本, Installing SNMPv2C Agent Conformance Test Package 2008/04/08 IPv6 Promotion Council Terminology =========== Tester Node (TN) A tester node for the conformance tests. Node Under Test (NUT) A testee node for the conformance tests. Network Under Test The network where the conformance tests are executed. Tester Interface The network interface of TN hooked up to the Network Under Test. Interface Under Test The network interface of NUT hooked up to the Network Under Test. Prerequisites ============= Prerequisites for TN: - The package supports FreeBSD 6.0-RELEASE or higher version. - The package can also coexist with FreeBSD version of KAME. Installing the package onto TN ============================== 0. Before Starting (A) You need to install following softwares. - Perl (Required version : 5.8.7 or higher) - Net-SNMP (Required version : 5.3.1 or higher) *** You can download it from the following URL: http://net-snmp.sourceforge.net/ - v6eval (Required version : 3.0.11 or higher) Please refer to 00README.v6eval in "v6eval" for more information. *** You can download it from the following URL: http://www.tahi.org/release/ - koi (Required version : 1.1.1 or higher) Please refer to README file in "koi" package for more information. *** You can download it from the following URL: http://www.tahi.org/release/ 1. Extracting ct package % tar zxvf ct-snmpv2c-ag-X.X.tar.gz 2. Copying ct package Copy ct directory to any directory you like. % cp -pR $ORGDIR/ct-snmpv2c-ag-X.X $SOMEWHERE/ct-snmpv2c-ag-X.X % chmod -R +w $SOMEWHERE/ct-snmpv2c-ag-X.X 4. Setup ct environment % (enable TN's ipv6 capibility) % cd $SOMEWHERE/ct-snmpv2c-ag-X.X % edit config.txt % make test [End of INSTALL]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值