Service Monitor
KDE4 Extensions
Description:

Distribution-independent utility for monitoring/toggling background services (daemons).

Features: show current status of services; start/stop with a single click; placeable on desktop or in dock;
maximum flexibility through shell commands

Installation: plasmapkg -i service-monitor.zip

Submit bugs and feature requests on GitHub: https://github.com/mbleichner/service-monitor/issues

You are welcome to contribute to development, feel free to create a fork on GitHub!

New Features in v2.0:
- Password input dialog now included (no more dependency on external tools like kdesudo)
- Easier management of service definition files (incl. one-click update)
- Hide unavailable services
- Environment variables aren't needed any more ($INITDIR will be guessed, $SUDO has become superfluous)
- Ability to copy existing services as custom services
- Sudo configuration helper (creates snippets for inclusion in /etc/sudoers)
- Three different indicator icon themes
- Option to suppress stdout of start/stop commands
- Report external state changes through KNotify
- Service icons can be placed directly in the panel (without popup)

Epimetheus11

5 years ago

When the service is start'ed or stop'ed using sudo, I get the following error message:

--------------

The command produced the following error:
QPixmap::handle(): Pixmap is not an X11 class pixmap
QPixmap::handle(): Pixmap is not an X11 class pixmap
QPixmap::handle(): Pixmap is not an X11 class pixmap

---------------

Report

mbleichner

5 years ago

Can you try issuing the commands from command line and check if it produces the same error?

Report

molostoff

6 years ago

Please turn back (+) and (-) as check buttons instead of currently red and green balls
I have several monitors and on some of them red/green balls look identically, so I probably can say that it looks like a form of daltonism.

Pluses and minuses are very clear to see, and the idea of coloring their state changes can be accommodated on background of (+) and (-)

Report

mbleichner

6 years ago

Hm, maybe I could compile different icon themes... but currently I have no time for that, so you will have to fix this problem locally:
all icons are contained in a Qt resource file which is compiled from ~/.kde/share/apps/plasma/plasmoids/contents/code/UI/Icons.qrc
Adapt it to your needs, then execute "pyrcc4 Icons.qrc > Icons_rc.py" to recompile the resource file.

Please note: only edit the paths, not the aliases! The paths must be relative from the working directory and if after successful compilation the old icons are still displayed, try to restart Plasma/KDE or reboot (because Qt caches loaded resources and I haven't found out yet how to flush this cache)

Report

janet

6 years ago

I cannot add any custom service, the Add button doesn't seem to do anything. I only can edit the Demo Service, so having more than one custom service isn't possible.

I wanted to add 2: mt-daapd and virtualbox(-ose). The virtualbox entry from Less common services does not work for me (there is no /etc/vbox - is the installation check needed?).

Report

mbleichner

6 years ago

That was indeed a serious bug you discovered. I corrected it. Reinstall the plasmoid, then it should work.

Thanks.

Report

janet

6 years ago

Does it work without kdesudo? I don't want to use sudo in any way and don't mind to enter the root password for changing the state of a service.

Report

mbleichner

6 years ago

I don't quite get what you want... Do you want to be prompted for the root password by the widget directly instead of kdesudo?
Or do you simply want to change kdesudo to gksudo or something? (see environment vars in config)

Report

janet

6 years ago

I don't want to use any sudo (kde or g), I want to be prompted for the root password.

Report

mbleichner

6 years ago

If you know some tool which takes a bash command, prompts for the root password and then executes the command with root privileges, you can enter its name into the SUDO environment variable.

Unfortunately I don't know of any such tool, but it should not be too hard to write one yourself.

Report

mbleichner

6 years ago

EDIT: gksu (not gksudo) provides this functionality. It asks for the root password, not the user pw.

Report

janet

6 years ago

Thanks. I now use it with kdesu on aptosid (sudo only on Kubuntu). It didn't work before because I hadn't entered the whole path. With "/usr/lib/kde4/libexec/kdesu" as SUDO variable it prompts for the root password. But I get error messages.

Report

janet

6 years ago

This is the output when I try to disable bluetooth:

The command produced the following error:
kdesu(11885)/kdesu (kdelibs) KDESu::PtyProcess::exec: [ ../../kdesu/process.cpp : 295 ] Running "/bin/su"
kdesu(11885)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ ../../kdesu/su.cpp : 259 ] Read line "Password: "
kdesu(11885)/kdesu (kdelibs) KDESu::PtyProcess::exec: [ ../../kdesu/process.cpp : 295 ] Running "/bin/su"
kdesu(11885)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ ../../kdesu/su.cpp : 259 ] Read line "Password: "
kdesu(11885)/kdesu (kdelibs) KDESu::PtyProcess::WaitSlave: [ ../../kdesu/process.cpp : 381 ] Child pid 12780
kdesu(11885)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ ../../kdesu/su.cpp : 259 ] Read line ""
kdesu(11885)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ ../../kdesu/su.cpp : 259 ] Read line "kdesu_stub"
kdesu(11885)/kdesu (kdelibs) KDESu::PtyProcess::exec: [ ../../kdesu/process.cpp : 295 ] Running "/bin/su"
kdesu(11885)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ ../../kdesu/su.cpp : 259 ] Read line "Password: "
kdesu(11885)/kdesu (kdelibs) KDESu::PtyProcess::WaitSlave: [ ../../kdesu/process.cpp : 381 ] Child pid 12869
kdesu(11885)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ ../../kdesu/su.cpp : 259 ] Read line ""
kdesu(11885)/kdesu (kdelibs) KDESu::SuProcess::ConverseSU: [ ../../kdesu/su.cpp : 259 ] Read line "kdesu_stub"

But after confirming that box the button for the bluetooth service turns red.

Report

mbleichner

6 years ago

Same errors here. It seems to be a bug in kdesu, since it fails even when called from the console.

Report

janet

6 years ago

So - is the service now turned off, or does it just pretend to be off?

Report

mbleichner

6 years ago

When the light is red, the service is definitely off (running check fails).

Report

mbleichner

6 years ago

The error messages pops up because kdesu prints its debug output to stderr, which makes service monitor think something has gone wrong. Here is a little workaround: create the following script:

#!/usr/bin/python
import sys, os
os.system('/usr/lib/kde4/libexec/kdesu %s 2> /dev/null' % ' '.join(sys.argv[1:]))

Make it executable and use it instead of /usr/lib/kde4/libexec/kdesu.

Report

janet

6 years ago

The command produced the following error:
/home/me/bin/ksu: row 3: Syntaxerror for unexpected word `'/usr/lib/kde4/libexec/kdesu %s 2> /dev/null''
/home/me/bin/ksu: row 3: ` os.system('/usr/lib/kde4/libexec/kdesu %s 2> /dev/null' % ' '.join(sys.argv[1:]))'

I did a copy & paste...

Report

mbleichner

6 years ago

Maybe you forgot to copy the shebang line?

Report

janet

6 years ago

Thanks, yes, something like that. I had a comment before the shebang line and have not seen it.

Works. Me happy :)

Report

mononoke

6 years ago

hi,
i like that plasmoid!

When i look at the configuration window,
i see some services are shown "not available". Maybe because the services are named diffrent on my opensuse (11.2)
Actually the service "ssh" is called "sshd" in "/etc/init.d/".

Something strange is with "samba". The Service is actually named "smb", but the deamon is named smbd.

Anyway, the plasmoid is showing the correct state, when i add the services to active monitoring box in the configuration dialog.

How is this possible, i mean, the plasmoid is showing the correct state ?

Report

mbleichner

6 years ago

Look at the running-check command: "pidof smbd"
It looks if there is a process running with the name "smbd" - and this seems to be distro-independent.
The start/stop commands will probably not work for you since the init-script has a different name.
To fix this, you can create a custom service with the correct start/stop commands for opensuse or edit the xml source file before you include it.

I'll try to find a nice solution for such problems in the next version. If you have any ideas how this can be done, please tell me :)

Report

mononoke

6 years ago

thanks,
i manually edit the xml file ~/.kde4/share/apps/plasma/plasmoids/service-monitor/contents/sources/daemons.xml

if i get it right, people can share single service definitions. Wouldn't it be better, if people share a set of services belonging to there distribution and version (opensuse 11.3,SuSE 10.3,Ubuntu 9.04).
it would be nice to easily edit the services/daemons inside the configuration dialog, if a service name is not matching the real one.

Report

mbleichner

6 years ago

Yeah, you are right. I'll think about including this in the next version.

Report

Ireyon

7 years ago

yes, it is.

Report

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install
Score 88%
88.00 Likes
12 Dislikes
Details
version
2.0
updated Nov 01 2011
added May 23 2010
downloads
page views 1852