通过zabbix和ipmi来监控dell服务器

本文介绍如何通过Zabbix监控Dell PowerEdge服务器的BMC,利用IPMI进行无代理监控。详细步骤包括:启用Dell BMC的IPMI,安装IPMItools,创建Perl脚本解析数据,并将其整合到Zabbix中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://www.zabbix.com/wiki/doku.php?id=howto:dellipmi

 

IPMI on Dell Servers

The following article outlines how to use Zabbix to monitor the information from Dell PowerEdge Servers without an agent, using the Dell BMC via IP. I’ve done with with PowerEdge 1850, 1950, 2850, 2950 servers, some with DRAC4 cards at the The Frontier School Division . Questions/problems with the article? Email me at asingl@frontiersd.mb.ca.

Enabling IPMI on Dell BMC

IPMI on the BMC is not enabled over IP by default on Dell PE servers. You can enable IPMI over IP in the BIOS, or via a DRAC5 controller if you have it installed. Carlos' Corner blog with screenshots of IPMI IP setup on a DRAC5 card

Steps to Enable IPMI over IP

  • At boot, press Ctrl+E when the BMC is initializing.
  • Enable IPMI over LAN
  • NIC Selection (You may see this based on what server you have. If you have a DRAC, set this to dedicated, and it will use the DRAC NIC)
  • LAN Parameters - Set a static IP.
  • LAN user configuration - Create a user & password for access via the LAN

Note: You do not get a ping reply from the BMC over IP. You will need to use IPMItool (See below) to query the BMC.

Install IPMItools on Zabbix server

You’ll need to install ipmitool, which is in the OpenIPMI-tools package. On CentOS, you can use:

 yum install OpenIPMI-tools

to install, auto launch, and start the service. (You may only need OpenIPMI-tools) On other distro’s, you’ll need to find the OpenIPMI-tools package & install it.

Use the following command to query the remote BMC:

/usr/bin/ipmitool -H BMC_REMOTE_IP -U username -P password -I lan -L USER sdr

BMC_REMOTE_IP=IP address assigned to the BMC.

username/password=Username/password assigned on the BMC.

sdr=reports on various hardware sensors. Other options are sel for system event log, and fru for hardware information.

Perl Script to Parse Data

Now the question is how to take this data, and bring it into Zabbix. Here’s a sample of a portion of the ipmitool sdr readout:

Temp             | 30 degrees C      | ok
Temp             | disabled          | ns
Ambient Temp     | 19 degrees C      | ok
Planar Temp      | 30 degrees C      | ok
Riser Temp       | 29 degrees C      | ok
Temp             | disabled          | ns
Temp             | disabled          | ns
CMOS Battery     | 3.11 Volts        | ok
FAN 1A RPM       | 7350 RPM          | ok
FAN 1B RPM       | 5025 RPM          | ok
FAN 2A RPM       | 7500 RPM          | ok
FAN 2B RPM       | 5025 RPM          | ok
FAN 3A RPM       | 7425 RPM          | ok
FAN 3B RPM       | 5175 RPM          | ok
FAN 4A RPM       | 7725 RPM          | ok
FAN 4B RPM       | 5175 RPM          | ok

Cron Data Dump

This is only a small portion of what reads out. Data readout from the BMC is also quite slow. I believe it’s using a 2400 baud serial connection that shifts to IP. This becomes a problem for bringing into Zabbix, as the Zabbix agent will time out on a script that reads directly from the BMC.

To solve this, we’ll create a cron job that pulls the data, & puts it into a text file every 3 minutes. edit /etc/crontab & add the following line:

*/3 * * * * root /etc/zabbix/ipmidump.sh

This will run the script at /etc/zabbix/ipmidump.sh as root every 3 minutes. Here’s an example of my ipmidump.sh script:

#!/bin/bash

/usr/bin/ipmitool -H server1_IP -U username -P password -I lan -L USER sdr>/etc/zabbix/server1.dump.$
cp /etc/zabbix/server1.dump.$ /etc/zabbix/server1.dump
/usr/bin/ipmitool -H server2_IP -U username -P password -I lan -L USER sdr>/etc/zabbix/server2.dump.$
cp /etc/zabbix/server2.dump.$ /etc/zabbix/server2.dump

The script runs the IMPItool dump & places it into a temporary text file, and then copies that file to it’s permanent location. Repeat as needed for the number of servers you want to use IPMI for.

Parsing Data from the dump Now we need a script that we can use with the Zabbix agent that will pull the data we want out of the dump. Parse data from IPMI SDR Readout script (Credit to Rick Wagner for providing the Perl script. wagner.234@gmail.com)

#!/usr/bin/perl

# Script provided for Zabbix community by Rick Wagner (wagner.234@gmail.com)

 
 
use
 strict;
use
 warnings;
 
die

 usage(
)
Zabbix 是一个企业级分布式开源监控解决方案。  Zabbix 软件能够监控众多网络参数服务器的健康度、完整性。Zabbix 使用灵活的告警机制,允许用户为几乎任何事件配置基于邮件的告警。这样用户可以快速响应服务器问题。Zabbix 基于存储的数据提供出色的报表数据可视化功能。  Zabbix 支持主动轮询(polling)被动捕获(trapping)。Zabbix所有的报表、统计数据配置参数都可以通过基于 Web 的前端页面进行访问。基于 Web 的前端页面确保您可以在任何地方访问您监控的网络状态服务器健康状况。适当的配置后,Zabbix 可以在监控 IT 基础设施方面发挥重要作用。无论是对于有少量服务器的小型组织,还是拥有大量服务器的大企业而言,同样适用。  Zabbix 是免费的。Zabbix 是根据 GPL 通用公共许可证的第二版编写发布的。这意味着产品源代码是免费发布的,可供公共使用。 本课程主要讲解以下方面: 1.  网络设备的监控,如 Dell R420、Juniper ssg5等。2.  Linux Windows 服务器监控。3.  应用服务的监控,如 httpd、nginx等。4.  Zabbix 代理的配置与使用以及 Zabbix 的多种告警方式。 注意:该课程,需要有一定的 zabbix Linux 基础,建议您先把>>看完,再看此套课程,这个是在它的基础上进行讲解的。                                                                   
### Zabbix、SNMP IPMI 监控机制对比 #### Zabbix 原生监控 (ZBX) Zabbix 使用自己的协议来收集数据,这种方式称为原生监控(ZBX)[^1]。通过安装 Zabbix Agent 到目标设备上,Agent 定期向 Zabbix Server 发送性能指标其他信息。此方法允许自定义脚本执行以及对操作系统级别的深入监测。 对于 Linux 或 Windows 主机而言,这是最常用的方法之一;它提供了高度灵活性支持广泛的功能集,包括但不限于文件日志读取、网络接口统计等特性[^2]。 #### 简单网络管理协议 (SNMP) SNMP 是一种标准的互联网协议,用于管理监视连接在网络上的各种设备的状态性能参数。当采用 SNMP 进行监控时,在被管对象(如路由器、交换机或其他支持该功能的服务端口)需预先配置好相应的访问权限,并指定一个或多个管理者社区字符串以便于身份验证过程完成之后可以正常通信交流。 一旦上述准备工作就绪,则可以在 Zabbix Web UI 上添加新主机并将它们关联至特定版本下的 MIB 文件库——即包含OIDs 的数据库结构化集合体,从而实现自动发现服务实例并获取所需测量值的目的[^3]。 ```bash snmpwalk -v 2c -c public 192.168.1.1 .1.3.6.1.4.1.674.10892.1 ``` 以上命令展示了如何利用 `snmpwalk` 工具查询 Dell EMC PowerEdge R630 服务器的部分传感器数值作为例子说明了这一点。 #### 智能平台管理接口 (IPMI) IPMI 提供了一种独立于 CPU、BIOS 或操作系统之外的方式来进行远程硬件状态检测与控制操作。这意味着即使是在系统崩溃的情况下也能继续工作而不受影响。为了使这项技术发挥作用,通常需要确保 BMC(Baseboard Management Controller) 被正确初始化并且能够响应来自外部源发出的消息请求。 在实际应用当中,可以通过修改 Zabbix server 配置文件中的 `StartIPMIPollers` 参数来增加并发处理能力以适应更大规模部署环境的需求: ```bash sed -i '145 aStartIPMIPollers=5' /etc/zabbix/zabbix_server.conf ``` 此外,值得注意的是,虽然理论上最大可设定为1000个线程数,但在实践中应当依据具体场景合理规划资源分配以免造成不必要的浪费或者潜在风险[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值