山特UPS电量信息采集环境配置

山特UPS电量信息采集环境配置

硬件需求

  • 支持智能卡插口的山特UPS
  • 山特NMC网络管理卡

安装与配置NMC卡

NMC 是一种介于UPS和网络的设备,它可以从UPS获得状态信息并且发出指令。NMC支持两种协议-简易网络管理协议(SNMP)和超文件传输协议(HTTP)以供使用者进入。通过SNMP的网络管理站(NMS)和网页浏览器,用户可以获得UPS的状态信息、发出指令至UPS并且通过网络设定NMC。下图为NMC卡:
在这里插入图片描述

安装配置参考官方文档:

NMC卡使用手册

其中,主要是配置好NMC卡的网络(将NMC卡加入到当前局域网)

UPS电量信息采集

NMC支持通过SNMP协议获取UPS状态信息,所以我们通过SNMP协议采集UPS的电量信息。

NMC MIB文件下载地址:https://santakblobstorage.blob.core.chinacloudapi.cn/picture/MIB.zip,其中RFC1628.MIB为各UPS的通用MIB文件。

根据RFC1628.MIB,查找到电池信息相关的oid如下:

名称oid描述
upsBatteryStatus.1.3.6.1.2.1.33.1.2.1.0The indication of the capacity remaining in the UPS system’s batteries. A value of batteryNormal indicates that the remaining run-time is greater than upsConfigLowBattTime. A value of batteryLow indicates that the remaining battery run-time is less than or equal to upsConfigLowBattTime. A value of batteryDepleted indicates that the UPS will be unable to sustain the present load when and if the utility power is lost (including the possibility that the utility power is mandatoryly absent and the UPS is unable to sustain the output).
upsSecondsOnBattery.1.3.6.1.2.1.33.1.2.2.0If the unit is on battery power, the elapsed time since the UPS last switched to battery power, or the time since the network management subsystem was last restarted, whichever is less. Zero shall be returned if the unit is not on battery power.
upsEstimatedMinutesRemaining.1.3.6.1.2.1.33.1.2.3.0An estimate of the time to battery charge depletion under the present load conditions if the utility power is off and remains off, or if it were to be lost and remain off.
upsEstimatedChargeRemaining.1.3.6.1.2.1.33.1.2.4.0An estimate of the battery charge remaining expressed as a percent of full charge.
upsBatteryVoltage.1.3.6.1.2.1.33.1.2.5.0The magnitude of the present battery voltage.
upsBatterymandatory.1.3.6.1.2.1.33.1.2.6.0The present battery mandatory.
upsBatteryTemperature.1.3.6.1.2.1.33.1.2.7.0The ambient temperature at or near the UPS Battery casing.

通过snmpwalk命令(需要安装net-snmp软件)获取UPS剩余电量信息:

# snmpwalk -v 1 -c private 172.16.51.233 .1.3.6.1.2.1.33.1.2.4.0

返回电量为100%:
SNMPv2-SMI::mib-2.33.1.2.4.0 = INTEGER: 100

其它

当前只测试了山特的UPS,其它品牌的UPS的电量信息采集方式应该类似

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值