Skip to content

Commit 26b7403

Browse files
godlothfabaff
authored andcommitted
added example for command_line sensor (home-assistant#1429)
Added working example for this sensor that i've seen a lot on the community where a lot of those examples were obsolete and even experienced user were confused . The issue came from the update in the logger messages in the home-assistant.log file
1 parent a2eb315 commit 26b7403

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

source/_components/sensor.command_line.markdown

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,27 @@ Thanks to the [`proc`](https://en.wikipedia.org/wiki/Procfs) file system, variou
7070

7171
The `correction_factor` will make sure that the value is shown in a useful format in the frontend.
7272

73+
### {% Monitoring the failed login attempt on HA %}
74+
75+
If you want to get the fillowing in case you want to know if someone is hammering your server is open on the net
76+
77+
78+
```yaml
79+
# Example configuration.yaml entry
80+
sensor 6:
81+
platform: command_line
82+
name: badlogin
83+
command: grep -c 'Login attempt' /home/hass/.homeassistant/home-assistant.log
84+
```
85+
*Make sure to configure the logger to monitor the proper component at the proper level*
86+
87+
```yaml
88+
# Example working logger settings that works
89+
logger:
90+
default: critical
91+
logs:
92+
homeassistant.components.http: warning
93+
```
7394

7495
### {% linkable_title Details about the upstream Home Assistant release %}
7596

0 commit comments

Comments
 (0)