Re: [syslog-ng] Syslog_NG
Dears,,, Tnx for your quickly reply. :) I've 1 syslog-ng server and 8 clients in my network. Syslog-Ng server collecting all log of that clients. But syslog-ng can collecting only bash & sh shell logs. Can't collect all command log off csh, tcsh ... etc. other shells... BR--- Munkh-Erdene On Mon, Oct 1, 2012 at 10:47 PM, Gergely Nagy <algernon@balabit.hu> wrote:
Hi!
I would like to ask you to write to the syslog-ng mailing list (https://lists.balabit.hu/mailman/listinfo/syslog-ng) with syslog-ng questions instead of contacting me directly.
However, I will try to answer your mail here now, since I'm a little confused about what you're trying to accomplish.
Munh-Erdene E <munhluu@gmail.com> writes:
Syslog_NG works fine with bash & sh shells &&& writing clientlogs on server.
But not working other shells, example: csh, ksh, tscsh ...
In Client side: Add some config on *Vi /etc/bashrc *
# log to syslog
declare ME
ME=$(awk -v val=$UID -F ":" '$3==val{print $1}' /etc/passwd)
export PROMPT_COMMAND='{ msg=$(history 1 | { read x y; echo $y; }); logger -p local5.info "CMDLOG PWD=$PWD ; USER=$ME ; COMMAND=$msg"; }'
*2. Vi /etc/rsyslog.conf*
*.info;mail.none;authpriv.none;cron.none @192.168.0.1
authpriv.* @192.168.0.1
Can you help me? pls
I don't really see where syslog-ng comes into play here? Neither logger nor rsyslog have much to do with syslog-ng itself. Nor should any shell or whatsoever affect syslog-ng, as it's a daemon that should be started at boot time, the shell you use need not have any effect on its behaviour.
-- |8]
Munh-Erdene E <munhluu@gmail.com> writes:
Syslog-Ng server collecting all log of that clients. But syslog-ng can collecting only bash & sh shell logs. Can't collect all command log off csh, tcsh ... etc. other shells...
Ah, now I understand what you're trying to do. With a little bit of searching and reading docs, I found that the following seems to work with tcsh: alias precmd 'eval logger -p local5.info "CMDLOG PWD=$PWD \; USER=$USER \; COMMAND=\`history -h 1\`"'; The problem is still unrelated to syslog-ng though, but I hope the above helps. It results in log lines like the following: Oct 2 10:51:06 localhost algernon: CMDLOG PWD=/home/algernon/src/syslog-ng ; USER=algernon ; COMMAND=echo Hi! This is from tcsh! WHEE! On the other hand, this kind of 'logging' is fairly easy to break and is unreliable in many other ways. I'd strongly suggest you enable process accounting instead. -- |8]
participants (2)
-
Gergely Nagy
-
Munh-Erdene E