为了更好的管理hp unix,决定采用snmp来监控设备及其软件的运行情况
net-snmp安装如下:
1.下载net-snmp-5.3.2.tar.gz
2.用root帐户登录
3.将net-snmp-5.3.2.tar.gz解压(tar -zxvf net-snmp-5.3.2.tar.gz)
4.进入net-snmp-5.3.2目录
5.运行./configure,根据提示输入相应信息
6.运行make
7.运行make install
8.设置软链接
root@hpunix:/usr/sbin]#ln -s /usr/local/bin/snmpwalk /usr/sbin/snmpwalk
root@hpunix:/usr/sbin]#ll snmpwalk
lrwxr-xr-x 1 root sys 23 Apr 1 16:23 snmpwalk -> /usr/local/bin/snmpwalk
9.配置监控项/etc/snmpd.conf
root@hpunix:/etc]#ll /etc/snmpd.conf
lrwxr-xr-x 1 root sys 27 Jul 28 2007 /etc/snmpd.conf -> /etc/SnmpAgent.d/snmpd.conf
root@hpunix:/etc]#
10.启动snmp
/usr/local/sbin/snmpd -c /etc/snmpd.conf
11.查看监控项
root@hpunix:/]#snmpwalk -v1 -c public 127.0.0.1 .1.3.6.1.4.1.25337
SNMPv2-SMI::enterprises.25337.20.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.25337.20.1.2.1 = STRING: "loadMonitor"
SNMPv2-SMI::enterprises.25337.20.1.3.1 = STRING: "/usr/bin/perl /monitor/bin/loadReader.pl"
SNMPv2-SMI::enterprises.25337.20.1.100.1 = INTEGER: 0
SNMPv2-SMI::enterprises.25337.20.1.101.1 = STRING: "0.06"
SNMPv2-SMI::enterprises.25337.20.1.101.2 = STRING: "0.06"
SNMPv2-SMI::enterprises.25337.20.1.101.3 = STRING: "0.06"
SNMPv2-SMI::enterprises.25337.20.1.101.4 = STRING: "Mon Jun 8 16:35:00 2009"
SNMPv2-SMI::enterprises.25337.20.1.102.1 = INTEGER: 0
SNMPv2-SMI::enterprises.25337.20.1.103.1 = ""
SNMPv2-SMI::enterprises.25337.20.2.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.25337.20.2.2.1 = STRING: "diskMonitor"
SNMPv2-SMI::enterprises.25337.20.2.3.1 = STRING: "/usr/bin/perl /monitor/bin/diskReader.pl"
SNMPv2-SMI::enterprises.25337.20.2.100.1 = INTEGER: 0
"NMPv2-SMI::enterprises.25337.20.2.101.1 = STRING: "-1
"NMPv2-SMI::enterprises.25337.20.2.101.2 = STRING: "-1
SNMPv2-SMI::enterprises.25337.20.2.101.3 = STRING: "Thu Jan 1 08:00:00 1970"
SNMPv2-SMI::enterprises.25337.20.2.102.1 = INTEGER: 0
SNMPv2-SMI::enterprises.25337.20.2.103.1 = ""
SNMPv2-SMI::enterprises.25337.30.10.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.25337.30.10.2.1 = STRING: "DataBase"
SNMPv2-SMI::enterprises.25337.30.10.3.1 = STRING: "/bin/sh /monitor/bin/db.sh"
SNMPv2-SMI::enterprises.25337.30.10.100.1 = INTEGER: 0
SNMPv2-SMI::enterprises.25337.30.10.101.1 = STRING: "81.07"
SNMPv2-SMI::enterprises.25337.30.10.101.2 = STRING: "USER-CONNECT OK!"
SNMPv2-SMI::enterprises.25337.30.10.101.3 = STRING: "DB OK"
SNMPv2-SMI::enterprises.25337.30.10.101.4 = STRING: "49.14"
SNMPv2-SMI::enterprises.25337.30.10.101.5 = STRING: "DISKGROUP OK"
SNMPv2-SMI::enterprises.25337.30.10.101.6 = STRING: "0"
root@hpunix:/]#
12.关闭HP unix系统自己的snmp服务
假如在启动时就不要启动snmp,修改 /etc/rc.config.d/SnmpMaster, 把 =1 改为 =0
/sbin/init.d/SnmpMaster stop
/sbin/init.d/SnmpMaster start
参考
阅读(1828) | 评论(2) | 转发(0) |