mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-09 02:16:50 +00:00
Add config flow to System Monitor (#30115)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
6db58892db
commit
fb6a973894
@ -6,78 +6,59 @@ ha_category:
|
|||||||
ha_release: pre 0.7
|
ha_release: pre 0.7
|
||||||
ha_iot_class: Local Push
|
ha_iot_class: Local Push
|
||||||
ha_domain: systemmonitor
|
ha_domain: systemmonitor
|
||||||
|
ha_config_flow: true
|
||||||
ha_platforms:
|
ha_platforms:
|
||||||
- sensor
|
- sensor
|
||||||
ha_integration_type: integration
|
ha_integration_type: integration
|
||||||
---
|
---
|
||||||
|
|
||||||
The `systemmonitor` sensor platform allows you to monitor disk usage,
|
The System monitor integration allows you to monitor disk usage,
|
||||||
memory usage, CPU usage, and running processes.
|
memory usage, CPU usage, and running processes.
|
||||||
|
|
||||||
To add this platform to your installation,
|
{% include integrations/config_flow.md %}
|
||||||
add the following to your `configuration.yaml` file:
|
|
||||||
|
|
||||||
```yaml
|
## Sensors
|
||||||
# Example configuration.yaml entry
|
|
||||||
sensor:
|
|
||||||
- platform: systemmonitor
|
|
||||||
resources:
|
|
||||||
- type: disk_use_percent
|
|
||||||
arg: /config
|
|
||||||
- type: memory_free
|
|
||||||
```
|
|
||||||
|
|
||||||
{% configuration %}
|
**All entities are disabled by default, you need to enable the entities that you wish to use.**
|
||||||
resources:
|
|
||||||
description: Contains all entries to display.
|
|
||||||
required: true
|
|
||||||
type: list
|
|
||||||
keys:
|
|
||||||
type:
|
|
||||||
description: The type of the information to display, please check the table below for details.
|
|
||||||
required: true
|
|
||||||
arg:
|
|
||||||
description: Argument to use, please check the table below for details.
|
|
||||||
required: false
|
|
||||||
{% endconfiguration %}
|
|
||||||
|
|
||||||
After restarting Home Assistant, these sensors will show up and update their
|
### Disks
|
||||||
information every 15 seconds.
|
|
||||||
|
|
||||||
The table contains types and their argument to use in your `configuration.yaml`
|
- Disk free - (One per disk/mount point)
|
||||||
file.
|
- Disk use - (One per disk/mount point)
|
||||||
|
- Disk use (percent) - (One per disk/mount point)
|
||||||
|
|
||||||
| Type (`type:`) | Argument (`arg:`) | Argument mandatory |
|
### Network
|
||||||
| :--------------------- |:--------------------------|:--------------------------|
|
|
||||||
| disk_use_percent | Path, e.g., `/` | no |
|
- IPv4 address - (One per network interface)
|
||||||
| disk_use | Path, e.g., `/` | no |
|
- IPv6 address - (One per network interface)
|
||||||
| disk_free | Path, e.g., `/` | no |
|
- Network in - (One per network interface)
|
||||||
| memory_use_percent | | |
|
- Network out - (One per network interface)
|
||||||
| memory_use | | |
|
- Packets in - (One per network interface)
|
||||||
| memory_free | | |
|
- Packets out - (One per network interface)
|
||||||
| swap_use_percent | | |
|
- Network throughput in - (One per network interface)
|
||||||
| swap_use | | |
|
- Network throughput out - (One per network interface)
|
||||||
| swap_free | | |
|
|
||||||
| load_1m | | |
|
### Other
|
||||||
| load_5m | | |
|
|
||||||
| load_15m | | |
|
- Last boot
|
||||||
| network_in | Interface, e.g., `eth0` | yes |
|
- Load (15m)
|
||||||
| network_out | Interface, e.g., `eth0` | yes |
|
- Load (5m)
|
||||||
| throughput_network_in | Interface, e.g., `eth0` | yes |
|
- Load (1m)
|
||||||
| throughput_network_out | Interface, e.g., `eth0` | yes |
|
- Memory free
|
||||||
| packets_in | Interface, e.g., `eth0` | yes |
|
- Memory use
|
||||||
| packets_out | Interface, e.g., `eth0` | yes |
|
- Memory use (percent)
|
||||||
| ipv4_address | Interface, e.g., `eth0` | yes |
|
- Processor use
|
||||||
| ipv6_address | Interface, e.g., `eth0` | yes |
|
- Processor temperature
|
||||||
| processor_use | | |
|
- Swap free
|
||||||
| processor_temperature | | |
|
- Swap use
|
||||||
| process | Binary, e.g., `octave-cli` | yes |
|
- Swap use (percent)
|
||||||
| last_boot | | |
|
|
||||||
|
### Add `process` sensor
|
||||||
|
|
||||||
|
The `process` sensor needs to be configured by the config entry options. Go to **{% my integrations title="Settings > Devices & Services" %}**, select the **System Monitor** integration and click **Configure** to select which `process` sensors should be created.
|
||||||
|
|
||||||
## Disk usage
|
## Disk usage
|
||||||
|
|
||||||
If no path is provided via the optional argument, the integration defaults to '/' (root).
|
|
||||||
|
|
||||||
**Note:** The disk usage sensors do not support monitoring folder/directory sizes. Instead, it is only concerned with "disks" (more specifically mount points on Linux).
|
**Note:** The disk usage sensors do not support monitoring folder/directory sizes. Instead, it is only concerned with "disks" (more specifically mount points on Linux).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -89,100 +70,8 @@ tmpfs 934M 0 934M 0% /dev/shm
|
|||||||
/dev/mmcblk0p1 253M 54M 199M 22% /boot
|
/dev/mmcblk0p1 253M 54M 199M 22% /boot
|
||||||
```
|
```
|
||||||
|
|
||||||
Defining a `disk_use` sensor for `/` and `/home/pi` is redundant and will return the same values, since they both belong to the same "disk". However, defining separate sensors for `/dev` and `/dev/shm` is possible and provides different values, since those are treated as separate "disks" by the integration.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# Example configuration.yaml entry
|
|
||||||
sensor:
|
|
||||||
- platform: systemmonitor
|
|
||||||
resources:
|
|
||||||
- type: disk_use
|
|
||||||
arg: /dev
|
|
||||||
- type: disk_use
|
|
||||||
arg: /dev/shm
|
|
||||||
```
|
|
||||||
|
|
||||||
## Processor temperature
|
## Processor temperature
|
||||||
|
|
||||||
- If no hardware sensor data is available (e.g., because the integration runs in a virtualized environment), the sensor entity will not be created.
|
- If no hardware sensor data is available (e.g., because the integration runs in a virtualized environment), the sensor entity will not be created.
|
||||||
- The unit of measurement (Celsius vs. Fahrenheit) will be chosen based on the system configuration.
|
- The unit of measurement (Celsius vs. Fahrenheit) will be chosen based on the system configuration.
|
||||||
- Only the very first processor related hardware sensor is read, i.e., no individual core temperatures (even if the hardware sensor could provide that level of detail).
|
- Only the very first processor related hardware sensor is read, i.e., no individual core temperatures (even if the hardware sensor could provide that level of detail).
|
||||||
|
|
||||||
## Linux specific
|
|
||||||
|
|
||||||
To retrieve all available network interfaces on a Linux System, execute the
|
|
||||||
`ifconfig` or `ip` command. The command differs based on your operation system and version.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ifconfig -a | sed 's/[ \t].*//;/^$/d'
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ip link show
|
|
||||||
```
|
|
||||||
|
|
||||||
## Windows specific
|
|
||||||
|
|
||||||
When running this platform on Microsoft Windows, Typically,
|
|
||||||
the default interface would be called `Local Area Connection`,
|
|
||||||
so your configuration might look like:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
sensor:
|
|
||||||
- platform: systemmonitor
|
|
||||||
resources:
|
|
||||||
- type: network_in
|
|
||||||
arg: "Local Area Connection"
|
|
||||||
```
|
|
||||||
|
|
||||||
If you need to use some other interface, open a command line prompt and type `ipconfig` to list all interface names. For example a wireless connection output from `ipconfig` might look like:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
Wireless LAN adapter Wireless Network Connection:
|
|
||||||
|
|
||||||
Media State . . . . . . . . . . . : Media disconnected
|
|
||||||
Connection-specific DNS Suffix . :
|
|
||||||
```
|
|
||||||
|
|
||||||
Where the name is `Wireless Network Connection`.
|
|
||||||
|
|
||||||
## All available resources
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# Example configuration.yaml entry with all entry types (delete/comment out as necessary)
|
|
||||||
sensor:
|
|
||||||
- platform: systemmonitor
|
|
||||||
resources:
|
|
||||||
- type: disk_use_percent
|
|
||||||
arg: /config
|
|
||||||
- type: disk_use
|
|
||||||
- type: disk_free
|
|
||||||
- type: memory_use_percent
|
|
||||||
- type: memory_use
|
|
||||||
- type: memory_free
|
|
||||||
- type: swap_use_percent
|
|
||||||
- type: swap_use
|
|
||||||
- type: swap_free
|
|
||||||
- type: load_1m
|
|
||||||
- type: load_5m
|
|
||||||
- type: load_15m
|
|
||||||
- type: network_in
|
|
||||||
arg: eth0
|
|
||||||
- type: network_out
|
|
||||||
arg: eth0
|
|
||||||
- type: throughput_network_in
|
|
||||||
arg: eth0
|
|
||||||
- type: throughput_network_out
|
|
||||||
arg: eth0
|
|
||||||
- type: packets_in
|
|
||||||
arg: eth0
|
|
||||||
- type: packets_out
|
|
||||||
arg: eth0
|
|
||||||
- type: ipv4_address
|
|
||||||
arg: eth0
|
|
||||||
- type: ipv6_address
|
|
||||||
arg: eth0
|
|
||||||
- type: processor_use
|
|
||||||
- type: processor_temperature
|
|
||||||
- type: last_boot
|
|
||||||
```
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user