mysmarthome/packages/esxi.yaml

57 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2019-04-17 22:46:06 +00:00
homeassistant:
sensor:
- platform: snmp
2019-12-20 15:32:28 +00:00
name: "ESXi Server Description"
2019-04-17 22:46:06 +00:00
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.1.1.0
accept_errors: true
- platform: snmp
2019-12-20 15:32:28 +00:00
name: "ESXi Total RAM"
2019-04-17 22:46:06 +00:00
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.2.3.1.5.6
accept_errors: true
- platform: snmp
2019-12-20 15:32:28 +00:00
name: "ESXi Used RAM"
2019-04-17 22:46:06 +00:00
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.2.3.1.6.6
accept_errors: true
- platform: snmp
2019-12-20 15:32:28 +00:00
name: "ESXi System Uptime Epoch"
2019-04-17 22:46:06 +00:00
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.1.1.0
accept_errors: true
- platform: snmp
2019-12-20 15:32:28 +00:00
name: "ESXi Number of Network Interfaces"
2019-04-17 22:46:06 +00:00
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.2.1.0
accept_errors: true
- platform: snmp
2019-12-20 15:32:28 +00:00
name: "ESXi System Memory Size"
2019-04-17 22:46:06 +00:00
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.2.2.0
accept_errors: true
- platform: template
sensors:
esxi_memory_used:
2019-12-20 15:32:28 +00:00
friendly_name: "ESXi Memory Usage"
unit_of_measurement: "%"
value_template: "{{(states('sensor.esxi_used_ram') | float / states('sensor.esxi_total_ram') | float * 100) | round }}"
2019-04-17 22:46:06 +00:00
- platform: template
sensors:
esxi_system_uptime:
2019-12-20 15:32:28 +00:00
friendly_name: "ESXi System Uptime"
value_template: >
{% set time = states('sensor.esxi_system_uptime_epoch') | int %}
{% set minutes = ((time % 360000) / 6000) | int %}
{% set hours = ((time % 8640000) / 360000) | int %}
{% set days = (time / 8640000) | int %}
{{ days }} days, {{ hours }} hours {{ minutes }} minutes.