System Monitoring - How does yours look?

hi,
what do you use for online/offline monitoring?
thanks

If you don’t mind sharing, how are you calculating startup duration?

If you refering to the devices, I just ping them.

1 Like

As I use docker I have a entrypoint script which writes a timestamp at container start.
I then use the home assistant startup event and calculate the time difference.

thanks! how do you count number of sensors, switches, etc?

There’s also this:

1 Like

thank you! :slight_smile:

Is anyone monitoring backup, sync or parity status? Eg. Duplicati? Syncthing? Snapraid?

Nice work on the lovelace configurations. I like the graphs and stuff. Can you share your lovelace.yaml file on how you did some of those? Curious on the Plex histogram and how you did that setup.

Some very nice work and layouts here, great inspiration!

image

2 Likes

Sure, here is the Plex card, I’m simply using the Plex sensors through the Plex component. Displayed using the amazing mini graph from @kalkih

cards:
  - accuracy: 5
    align_icon: left
    entities:
      - color_thresholds:
          - color: '#64f211'
            value: 1
          - color: '#f1f111'
            value: 2
          - color: '#c0392b'
            value: 3
          - color: '#f09b11'
            value: 4
          - color: '#ef5710'
            value: 5
          - color: '#ef0f0f'
            value: 6
          - conditions:
              - entity: sensor.plex_watching
                state_not: '0'
            extrema: true
            icon: false
            points: false
            type: conditional
        entity: sensor.plex_watching
        name: Plex users
        show: null
        show_state: true
        unit: user/s
      - entity: sensor.plex_bandwidth
        name: Plex badwidth
        show_state: true
        unit: Mbits/s
    hours_to_show: 168
    icon: 'mdi:plex'
    line_color: '#0073D4'
    name: Plex
    points_per_hour: 0.05
    show:
      points: false
    type: 'custom:mini-graph-card'
type: vertical-stack
2 Likes

What’s the code for your Upgrade HASS, Restart, Refresh? Thank you

Here you go:

cards:
  - entity: script.upgrade_system
    tap_action:
      action: call-service
      service: script.turn_on
      service_data:
        entity_id: script.upgrade_system
    type: entity-button
  - entity: script.restart_system
    tap_action:
      action: call-service
      service: script.turn_on
      service_data:
        entity_id: script.restart_system
    type: entity-button
  - entity: input_boolean.refresh_counts
    tap_action:
      action: toggle
    type: entity-button
type: horizontal-stack

And the template sensors:

- platform: template
  sensors:
   #----- Count Automations
   count_automations:
     entity_id: input_boolean.refresh_counts
     value_template: "{{ states.automation | list | length }}"
   #----- Count Scripts
   count_scripts:
     entity_id: input_boolean.refresh_counts
     value_template: "{{ states.script | list | length }}"
   #----- Count Zwave
   count_zwave:
     entity_id: input_boolean.refresh_counts
     value_template: "{{ states.zwave | list | length }}"       
   #----- Count Lights
   count_lights:
     entity_id: input_boolean.refresh_counts
     value_template: "{{ states.light | list | length }}"
   #----- Count Sensors
   count_sensors:
     entity_id: input_boolean.refresh_counts
     value_template: "{{ states.sensor | list | length }}"
   #----- Count Switches
   count_switches:
     entity_id: input_boolean.refresh_counts
     value_template: "{{ states.switch | list | length }}"
   #----- Count Fans
   count_fans:
     entity_id: input_boolean.refresh_counts
     value_template: "{{ states.fan | list | length }}"

Thanks raschoc for posting that.

how do you do a switch to toggle docker container?
how do you get which docker container are running?

thx

I think I get my count of docker containers from glances, but I’ll check when I get home
edit yes, running glances on my docker machine, using that as a sensor which is displayed on the monitoring page

Can you share you lovelace.yaml on your system monitor page? Love the way yours likes on some parts.

Can you share this page of your lovelace? I love some of the ways you did your histograms and stuff.

Here’s away via bash to get your docker info, you’ll need to install the jq package for your distro

It returns JSON formatted data:

#!/bin/bash

hostname="$(hostname -s)"

running=`docker ps --format '{{.Names}}' | jq -sR '[sub("\n$";"") | splits("\n")]'`
all="$(docker ps -a --format '{{.Names}}' | jq -sR '[sub("\n$";"") | splits("\n")]')"

count="$(docker ps | wc -l)"
total="$(docker ps -a | wc -l)"

printf '{"hostname":"%s","data":{"total":"%s","active":"%s","running":%s,"containers":%s} }\n' "$hostname" "$total" "$count" "$running" "$all"

3 Likes