Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperature threshold is not run #151

Closed
bennaux opened this issue Apr 3, 2020 · 6 comments
Closed

Temperature threshold is not run #151

bennaux opened this issue Apr 3, 2020 · 6 comments

Comments

@bennaux
Copy link

bennaux commented Apr 3, 2020

Step 1: Describe your environment

  • System (Intel/AMD/Raspberry Pi etc): Intel, Notebook
  • OS version: Ubuntu 18.04 Live DVD
  • s-tui version: 1.0.0
  • Installation method(pip/PPA/source code): sudo pip install s-tui

Step 2: Describe the problem:

I've placed a file ~/.config/s-tui/hooks.d/temperaturesource.sh:

#!/bin/bash
echo "$(date +%Y-%m-%d_%H:%M:%S) EMERGENCY KILL BECAUSE OF HIGH TEMPERATURE" >> ~/stresstest.txt
killall stress
killall FIRESTARTER
killall mprime

Made it executable: chmod +x ~/.config/s-tui/hooks.d/temperaturesource.sh

And invoked s-tui like this:

s-tui --csv --no-mouse -tt 40

Started stress:

stress --cpu 4 --timeout 20s

The temperatures shoot right over the given 40 degrees, but the stress command always terminates itself after the 20 seconds and is not killed by the threshold script.

@bennaux
Copy link
Author

bennaux commented Apr 3, 2020

I've tried to call it tempsource.sh as well, with no effects...

What am I doing wrong?

@amanusk
Copy link
Owner

amanusk commented Jul 3, 2020

Hey,
Thanks for the bug report. This is indeed a somewhat untainted feature. It was relevant when s-tui was only displaying a single temperature sensor. Now that it displays all, I'm not sure how to build the feature so the alert will only fire for a specific sensor, for for several.

@bennaux
Copy link
Author

bennaux commented Jul 5, 2020

Maybe it would be possible to split it up somehow?

A minimal approach could be to just compare max(sensor1, sensor2, ...) with the threshold.

amanusk added a commit that referenced this issue Jul 11, 2020
@amanusk
Copy link
Owner

amanusk commented Jul 11, 2020

Indeed, the minimal approach is what we'll use for now.
I've pushed a fix and and update for the readme. The file indeed needs to be called tempsource.sh.
Regardless, a fix was needed to correctly respect the passed parameters for the threshold temperature (-tt)

amanusk added a commit that referenced this issue Jul 11, 2020
* Fixes for #157 and #158

- Fix summaries not saved, taking info from graphs
- Remove clock when no stress tool is installed

* Check if psutil traits return not none

Fix for #154

* Only check not none if attr exists

* Filter non-sane values

* Always add a counter indecator for repeating sensors

* Fix for #151 no call for hook
@amanusk
Copy link
Owner

amanusk commented Jul 12, 2020

I pushed a fix in version 1.0.2. Please verify. Thank you

@amanusk amanusk closed this as completed Jul 26, 2020
@bennaux
Copy link
Author

bennaux commented Jul 26, 2020

Thank you very much -- I do not have any machine to verify it at the moment, but I will have one in a few months and try it. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants