/[smeserver]/rpms/smeserver-audittools/sme9/smeserver-audittools-1.4.0-logcheck.patch
ViewVC logotype

Contents of /rpms/smeserver-audittools/sme9/smeserver-audittools-1.4.0-logcheck.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sun Feb 2 21:51:15 2014 UTC (10 years, 9 months ago) by wellsi
Branch: MAIN
CVS Tags: smeserver-audittools-1_4_0-3_el6_sme, HEAD
Error occurred while calculating annotation data.
* Sun Feb 2 2014 Ian Wells <esmith@wellsi.com> 1.4.0-3.sme
- Add logcheck to help analyse errors in the log files [SME: 8175]

1 diff -ruN smeserver-audittools-1.4.0.old/root/sbin/e-smith/audittools/logcheck smeserver-audittools-1.4.0/root/sbin/e-smith/audittools/logcheck
2 --- smeserver-audittools-1.4.0.old/root/sbin/e-smith/audittools/logcheck 1969-12-31 16:00:00.000000000 -0800
3 +++ smeserver-audittools-1.4.0/root/sbin/e-smith/audittools/logcheck 2014-02-02 13:32:30.000000000 -0800
4 @@ -0,0 +1,25 @@
5 +#!/bin/bash
6 +#logcheck [days] [location]
7 +re='^[0-9]+$'
8 +days=2
9 +location=/tmp
10 +
11 +# If there is a second arg, use it as the location
12 +if ! [ -z "$2" ]; then
13 + location=$2
14 +fi
15 +
16 +# If first arg is a number, then set days.
17 +if ! [ -z "$1" ]; then
18 + if [[ $1 =~ $re ]] ; then
19 + days=$1
20 + else
21 + location=$1
22 + fi;
23 +fi
24 +
25 +echo "Log file: $location/log$(date +'%m%d%y')"
26 +find /var/log/ -mtime -$days -print -exec sh -c 'cat "{}" | tai64nlocal | egrep -i "useless|warn|fail|error|disable|remov|unable|exit"' \; > "$location/log$(date +'%m%d%y')" 2>&1
27 +
28 +exit 0
29 +

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed