Linux Commands Examples

A great documentation place for Linux commands

dbus-monitor

debug probe to print message bus messages

Synopsis

dbus-monitor [--system | --session | --address ADDRESS] [--profile | --monitor] [watch expressions]


add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!

examples

1
source
            
DBUS_INTERFACE="org.freedesktop.Notifications"
dbus-monitor --profile | while read -r line; do
echo "${line}"
done
0
source
            
LOG=~/.scripts/daemons/locklog.txt
dbus-monitor \
--session "type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'" \
0
source
            
echo "Iniciando monitoramento de lock/unlock da tela"
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" | ( while true; do read X; if echo $X | grep "boolean true" &> /dev/null; then echo "$(date "+%Y-%m-%d %k:%M"): Autolock: Trabalhando" >> ~/.gtimelog/timelog.txt; elif echo $X | grep "boolean false" &> /dev/null; then echo "$(date "+%Y-%m-%d %k:%M"): Autolock: Fora da mesa **" >> ~/.gtimelog/timelog.txt; fi done ) &
ps aux | grep -v -e grep -e $$ | grep --color=auto -e dbus-monitor -e $(basename $0)
0
source
            
LOG "Screensaver Monitoring Started ($0)"
dbus-monitor "$dbuswatch" 2>> $log.err | while read line
do
case $line in
boolean*)
done
LOG "dbus-monitor exitted (user logged out?)"

description

The dbus-monitor command is used to monitor messages going through a D-Bus message bus. See http://www.freedesktop.org/software/dbus/ for more information about the big picture.

There are two well-known message buses: the systemwide message bus (installed on many systems as the "messagebus" service) and the per-user-login-session message bus (started each time a user logs in). The --system and --session options direct dbus-monitor to monitor the system or session buses respectively. If neither is specified, dbus-monitor monitors the session bus.

dbus-monitor has two different output modes, the ’classic’-style monitoring mode and profiling mode. The profiling format is a compact format with a single line per message and microsecond-resolution timing information. The --profile and --monitor options select the profiling and monitoring output format respectively. If neither is specified, dbus-monitor uses the monitoring output format.

In order to get dbus-monitor to see the messages you are interested in, you should specify a set of watch expressions as you would expect to be passed to the dbus_bus_add_match function.

The message bus configuration may keep dbus-monitor from seeing all messages, especially if you run the monitor as a non-root user.

options

--system

Monitor the system message bus.

--session

Monitor the session message bus. (This is the default.)

--address ADDRESS

Monitor an arbitrary message bus given at ADDRESS.

--profile

Use the profiling output format.

--monitor

Use the monitoring output format. (This is the default.)

example

Here is an example of using dbus-monitor to watch for the gnome typing monitor to say things

dbus-monitor "type=’signal’,sender=’org.gnome.TypingMonitor’,interface=’org.gnome.TypingMonitor’"


bugs

Please send bug reports to the D-Bus mailing list or bug tracker, see http://www.freedesktop.org/software/dbus/


author

dbus-monitor was written by Philip Blundell. The profiling output mode was added by Olli Salli.

How can this site be more helpful to YOU ?


give  feedback