| 1 | #! /bin/bash |
| 2 | |
| 3 | # parse all log files for error messages |
| 4 | # print errors and warnings found to error.log |
| 5 | # WARNING: This will only work with english error messages! |
| 6 | |
| 7 | errfile=$LOGDIR/error.log |
| 8 | |
| 9 | # Define grep patterns. Do not start or end with an empty line! |
| 10 | globalerrorpatterns="error |
| 11 | fail |
| 12 | warn |
| 13 | bad |
| 14 | no space |
| 15 | syntax |
| 16 | Couldn't stat |
| 17 | Cannot access |
| 18 | is bigger than the limit |
| 19 | did not exist |
| 20 | non existent |
| 21 | not found |
| 22 | couldn't |
| 23 | can't |
| 24 | E: Sorry, broken packages |
| 25 | operator expected |
| 26 | ambiguous redirect |
| 27 | No previous regular expression |
| 28 | No such |
| 29 | Device or resource busy |
| 30 | unknown option |
| 31 | [a-z]\+\.log:E: |
| 32 | No candidate version found |
| 33 | segfault |
| 34 | Couldn't find any package whose name or description matched |
| 35 | cannot create |
| 36 | The following packages have unmet dependencies" |
| 37 | |
| 38 | globalignorepatterns="[a-z]\+\.log:# |
| 39 | Error: Driver 'pcspkr' is already registered, aborting |
| 40 | : bytes packets errors dropped |
| 41 | :+ error=0 |
| 42 | :+ trap error= |
| 43 | task_error_func= |
| 44 | STOP_ON_ERROR= |
| 45 | courier-webadmin |
| 46 | gstreamer0.10-plugins-bad |
| 47 | ibwebadmin |
| 48 | kernel-patch-badram |
| 49 | kolab-webadmin |
| 50 | kolabadmin |
| 51 | gstreamer0.10-plugins-really-bad |
| 52 | gsambad |
| 53 | libad |
| 54 | libtest-nowarnings-perl |
| 55 | libtest-warn-perl |
| 56 | libclass-errorhandler-perl |
| 57 | zope-ploneerrorreporting |
| 58 | libroxen-errormessage |
| 59 | liberror-perl |
| 60 | libgpg-error-dev |
| 61 | libgpg-error0 |
| 62 | ^fstab.\+errors=remount |
| 63 | [RT]X packets: |
| 64 | WARNING: unexpected IO-APIC |
| 65 | warned about = ( ) |
| 66 | daemon.warn |
| 67 | kern.warn |
| 68 | rw,errors= |
| 69 | Expect some cache |
| 70 | no error |
| 71 | failmsg |
| 72 | RPC call returned error 101 |
| 73 | deverror.out |
| 74 | (floppy), sector 0 |
| 75 | mount version older than kernel |
| 76 | Can't locate module |
| 77 | Warning only 896MB will be used. |
| 78 | hostname: Host name lookup failure |
| 79 | I can't tell the difference. |
| 80 | warning, not much extra random data, consider using the -rand option |
| 81 | confC._FILE |
| 82 | Warning: 3 database(s) sources |
| 83 | were not found, (but were created) |
| 84 | removing exim |
| 85 | The home dir you specified already exists. |
| 86 | No Rule for /usr/lib/ispell/default.hash. |
| 87 | /usr/sbin/update-fonts-.\+: warning: absolute path |
| 88 | hostname: Unknown server error |
| 89 | EXT2-fs warning: checktime reached |
| 90 | RPC: sendmsg returned error 101 |
| 91 | can't print them to stdout. Define these classes |
| 92 | warning: downgrading |
| 93 | suppress emacs errors |
| 94 | echo Error: |
| 95 | Can't open dependencies file |
| 96 | documents in /usr/doc are no longer supported |
| 97 | if you have both a SCSI and an IDE CD-ROM |
| 98 | Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon |
| 99 | Monitoring disabled |
| 100 | Error: only one processor found. |
| 101 | Error Recovery Strategy: |
| 102 | sector 0 does not have an |
| 103 | syslogin_perform_logout: logout() returned an error |
| 104 | grub is not in an XFS filesystem. |
| 105 | grub-install: line 374: |
| 106 | grub-probe: error: Cannot open \`/boot/grub/device.map' |
| 107 | is harmless |
| 108 | not updating .\+ font directory data. |
| 109 | register_serial(): autoconfig failed |
| 110 | Fontconfig error: Cannot load default config file |
| 111 | asking for cache data failed |
| 112 | However, I can not read the target: |
| 113 | fai-kernels/modules.dep: No such file |
| 114 | Warning: The partition table looks like it was made |
| 115 | task_error=0 |
| 116 | ^info: Trying to set |
| 117 | warning: /usr/lib/X11/fonts |
| 118 | can't read /etc/udev/rules.d/z25_persistent-net.rules |
| 119 | /cow': No such file or directory |
| 120 | Dummy start-stop-daemon called |
| 121 | X: bytes packets errors |
| 122 | ACPI Error |
| 123 | ACPI Warning |
| 124 | cannot stat \`/etc/modprobe.d/\*.conf' |
| 125 | cdrom: open failed." |
| 126 | |
| 127 | # add pattern on some conditions |
| 128 | if [ -n $FAI_ALLOW_UNSIGNED ] ; then |
| 129 | globalignorepatterns="$globalignorepatterns |
| 130 | WARNING: untrusted versions |
| 131 | Ignoring these trust violations" |
| 132 | fi |
| 133 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 134 | # Here you can define your own patterns. Put one pattern in a line, |
| 135 | # do not create empty lines. |
| 136 | myerrorpatterns="XXXXX" |
| 137 | myignorepatterns="XXXXX" |
| 138 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 139 | # The main routine |
| 140 | errorpatterns="$globalerrorpatterns |
| 141 | $myerrorpatterns" |
| 142 | ignorepatterns="$globalignorepatterns |
| 143 | $myignorepatterns" |
| 144 | |
| 145 | cd $LOGDIR || exit 3 |
| 146 | if [ -s $errfile ]; then |
| 147 | echo "Errorfile already exists. Aborting." |
| 148 | exit |
| 149 | fi |
| 150 | |
| 151 | grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile |
| 152 | if [ "$verbose" ]; then |
| 153 | egrep -v '^software.log:' $errfile > $LOGDIR/tempfile |
| 154 | mv $LOGDIR/tempfile $errfile |
| 155 | fi |
| 156 | |
| 157 | if [ -s $errfile ]; then |
| 158 | echo "ERRORS found in log files. See $errfile" |
| 159 | else |
| 160 | echo "Congratulations! No errors found in log files." |
| 161 | export flag_reboot=1 |
| 162 | fi |