The Doctor Binding helps find issues with your system [5.0.0;5.9.9]

This binding is one I have been thinking of building for a while, it is designed to help diagnose issues on someones system that does not know Linux/Java and has no idea what free VS available ram means, let alone the Java heap. Install the binding and get a system check up. The system info binding requires you to know what to look at and how to interrupt the results, this binding will hopefully over time get better at finding issues in an automated way. If you have some ideas on what it can check for, then feel free to post.

If you enjoy the binding, please consider sponsoring or a once off tip as a thank you via the links. This allows me to purchase software and hardware to contributing more bindings. Also some coffee to keep me coding faster never hurts :slight_smile:

Sponsor @Skinah on GitHub Sponsors

Paypal can also be used via
matt A-T pcmus D-O-T C-O-M

Features

Binding already helps to warn in your logs when:

  • CPU overheats
  • Heap is wrongly sized
  • Heap is growing and not shrinking back when garbage collections are done. OOME Out of memory errors and memory leaks should get detected and picked up early.
  • Ram is full or getting close to 100% full to give you a warning something needs to be looked at.
  • Detects when Raspberry Pi power supply or cable is not good enough.
  • Allows you to graph the heap after it is first cleaned by the garbage collector.
    heap

Not yet implemented but planned to look into possible addition:

  • Raspberry Pi power supply is not good enough Added
  • Swap file is getting used a lot or runs out of space
  • Zram checks
  • Watch for continually growing number of Processes and Threads
  • Check addon jar files are all the same version as openHAB

Example log output in DEBUG

2024-03-16 06:04:40.650 [INFO ] [.thedoctor.internal.TheDoctorHandler] - Will include health checks for your:Raspberry Pi 3 Model B Plus Rev 1.3

2024-03-16 06:04:40.654 [DEBUG] [.thedoctor.internal.TheDoctorHandler] - GOOD: Pi is not reporting any current throttle conditions.

2024-03-16 06:04:40.708 [DEBUG] [.thedoctor.internal.TheDoctorHandler] - GOOD: Heap is only 24% full, and ranges from 0% to 24%

2024-03-16 06:04:40.710 [DEBUG] [.thedoctor.internal.TheDoctorHandler] - GOOD: RAM is 46% full

2024-03-16 06:04:40.733 [DEBUG] [.thedoctor.internal.TheDoctorHandler] - GOOD: CPU temperature is 52.078c
2024-03-16 06:05:56.668 [WARN ] [.thedoctor.internal.TheDoctorHandler] - BAD : Full Pi throttle code is 80008

2024-03-16 06:05:56.670 [WARN ] [.thedoctor.internal.TheDoctorHandler] - BAD : Pi, Soft temperature limit active

2024-03-16 06:05:56.671 [WARN ] [.thedoctor.internal.TheDoctorHandler] - BAD : Your Pi's power supply or cable was not good enough to supply power without an under-voltage event occuring.

2024-03-16 06:05:56.672 [DEBUG] [.thedoctor.internal.TheDoctorHandler] - GOOD: Heap is only 18% full, and ranges from 18% to 28%

2024-03-16 06:05:56.676 [DEBUG] [.thedoctor.internal.TheDoctorHandler] - GOOD: RAM is 67% full

2024-03-16 06:05:56.679 [WARN ] [.thedoctor.internal.TheDoctorHandler] - BAD : CPU temperature is 61.762c and may cause instability. Do you have a heatsink and fan?

2024-03-16 06:06:11.683 [WARN ] [.thedoctor.internal.TheDoctorHandler] - BAD : Full Pi throttle code is 80000

2024-03-16 06:06:11.684 [WARN ] [.thedoctor.internal.TheDoctorHandler] - BAD : Your Pi's power supply or cable was not good enough to supply power without an under-voltage event occuring.

Changelog

Version 0.3

  • Fixed bug in reading the raspberry Pi throttle codes.
  • Changes to logging to give less output.

Version 0.2

  • Added Raspberry Pi power supply and throttle code checks
  • Adjusted heap detection a little based on real world testing of new pi setup with defaults.

Version 0.1

  • initial release

Resources

https://pcmus.com/openhab/TheDoctorBinding/org.openhab.binding.thedoctor-5.1.0-SNAPSHOT.jar

Source Code

2 Likes

Very neat, thanks a lot!

Any chance you could tag the files with your release - so the download urls look something like this instead:

https://pcmus.com/openhab/TheDoctorBinding/org.openhab.binding.thedoctor-5.1.0-0.3.jar

I can but is there any benefit to doing that? Is there a documented way to have a single thread on the forum for V4 and V5 jar files to prevent needing to double up?

I can but is there any benefit to doing that?

There is to me! :wink: I use NixOS on the host and every artefact that gets deployed has its checksum validated against a pre-calculated checksum. If the
binary changes but remains at the same URL, I will end up re-deploying the old version as I would have the binary in a local cache with a given checksum.

Is there a documented way to have a single thread on the forum for V4 and V5 jar files to prevent needing to double up?

Can’t help you with that, sorry.