renren2@lenovo.com    2019/8

前提:保证所有设备内网可达。

 

1 ,安装一台Linux虚拟机(ECOM服务器),此处用centos6.9,关闭selinux和iptables,重启生效

2,安装SMI-S provider,到EMC官网下载 se76267-Linux-i386-SMI.tar.gz

     解压

     #./sexxxx_install.sh -install 安装,默认安装即可

     执行 #/opt/emc/ECIM/ECOM/bin/ECOM -d 启动服务

     执行 # /opt/emc/ECIM/ECOM/bin/TestSmiProvider 登陆ECOM,均用默认选项

     默认用户名 admin,密码#1Password

     添加需要监控的对象存储,如下图过程,出现最后提示表示成功:

    

zabbix 使用 SMI-S provider 中间件监控VNX 5400_zabbix

如果提示认证失败,可以使用/opt/emc/SYMCLI/bin/下的symcfg工具添加账户认证

zabbix 使用 SMI-S provider 中间件监控VNX 5400_EMC_02

 

3,在ECOM服务器上安装naviseccli,可以使用naviseccli -h x.x.x.x -user sysadmin -password sysadmin -scope 0 getagent获取VNX的SN号,确保ECOM可以正常访问存储的管理功能。

zabbix 使用 SMI-S provider 中间件监控VNX 5400_SMI-S_03

4,  为了使 Provider 能够读取到存储的性能数据,需要在存储 Unisphere 上开启“Statistics

Logging ”功能。

zabbix 使用 SMI-S provider 中间件监控VNX 5400_zabbix_04

 

5,打开zabbix 模板地址https://github.com/ktelep/EMC-Zabbix-Integration

     

下载里面的文件,

zabbix 使用 SMI-S provider 中间件监控VNX 5400_SMI-S_05


基本上根据readme 指南步骤操作。下面做一些解释:

 

Installation

Prerequisites

1.      Confirm that block statistics collection is enabled on your array: https://community.emc.com/docs/DOC-24564     # 即Statistics

Logging 功能,上面已经打开

2.      EMC ECOM Server is installed with Storage arrays registered (make sure it's been running for a few hours to build out the object model and collect some stats)。Be sure you read the Installation documentation for the ECOM to confirm you have all of the necessary 32 and 64 bit libraries installed for your OS. #上面已安装完成

3.      Python module: pywbem, argparse(If Python < 2.7) 

       #python是安装在zabbix server服务器,可以用yum安装,默认为2.6,另需要手动安装pywbem, argparse两个模块,可以用yum安装,具体安装方法可以百度

A script in the tools subdir can be used to easily add the array to the ECOM server if you are unfamiliar with the ECOM tools

 #上面手工添加存储到ECOM服务器的方法可以用Ecom_VNX_Manage.py来做,直接在ECOM服务器上执行次脚本,输入必要信息

 

Installation

4.      Place the two python scripts included here in the external scripts directory for your zabbix server, be sure they are owned by, and executable by the zabbix user.

      #把discovery和stats两个py文件拷入zabbix服务器的外部脚本目录,这个外部脚本目录地址可以在zabbix_server.conf文件中找到路径。

      比如  /usr/local/zabbix/share/zabbix/externalscripts

5.      Edit the emc_vnx_stats.py script, confirming that the path to the zabbix_sender command is correct along with the path to the agentd configuration file.

#把脚本里面关于zabbix_sender和zabbix_agentd.conf的路径改成zabbix server上实际的路径。

  比如 zabbix 使用 SMI-S provider 中间件监控VNX 5400_zabbix_06 zabbix 使用 SMI-S provider 中间件监控VNX 5400_SMI-S_07

6.      Confirm that the script Timeout value is set to 30 seconds in the zabbix_server.conf file.

#改个脚本超时时间为30秒,默认太短了

 

接下来可以用命令行执行脚本文件测试能否通过此架构获取存储的相关信息(注意此时使用的账户是root还是zabbix,因为zabbix_server不是用的root权限):

zabbix 使用 SMI-S provider 中间件监控VNX 5400_SMI-S_08

 

7.      Create a new host in Zabbix, with a hostname of the ARRAY SERIAL, the visible hostname may be whatever you like.

#用VNX的SN号创建一个zabbix的host (注意host name必须为SN号,visible name 可以自定义为易识别的 )

zabbix 使用 SMI-S provider 中间件监控VNX 5400_EMC_09

8.      Create a host macro {$ECOMIP} with a value of the IP address of the ECOM server.

9.      Create host macros: {$ECOMUSER}, {$ECOMPASS} with the ECOM username and password.

#上面两步是创建宏变量,zabbix需要利用上面的变量作为执行脚本的参数

zabbix 使用 SMI-S provider 中间件监控VNX 5400_zabbix_10

 

10.   Update the Host inventory, setting it to manual to include the array serial number  #手工创建Host 资产信息

11.   Import the template and link to the newly added host  #导入下载的模板并关联到这个host,模板名 —— Template EMC VNX

12.   Patiently wait for the discovery and first sync to run

 

请注意将/tmp下的所有有关的.tmp文件和.log文件赋予zabbix对应账户的读写修改权限,否则zabbix将无法执行脚本。主监控项产生如下报错:

zabbix 使用 SMI-S provider 中间件监控VNX 5400_EMC_11

 

正常应为如下记录:

 zabbix 使用 SMI-S provider 中间件监控VNX 5400_SMI-S_12


最后等待几分钟后,查看所对应监控项latest data和graph都有数据了:

 

zabbix 使用 SMI-S provider 中间件监控VNX 5400_zabbix_13

 

模板监控项内容很丰富,当前配置下约能达到600多项

 

Troubleshooting

l  Discovery Issues

n  Check the /tmp/emc_vnx_discovery.log file for any exceptions.

n  Check that you can run the scripts from the command line AS THE ZABBIX USER successfully, if you can run them from the command line but not from within Zabbix, you may want to confirm the host macros and host name have been properly configured.

l  Stats Collection Issues

n  Each group of statisics have a "Statistics Collection" key that runs the external emc_vnx_stats.py collection script, check the output for exceptions or problems

n  If you see the error "ERROR_FAMILY_OPERATION_NOT_AVAILABLE Statistics Service is not enabled for array" Be sure that you have Block Statistics data collection enabled (See https://community.emc.com/docs/DOC-24564)

#如果有不成功,请先参照上面步骤排查。