dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
1412

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

Rexter

Member

See evey terminal command passed by the GUI

I'd like to have a widget on my desktop, that logs, and scrolls every terminal command that is passed by the gui. Can Conky do this. Any other ideas?

guicli
@cox.net

guicli

Anon

What makes you think the gui is passing commands to the cli?

Black Box
join:2002-12-21

Black Box

Member

I think he wants to trace which programs are launched, with which switches and with which indirections. While technically not CLI, It could make sense. I don't think it is possible without patching the system. Not everything launched touches a shell, be it non-interactive even.

nwrickert
Mod
join:2004-09-04
Geneva, IL

nwrickert to Rexter

Mod

to Rexter
Check what accounting options are available for your system.

In opensuse 12.2, I see that there is a package called "acct". The documentation says
quote:
acct - User-Specific Process Accounting

This package contains the programs necessary for user-specific process accounting: sa, accton, and lastcomm.
I'm pretty sure that is what you want.

I don't have it installed. I do remember using it on an earlier unix system (around 1990).

Note that it will provide information all all commands used, not just those started from the GUI.

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

Rexter to Black Box

Member

to Black Box
Yea, basically. Launchers, for example pass commands. When I click restart, or shutdown, a command is passed. My understanding is on Linux system most gui items pass commands. I just want them to log, and have then scroll.

JohnInSJ
Premium Member
join:2003-09-22
Aptos, CA

1 recommendation

JohnInSJ

Premium Member

said by Rexter:

Yea, basically. Launchers, for example pass commands. When I click restart, or shutdown, a command is passed. My understanding is on Linux system most gui items pass commands. I just want them to log, and have then scroll.

Well, there's your problem. Your understanding is wrong.

Everything a command line application does is accomplished via system calls. Those same system calls are also used by GUI apps. Want to rm files? call unlink() in your native gui or command line app.

You could trace all syscalls, but that would get ugly fast.

Brano
I hate Vogons
MVM
join:2002-06-25
Burlington, ON

1 recommendation

Brano to Rexter

MVM

to Rexter
You could see standard output and errors when you launch a GUI app from terminal and leave the terminal open. This is sometime useful for troubleshooting. Most apps are quite chatty with status messages to stdout and/or stderr.

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

Rexter

Member

Yea, that's what brought on the idea. I basically want that, but for everything not just one program.
Rexter

Rexter to JohnInSJ

Member

to JohnInSJ
said by JohnInSJ:

You could trace all syscalls, but that would get ugly fast.

Ugly is good. That sounds like what I want.

Brano
I hate Vogons
MVM
join:2002-06-25
Burlington, ON
(Software) OPNsense
Ubiquiti UniFi UAP-AC-PRO
Ubiquiti NanoBeam M5 16

Brano to Rexter

MVM

to Rexter
I'd direct your attention to /var/log/ directory.
There you can see most of the system logs and messages.

You can watch 'live' a log file with tail command, i.e. tail -f /var/log/messages

If you turn on accounting it can be pretty detailed.

XCOM
digitalnUll
Premium Member
join:2002-06-10
Spring, TX

XCOM to Rexter

Premium Member

to Rexter
conky to watch the processes and or logs?

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

1 edit

Rexter to Brano

Member

to Brano
You can watch 'live' a log file with tail command, i.e. tail -f /var/log/messages

I opened a terminal, and entered this command. Then by the gui, I opened, played around, and then closed several apps. No information showed up in the terminal, under the said command.

How do you turn on accounting?
Rexter

Rexter to XCOM

Member

to XCOM
Yea, what Brano is describing sounds like what I want, but I'd like it to be scrolling in a semi-transparent windows on the desktop. I was wondering if Conky might be able to do that.

XCOM
digitalnUll
Premium Member
join:2002-06-10
Spring, TX

XCOM

Premium Member

Yes it can.

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

Rexter

Member

lol, typical RTFM linux guy. I'll spend some more time with my buddy Google.

As of now, I haven't found the log info I'm looking for, to even import into Conky, so I'm not quite there yet.

Brano
I hate Vogons
MVM
join:2002-06-25
Burlington, ON

Brano

MVM

What exactly are you looking for? Different programs log to different log files (most of the log files are in /var/log though).

XCOM
digitalnUll
Premium Member
join:2002-06-10
Spring, TX
(Software) pfSense
MikroTik CRS125-24G-1S-RM

1 recommendation

XCOM to Rexter

Premium Member

to Rexter
said by Rexter:

lol, typical RTFM linux guy. I'll spend some more time with my buddy Google.

As of now, I haven't found the log info I'm looking for, to even import into Conky, so I'm not quite there yet.

I am sorry wtf did you wanted? All I said was that yest it can be done...
Give me some time to get out from work and I can assist but as it's been replayed here you need to cat the messages file and outputted to conky.
XCOM

XCOM to Rexter

Premium Member

to Rexter
said by Rexter:

How do you turn on accounting?

As in "user" accounting?

Brano
I hate Vogons
MVM
join:2002-06-25
Burlington, ON

Brano

MVM

On most systems it's the acct package.

XCOM
digitalnUll
Premium Member
join:2002-06-10
Spring, TX
(Software) pfSense
MikroTik CRS125-24G-1S-RM

XCOM to Rexter

Premium Member

to Rexter
ok so back at this....

Ok if you are trying to see every command done in cli by a user thats going to be a bit tricky.
You will have to audit each user by using something like rootsh or as said by Bruno acct.

To pipe it to conky all you have to do is something like execi lastcomm username

Last User Command :
${execi lastcomm username | tail}
 

Not perfect but gives you an idea.
Good Luck
XCOM

XCOM to Rexter

Premium Member

to Rexter
So..... What's the outcome?

Rexter
Libertas, Aequitas, Veritas
join:2002-11-17
cloud 9

Rexter

Member

I didn't find any info in /var/log/messages, and I didn't find a way to log all syscalls.