本帖最后由 2322312 于 2016-11-21 10:49 编辑
司有多个分部,且机房没有专业值班,机房等级不够。在这种情况下,又想实时监控机房环境,于是使用IPMI方式来达到目的。由于之前已经部署了Zabbix监控系统,本次将结合Zabbix自带的IPMI,完成服务器温度及风扇转速等的监控。
1.环境说明
被监控端服务器型号:Dell PowerEdge R510
规划分配的IPMI地址: 10.103.1.100
2.Zabbix监控平台说明
Zabbix版本: 3.2.1,在安装时,未使用--with-openipmi
Zabbix网络接口可以连通10.103.1.100
3.前置学习
维基百科IPMI: http://zh.wikipedia.org/wiki/IPMI
IBM DeveloperWorks -- 使用ipmitool实现Linux系统下对服务器的ipmi管理:http://www.ibm.com/developerworks/cn/linux/l-ipmi/
Dell -- Managing Dell PowerEdge Servers Using IPMItool:http://www.dell.com/downloads/gl ... 20040204-Murphy.pdf
Zabbix IPMI checks:https://www.zabbix.com/documenta ... tems/itemtypes/ipmi
使用IPMITOOL实现终端重定向(课外读物):http://docs.linuxtone.org/ebooks/Dell/ipmitool.pdf
4.配置IPMI
4.1.配置IPMI地址
可以参考前置推荐中的《Managing Dell PowerEdge Servers Using IPMItool》在服务器启动时进行IPMI地址的配置,并开启IPMI Over LAN。
也可以使用Dell的iDRAC开启IPMI功能,具体可以查看文章最后的参考资料。
2.jpg (54.84 KB, 下载次数: 5)
2016-11-21 10:48 上传
4.2.获取传感器信息
登录Zabbix服务器,通过ipmitool远程访问Dell服务器传感器信息
# ipmitool -I lan -H 10.103.1.100 -U root -P calvin -L user sensor list
# ipmitool -I lan -H 10.103.1.100 -U root -P calvin -L user sensor get "FAN MOD 1B RPM"
2.jpg (10.04 KB, 下载次数: 5)
2016-11-21 10:48 上传
2.jpg (20.96 KB, 下载次数: 5)
2016-11-21 10:48 上传
4.3.安装IPMItool软件包
# yum -y install OpenIPMI OpenIPMI-devel ipmitool freeipmi
4.4.配置Zabbix
注:为了支持IPMI,需要在zabbix server/proxy安装时增加--with-openipmi参数
服务器端配置zabbix IPMI pollers
zabbix_server.conf/zabbix_proxy.conf
# sed -i '/# StartIPMIPollers=0/aStartIPMIPollers=5' zabbix_server.conf
# service zabbix-server restart
4.5.导入监控模板
下面提供DELL的2个型号的IPMI模板:
template-ipmi-dell-poweredge-r510
template-ipmi-dell-poweredge-2950
添加监控主机,关联上本模板,并在IPMI页面,设置Authentication algorithm为Default,Privilege level为User, Username为sensor, Password为sensor_pass,保存即可。
使用此种方法获取数据的结果就是效率很差,基本没什么数据。
5.使用Zabbix External checks自定义IPMI
本来是选择nagios的IPMI插件:check_ipmi_sensor,文件是:check_ipmi_sensor_v3-v3.9.tar.gz
具体使用方法详见:http://www.thomas-krenn.com/en/wiki/IPMI_Sensor_Monitoring_Plugin
5.1.安装perl-IPC-Run模块
yum -y install perl-IPC-Run perl-Getopt-Long
5.2.使用check_ipmi_sensor查看效果
但是发现报错。
# ./check_ipmi_sensor -f ipmi.cfg -H 10.103.1.100 -vvv
------------- debug output for sel (-vvv is set): ------------
/usr/sbin/ipmi-sel was executed with the following parameters:
/usr/sbin/ipmi-sel -h 10.103.1.100 --config-file ipmi.cfg --driver-type=LAN_2_0 --output-event-state --interpret-oem-data --entity-sensor-names
output of FreeIPMI:
ID | Date | Time | Name | Type | State | Event
1 | Apr-08-2011 | 06:42:13 | System Board SEL | Event Logging Disabled | Nominal | Log Area Reset/Cleared
2 | Jan-01-1970 | 08:00:31 | System Board Intrusion | Physical Security | Critical | General Chassis Intrusion ; Intrusion while system Off
3 | Jan-01-1970 | 08:00:36 | System Board Intrusion | Physical Security | Critical | General Chassis Intrusion ; Intrusion while system Off
4 | Aug-15-2011 | 23:09:53 | Disk Drive Bay 1 Drive 2 | Drive Slot | Critical | Drive Fault ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
5 | Aug-16-2011 | 11:38:25 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
6 | Aug-16-2011 | 11:38:25 | Disk Drive Bay 1 Drive 2 | Drive Slot | Critical | Drive Fault ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
7 | Aug-16-2011 | 11:38:55 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
8 | Jun-10-2012 | 22:41:13 | System Board Ambient Temp | Temperature | Warning | Upper Non-critical - going high ; Sensor Reading = 45.00 C ; Threshold = 45.00 C
9 | Jun-11-2012 | 02:53:53 | System Board Ambient Temp | Temperature | Nominal | Upper Non-critical - going high ; Sensor Reading = 43.00 C ; Threshold = 45.00 C
10 | Nov-05-2012 | 21:56:42 | Disk Drive Bay 1 Drive 2 | Drive Slot | Critical | Drive Fault ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
11 | Nov-14-2012 | 21:53:58 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
12 | Nov-14-2012 | 21:53:58 | Disk Drive Bay 1 Drive 2 | Drive Slot | Critical | Drive Fault ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
13 | Nov-14-2012 | 21:54:19 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
14 | Nov-15-2012 | 16:12:03 | Disk Drive Bay 1 Drive 2 | Drive Slot | Critical | Drive Fault ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
15 | Nov-17-2012 | 17:14:34 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
16 | Nov-17-2012 | 17:14:34 | Disk Drive Bay 1 Drive 2 | Drive Slot | Critical | Drive Fault ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
17 | Nov-17-2012 | 17:15:40 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
18 | Nov-19-2012 | 20:47:57 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
19 | Nov-19-2012 | 20:50:04 | Disk Drive Bay 1 Drive 2 | Drive Slot | Nominal | Drive Presence ; OEM Event Data2 code = 01h ; OEM Event Data3 code = 02h
20 | Jan-01-1970 | 08:00:33 |