Yasp-Scripted (Systemmonitor) v1.0.8a

Plasma 4 Widgets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

24
7.6
Description:

Yes, Yet another systemmonitor plasmoid.
But still different from the others.
The only useful plasmoid systemmonitor i have found was Yasp. The problem with it was that it was not configurable enough.
So I came up with the idea, that everyone has its own imaginations of what belongs into a systemmonitor and what not. The birth of Yasp-scripted.
The name is similar to Yasp, because I use some modified code from that project.
The biggest advantage is that you can add things to the monitor or remove some, by just changing the script file and reparse it again...) No recompilation or something like that needed...
The scriptfile which comes with this applet is a scriptfile which fits exactly my system. You probably need to change it to fit your system (e.g. if you do not have a wireless lan card, you need to remove the wlan stuff from the script file).

You can send me your script, such that I can upload a whole bunch of scripts, the user could choose of later (maybe with a screenshot to see directly what the script does)

The scripts can be found in the directory yasp_scripts.
The 1st screenshot is systemmonitor_by_mtr.script, the 2nd screenshot is systemmonitor_by_patkoscsaba.script
and the 3rd screenshot is the script collection by duncan
(thx for the scripts).

If you want to align things, you should either use a monospace font, or use a t in the value.

If you are familiar with svg you maybe will create your own svg's for the bar-meter. Send them please to me to have a wider range of look and feel for the system monitor ;)
Last changelog:

8 years ago

1.0.8a - wrong folder prefix ;)

1.0.8 - bug fixed when reparsing (the kde-plasma-handle was deleted, but we should not delete it)

1.0.7 - bug fixed if engine-sensors contains a colon
- Added script by joseph (thx for the script)
- New script by aldo (thx for the script)

1.0.6 - stack keyword added to plotter (thx Chris99 for the patch)
- Script by mtr added (thx for the script)

1.0.5 - fix crash on reparsing in kde-4.5.2 (with 4.5.2 reparsing works again, but 4.5.1 and 4.5.0 have a bug)

1.0.4
- Label preferredSize setting correctly + sizePolicy changed

1.0.3
- meter sizePolicy changed (works now better in KDE-4.5)
- bugfix for KDE-4.5 such that it does not crash on removal

1.0.2
- workaround for problems with KDE-4.5 and meters (min_height parameter added)
- added script by aldo to the package (italian labels)
(- known issue: yasp-scripted crashes on reparsing in kde-4.5. This will be fixed in a later release)

1.0.1 - bug fixed if yasp is closed while parsing the script

1.0: - Reparsing should be more stable

Grindcore

9 years ago

Hi,

Compiling and installing was no problem but after choosing the systemmonitor.script all I get is the following message: Waiting for: HomeUsed.

The relevant line in the script is this one:
sensor name="HomeUsed" type="engine" cmd="systemmonitor:partitions/home
/usedspace:value" math="int $0 256 /"

What is the problem?

Thanks for advice!

Report

DuncanKDE

9 years ago

Quote:Waiting for: HomeUsed. [...]

sensor name="HomeUsed" type="engine" cmd="systemmonitor:partitions/home
/usedspace:value" math="int $0 256 /"

Do you have a separate /home partition, or is it on the same partition as / ?

yasp-scripted is designed for you to be able to create your own system monitor scripts to fit your own needs and system layout, possibly modifying the ones shipped with it as examples, possibly creating your own, from scratch. If you're not modifying them for your own installation, you're missing the point, and there's likely a lot that's going to be broken -- that'd be just the first bit it couldn't understand.

If it's waiting for that system monitor engine value, it's probably because that value doesn't exist, which is probably because that partition doesn't exist. Check the README.syntax file shipped with the sources for the details, but in short, try running "plasmaengineexplorer" and taking a look at all the systemmonitor data-sources. If you have a partitions/home/usedspace source available, the problem is something else, but it won't be available if you don't have a separate partition mounted at /home, which is what I expect is the issue there, because you've not customized the script for your system.

Report

nicollivier

9 years ago

Thanks a lot :) it's OK for Cpu's Temps

For Hdd's Temp, I use this command « hddtemp /dev/sda »
And return:
/dev/sda: TOSHIBA MK2555GSX: 37°C

Report

C

finkandreas

9 years ago

sensor name="HddTemp" type="program" cmd=%hddtemp /dev/sda | sed -e "s/.*: \([0-9]*\).*/\1/"%
value key="Hdd Temp:" use="HddTemp"

Report

nicollivier

9 years ago

Perfect
Thanks a lot :D

Report

nicollivier

9 years ago

I would like to have Cpu's temperature informations. So I installed lm_sensors, but I still have no information...

I missed something ?!

Thanks...

Nico

Report

C

finkandreas

9 years ago

First make sure that lm_sensors works at all, i.e. type 'lm_sensors' in a terminal and look at the output.

Then you need to define sensors in yasp-scripted which parse the output of lm_sensors to get the desired result..

If lm_sensors itself is working and you have no idea how to get the result to yasp, you can post the output of lm_sensors, and I can help you.

Report

ondrokm

9 years ago

Hi,
temperature doesn't work for me neither.

$ sesors:
acpitz-virtual-0
Adapter: Virtual device
temp1: +52.0°C (crit =90.0°C)
temp2: +52.0°C (crit = +90.0°C)

Could you help me, pls?

Report

DuncanKDE

9 years ago

That's all the sensors command outputs? If so, all you need to do is sed for the temps. If not, you'll have to grep for the adaptor (using the -An option to include n additional lines after), then grep or sed the result.

Assuming that it's the whole sensors output, try this as the command for temp1, change the temp1 to temp2 for it (if you don't want the fraction, simply omit the . in [0-9.]):

sensors | sed -n 's/temp1: +\([0-9.]\+\).*/\1/p'

You can try that on the command line and see what it outputs, before trying it in your yasp-script.

If you have other temp1 sensors as well, you'll probably need to grep for the adapter first, so you get the correct temp1, as so:

sensors | grep -A3 acpitz-virtual-0

So then the complete command looks like this:

sensors | grep -A3 acpitz-virtual-0 | sed -n 's/temp1: +\([0-9.]\+\).*/\1/p'

(As none of those lines include the " char, you can use it as the command delimiter in the yasp-script.)

Report

ondrokm

9 years ago

Thanks. Yes, that was the whole output of $ sensors.
Your commands doesn't work, finally I have found

sensors | grep -A1 "temp1" | xargs | sed "s/.*: +\([0-9].....\).* \(+[0-9].*\)/\1/"

Hope it will helps someone else.

Report

nicollivier

9 years ago

Hi,

Thanks for your help.

lm_sensors works fine, and this is the result of «sensors»:

[~] sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +36.0°C (crit = +127.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0: +47.0°C (high = +82.0°C, crit = +100.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1: +47.0°C (high = +82.0°C, crit = +100.0°C)

coretemp-isa-0002
Adapter: ISA adapter
Core 2: +43.0°C (high = +82.0°C, crit = +100.0°C)

coretemp-isa-0003
Adapter: ISA adapter
Core 3: +43.0°C (high = +82.0°C, crit = +100.0°C)


Thanks a lot :)

Nico

Report

C

finkandreas

9 years ago

It depends how you want to have the output (one line with all 4 temperatures, 4 lines with the temperature for each core, the mean value of all temperatures, etc)

here a possiblity to get all Core values in one line
sensor name="Temp" type="program" cmd=%cat temp | grep Core | sed -e "s/Core [0-3]: +\(..\).*/\1/" | xargs%

value key="Core Temp" use="Temp"

If you want another type of output let me know, then i can give you other possible sensor/value lines ;)

Report

nicollivier

9 years ago

Now I'm using my netbook, and the command «sensors» return this:

coretemp-isa-0000
Adapter: ISA adapter
Core 0: +34.0°C (high = +105.0°C, crit = +105.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1: +31.0°C (high = +105.0°C, crit = +105.0°C)

So I think I could use your command?!
But there is a problem:
«cat:temp: No file or folder of this type» ...

Thans a lot for your help :)

Report

nicollivier

9 years ago

I looked inside « systemmonitor.script », and I found this:
sensor name="Core0Temp" type="program" cmd=%sensors | grep -A1 Core0 | xargs | sed "s/.*Temp: \(+[0-9]*\).*Temp: \(+[0-9]*\)../\1 \2/"%

And I adapted it with « ... grep -A1 " Core 0".... », and now I've informations... But there's all informations, with limits....

How can I do to have only temp...

Thanks :)

Nico

Report

C

finkandreas

9 years ago

sorry, in my command before you should of course replace 'cat temp' by 'sensors' (I copied your output to a file called temp, to test my own command ;) )

To have all informations in one line, define your two sensors (Core0Temp and Cpu0Load) and add this line to your script:
value key="Cpu0: " use="Cpu0Load" use="Core0Temp" format="$1 % $2"

How can you get hdd-temp in a console, and how does the output look like?

Report

nicollivier

9 years ago

Well, with this script « systemmonitor_by_patkoscsaba.script », I found the right command:

sensor name="Core0Temp" type="program" cmd=%sensors | grep -A1 "Core 0" | xargs | sed "s/.*: +\([0-9].....\).* \(+[0-9].*\)/\1/"%

But I've again a litte problem :), I would like have all Cpu1's informations in only one line..
Now I've two lines:
1 to Cpu's use with this:
sensor name="Cpu0Load" type="engine" cmd="systemmonitor:cpu/cpu0/TotalLoad:value" math="int $0"
value key="Cpu0: " use="Cpu0Load" format="$1 %"
And second to Cpu's Temp

So if I could have these informations in only one line, it's great :)

And a last one, if I can :)
I would like to have HDD's temp, but I don't know how I have to adapt the command....

Thanks a lot for your help :)

Nico

Report

DarkriftX

9 years ago

I have spent days trying to find a suitable replacement for my gkrellm sidebar. I finally came along this plasmoid and it almost looked like it would work. It has a lot of stuff I dont need, but I am pretty sure I can figure out how to get rid of that. My only real problem is that I want this to be on a panel that acts as a sidebar. I want it to be 100-180px wide. The plasmoid seems to want to be 400px or so wide. Where do I edit the max width of whichever items need to be shrunk to make this smaller?

Report

DarkriftX

9 years ago

Nevermind. I fixed a few sed lines (I have a dev version of kde so a sed line was "s/KDE:" and I changed it to "s/KDE Developer Platform" (i think this is what it was) and it shortened up the longest line of text. This then made the rest of the items shorter. Almost makes me wish there was a wrap feature. I now have this sidebar working perfectly.

Report

Franksuse64

9 years ago

Ok great, I have modified considerably the original script to fit what I need, a few things remaining now, the most complex, so I will start with one I absolutely need.

Sure I could go on IRC, but I am at work now. :) Yes I am working on the script at work. lolll It's interesting. I also think other people would like to know the answer as well.

I am trying to understand how I can set alarm limits on sensors. There is no value key for alarm, so do I need to write something with math?

Low or high or low and high limits (only 2 alarms to start with) on:

-CPU load;
-Core/CPU/GPU/HDD/System temps;
-CPU/System Fans RPMs;
-Voltages;
-HDD free space per partition.

I am totally lost on that one. :) But I know if it works for one, it will for the others.

I think any good monitor should have alarms, cuz its purpose is to monitor sensors. :) I hope it's possible with your scripts?

tnx :)

Report

C

finkandreas

9 years ago

No alarms possible... And it's not the job of a systemMONITOR to have alarms.

Report

Franksuse64

9 years ago

Is there a technical reason why alarms cannot be incorporated within the scripts?

Report

C

finkandreas

9 years ago

the only reason why it's not possible is because I've never needed it, so I've never implemented it...

Report

Franksuse64

9 years ago

Good. :) So it's technically possible. Since your monitor deserves to expand, I will try to find someone with the knowledge and time to look into the alarms.

tnx :)

Report

DuncanKDE

9 years ago

[AF: Could you put a note at the top to take care and erase extra Re:s in the subjects? They crowd out the subject after awhile. =:^( Plus, people might pay more attention to the subjects then, and change them if the subject of a (sub) thread changes. =:^)]

I was sick from yesterday and so slept a lot, then slept a lot again today, too. You know the free association, strange ideas and stuff that happens when you're kind of floating between sleep and awake? Well, I was there, and while a lot of the stuff was crazy, as usual, I did realize something... which I've made a bit more sane as I woke up and am writing this.

No, yasp.s doesn't have alarms per se, but there's no reason the script feeding yasp.s the values to monitor couldn't also check them, and trigger either a beep, or the playing of a short audio file, if they go out of range. One would need to do so in the background, so the script can finish and it won't hang yasp.s, but that's no big deal.

Actually, probably the best way to handle it would be to put the alarm handling in a secondary script, that could be called with say four parameters, the current value, the high-trigger value, the low-trigger value, and the command to play the alarm, if necessary. That way, the alarm script could be reused in any script without having to rewrite it in each.

Having it take the entire command, not just the audio-file, would allow people to change the player easily, if necessary because they don't have a particular player on their system. The command would include the audio file to play, which could then be customized so different alarms played different files.

Now you'd want to keep the audio clip short, a second or two, so as it's repeatedly triggered, it finishes playing before the next sensor update triggers it again.

Alternatively, some non-audio cue could be given as the command, say to flash the screen or whatever. I don't really know the sort of command that would do that, but I'm sure there's something.

There should probably be a check of some temp file, say $KDETMP/yasp.s.alarms-disabled, which if present, would disable the alarms, as well. That way, one could simply touch that file to hush the alarms and allow one to get on with fixing the problem.

Just a bit of brainstorming. Maybe I'll hack up such a script, maybe not, and who knows when I'd do it, but anyway, perhaps this points someone in the right direction to implement it if they want it bad enough.

Better yet, if someone with C/C++ skills could create a native code version that could be compiled, taking the four parameters I mentioned above on the command line and checking the shutup file mentioned above (with a sane default path, say /tmp/tmp-<user>/yasp.s.alarm-disable, if $KDETMP is unset), it'd run faster, thus saving CPU time over a bash implementation, which is what I'd be able to do. That's important when the thing is called perhaps every second, by multiple yasp.s sensors!

Report

C

finkandreas

9 years ago

For implementing alarms I would use the native KDE notification, because it fits best into the system...
So basically for implementing alarms, we have to define a syntax first (and this is the point, where I have no idea, because I don't know what people want to do with alarms). The rest comes down as a straight forward implementation...

Report

8 years ago

1.0.8a - wrong folder prefix ;)

1.0.8 - bug fixed when reparsing (the kde-plasma-handle was deleted, but we should not delete it)

1.0.7 - bug fixed if engine-sensors contains a colon
- Added script by joseph (thx for the script)
- New script by aldo (thx for the script)

1.0.6 - stack keyword added to plotter (thx Chris99 for the patch)
- Script by mtr added (thx for the script)

1.0.5 - fix crash on reparsing in kde-4.5.2 (with 4.5.2 reparsing works again, but 4.5.1 and 4.5.0 have a bug)

1.0.4
- Label preferredSize setting correctly + sizePolicy changed

1.0.3
- meter sizePolicy changed (works now better in KDE-4.5)
- bugfix for KDE-4.5 such that it does not crash on removal

1.0.2
- workaround for problems with KDE-4.5 and meters (min_height parameter added)
- added script by aldo to the package (italian labels)
(- known issue: yasp-scripted crashes on reparsing in kde-4.5. This will be fixed in a later release)

1.0.1 - bug fixed if yasp is closed while parsing the script

1.0: - Reparsing should be more stable

12345678910
123
product-maker domryba Apr 16 2015 8 great
product-maker LeifErikson May 29 2013 8 great
product-maker XenoPL Nov 01 2012 8 great
product-maker Sweyn78 Aug 27 2012 8 great
product-maker matafleur Mar 05 2012 8 great
product-maker gerstavros Jan 15 2012 8 great
product-maker Heart Nov 14 2011 8 great
product-maker momonster Jul 02 2011 8 great
product-maker superpepo Jun 18 2011 8 great
product-maker yield65 May 29 2011 8 great
product-maker marcotangaro Mar 24 2011 8 great
product-maker theZest Feb 28 2011 8 great
product-maker bugmenot1234 Feb 27 2011 8 great
product-maker rangerGR Feb 25 2011 8 great
product-maker schleby Feb 14 2011 8 great
product-maker phiga2 Feb 11 2011 3 bad
product-maker srog Feb 01 2011 8 great
product-maker opera1818 Dec 17 2010 8 great
product-maker cialdo99 Nov 18 2010 8 great
product-maker deabru Nov 07 2010 8 great
product-maker schnelle Nov 05 2010 8 great
product-maker Vzlom Oct 27 2010 8 great
product-maker vatsok Oct 21 2010 8 great
product-maker SeaJey Oct 07 2010 8 great
product-maker Count:67 Rating: 7.46

domryba

Apr 16 2015

xrooters

Jul 13 2013

LeifErikson

May 29 2013

XenoPL

Nov 01 2012

despot77

May 28 2012

Fred6681

Jul 02 2011

yield65

May 29 2011

marcotangaro

Mar 24 2011

extra

Nov 09 2010

Contrast

Aug 21 2010

poelzi

Feb 25 2010

hellblade

Feb 16 2010

Franksuse64

Feb 02 2010

DaiVied

Dec 19 2009

nicollivier

Dec 02 2009

Droopy159

Nov 18 2009

SeaJey

Nov 03 2009

Sibob

Nov 03 2009

DuncanKDE

Oct 22 2009

kanutron

Sep 18 2009

t3ddy

Sep 04 2009

Montblanc

Aug 28 2009

NForce

Aug 10 2009

Havoc65

Jul 31 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
1.0.8a
updated Feb 25 2011
added Jul 31 2009
downloads today
0
page views today 7