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

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

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值