Files
Home-Assistant-Configs/packages/sysmon.yaml

71 lines
2.2 KiB
YAML

sensor:
- platform: command_line
name: Lines of Code
command: "find /config -name '*.yaml' | xargs cat | wc -l"
scan_interval: 20000
- platform: template
sensors:
min_ping:
friendly_name: "Min Ping"
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_min') }}"
availability_template: >-
{% if is_state('binary_sensor.internet','on') %}
true
{% else %}
false
{% endif %}
unit_of_measurement: "ms"
avg_ping:
friendly_name: "Avg Ping"
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_avg') }}"
availability_template: >-
{% if is_state('binary_sensor.internet','on') %}
true
{% else %}
false
{% endif %}
unit_of_measurement: "ms"
max_ping:
friendly_name: "Max Ping"
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_max') }}"
availability_template: >-
{% if is_state('binary_sensor.internet','on') %}
true
{% else %}
false
{% endif %}
unit_of_measurement: "ms"
- platform: sql
db_url: !secret mariadb_url
scan_interval: 3600
queries:
- name: MariaDB Database Size
query: 'SELECT table_schema "homeassistant", Round(Sum(data_length + index_length) / POWER(1024,2), 1) "value" FROM information_schema.tables WHERE table_schema="homeassistant" GROUP BY table_schema;'
column: "value"
unit_of_measurement: MB
- platform: influxdb
host: 192.168.1.26
port: 8086
username: homeassistant
password: !secret influxdb_pass
scan_interval: 3600
queries:
- name: InfluxDB Database Size
unit_of_measurement: MB
value_template: "{{ (value | float(0) / 1024 /1024) | round(1) }}"
group_function: sum
measurement: '"monitor"."shard"'
database: _internal
where: '"database"=''homeassistant'' AND time > now() - 5m'
field: diskBytes
binary_sensor:
- platform: ping
name: Internet
host: 8.8.8.8
scan_interval: 5