public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* ausearch from cron
@ 2008-05-29 15:37 Kurt S Harris
  2008-05-29 15:48 ` Steve Grubb
  0 siblings, 1 reply; 2+ messages in thread
From: Kurt S Harris @ 2008-05-29 15:37 UTC (permalink / raw)
  To: linux-audit

When I run an ausearch from a cron in RedHat 5.1 I don't get any output, 
running the same command from the command line I get results.  Any ideas 
on what I'm missing?

output:
<no matches>
May 29 09:36:01 magenta last message repeated 3 times
May 29 09:36:01 magenta logger: AuditSearch: -ts 09:35:00 -te 09:36:00
May 29 09:36:01 magenta logger:

crontab:
* * * * 1-5 /usr/sbin/logaudit >> /var/log/messages 2>>/var/log/messages

logaudit:
#!/bin/bash
logaudit(){
ctime=$(/bin/date '+%T')
min=$(echo ${ctime}|cut -f2 -d:)
if [ "${min}" = "00" ];then
        Args=$(echo ${ctime} | /bin/awk -F : '{print "-ts "$1 -1 ":59:00 
-te "$1":"$2":00"}')
else
        Args=$(echo ${ctime} | /bin/awk -F : '{print "-ts "$1":" $2 - 1 
":00 -te "$1":"$2":00"}')
fi
echo -e "\nAuditSearch:" $Args
/sbin/ausearch ${Args} -i >> /var/log/messages 2>>/var/log/messages
echo -e "\n\n"

}

logaudit | /usr/bin/logger -p auth.alert

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ausearch from cron
  2008-05-29 15:37 ausearch from cron Kurt S Harris
@ 2008-05-29 15:48 ` Steve Grubb
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2008-05-29 15:48 UTC (permalink / raw)
  To: linux-audit; +Cc: Kurt S Harris

On Thursday 29 May 2008 11:37:27 Kurt S Harris wrote:
> When I run an ausearch from a cron in RedHat 5.1 I don't get any output,
> running the same command from the command line I get results.  Any ideas
> on what I'm missing?

You should upgrade to the audit package in RHEL5.2 where this has been fixed. 
You would then add the --input-logs commandline option to force it to use the 
logs instead of stdin.

-Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-29 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 15:37 ausearch from cron Kurt S Harris
2008-05-29 15:48 ` Steve Grubb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox