check_logfiles-4.1.1/0000775000175000017500000000000014336703157011472 500000000000000check_logfiles-4.1.1/NEWS0000755000175000017500000000000014336703157012100 00000000000000check_logfiles-4.1.1/AUTHORS0000755000175000017500000000005414336703157012462 00000000000000Gerhard Lausser check_logfiles-4.1.1/config.sub0000755000175000017500000010530114336703157013373 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-04-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: check_logfiles-4.1.1/missing0000755000175000017500000001533114336703157013012 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: check_logfiles-4.1.1/configure.ac0000755000175000017500000000654314336703157013711 00000000000000AC_REVISION ($Revision: 1.150 $) AC_PREREQ(2.58) AC_INIT(check_logfiles,4.1.1) AM_MAINTAINER_MODE([disable]) AM_INIT_AUTOMAKE AC_CANONICAL_HOST RELEASE=1 AC_SUBST(RELEASE) AC_PREFIX_DEFAULT(/usr/local/nagios) dnl Figure out how to invoke "install" and what install options to use. AC_PROG_INSTALL AC_SUBST(INSTALL) dnl AC_PROG_CC dnl AC_PROG_CPP dnl AC_PROG_GCC_TRADITIONAL dnl AC_PROG_RANLIB AC_PROG_MAKE_SET WARRANTY="This plugin comes with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugin under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n" AC_SUBST(WARRANTY) SUPPORT="Send email to gerhard.lausser@consol.de if you have questions\nregarding use of this software.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n" AC_SUBST(SUPPORT) AC_ARG_WITH(nagios_user, ACX_HELP_STRING([--with-nagios-user=USER], [set user name to run nagios]), with_nagios_user=$withval, with_nagios_user=nagios) AC_ARG_WITH(nagios_group, ACX_HELP_STRING([--with-nagios-group=GROUP], [set group name to run nagios]), with_nagios_group=$withval, with_nagios_group=nagios) AC_SUBST(with_nagios_user) AC_SUBST(with_nagios_group) INSTALL_OPTS="-o $with_nagios_user -g $with_nagios_group" AC_SUBST(INSTALL_OPTS) case "$host_os" in *hp*) defaulttrustedpath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/contrib/bin ;; *) defaulttrustedpath=/bin:/sbin:/usr/bin:/usr/sbin ;; esac AC_ARG_WITH(seekfiles_dir, ACX_HELP_STRING([--with-seekfiles-dir=PATH], [sets directory for the state files (default=/tmp)]), with_seekfiles_dir=$withval, with_seekfiles_dir=/var/tmp/check_logfiles) AC_SUBST(SEEKFILES_DIR, $with_seekfiles_dir) echo variable with_seekfiles_dir is $with_seekfiles_dir AC_ARG_WITH(protocols_dir, ACX_HELP_STRING([--with-protocols-dir=PATH], [sets directory for the protocol files (default=/tmp)]), with_protocols_dir=$withval, with_protocols_dir=/tmp) AC_SUBST(PROTOCOLS_DIR, $with_protocols_dir) AC_ARG_WITH(trusted_path, ACX_HELP_STRING([--with-trusted-path=PATH], [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]), with_trusted_path=$withval, with_trusted_path=$defaulttrustedpath) AC_SUBST(TRUSTED_PATH, $with_trusted_path) EXTRAS= dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH dnl Checks for programs. AC_PATH_PROG(SH,sh) AC_PATH_PROG(PERL,perl) AC_PATH_PROG(GZIP,gzip) AC_PATH_PROGS(AWK,gawk nawk /usr/xpg4/bin/awk awk) AC_PATH_PROG(ECHO,echo) AC_PATH_PROG(SED,sed) AC_PATH_PROG(CAT,cat) dnl allow them to override the path of perl AC_ARG_WITH(perl, ACX_HELP_STRING([--with-perl=PATH], [sets path to perl executable]), with_perl=$withval,with_perl=$PERL) AC_SUBST(PERL, $with_perl) dnl allow them to override the path of gzip AC_ARG_WITH(gzip, ACX_HELP_STRING([--with-gzip=PATH], [sets path to gzip executable]), with_gzip=$withval,with_gzip=$GZIP) AC_SUBST(GZIP, $with_gzip) AC_OUTPUT(Makefile plugins-scripts/Makefile plugins-scripts/subst t/Makefile) ACX_FEATURE([with],[perl]) ACX_FEATURE([with],[gzip]) ACX_FEATURE([with],[seekfiles-dir]) ACX_FEATURE([with],[protocols-dir]) ACX_FEATURE([with],[trusted-path]) ACX_FEATURE([with],[nagios-user]) ACX_FEATURE([with],[nagios-group]) check_logfiles-4.1.1/ChangeLog0000644000175000017500000003766214336703157013200 00000000000000* 4.1.1 2022-11-21 shorten/truncate seekfile filenames exceeding a length of 250 characters * 4.1.0.1 2022-06-29 update dmesg reset * 4.1 2022-06-20 new type dmesg * 4.0.1.7 2022-06-09 errpt no longer uses it's own unstick * 4.0.1.6 2022-05-01 bugfix in unstick * 4.0.1.5 2022-03-25 bugfix in all external modules (errpt, wevtutil,...) * 4.0.1.4 2022-02-01 randomdevno and randomino are now command line parameters * 4.0.1.3 2022-01-29 add option randomdevno to searches, fix issue #65 * 4.0.1.2 2021-10-06 reenable sys/resource.ph * 4.0.1.1 2021-09-28 rm the // operator which fails with perl 5.8 normally i would not do this, but customers with a support contract get their wishes fulfilled any time. * 4.0.1 2021-01-09 sticky errors are numbered but not saved. * 4.0 2021-01-08 rewrote the sticky code, matches expire now based on individual timestamps * 3.13 2020-09-21 command line arguments containing special characters can be encoded with rfc3986://encoded_string * 3.12 2020-06-01 update stdout redirection * 3.11.0.3 2020-04-09 add --nosavethresholdcount and --thresholdexpiry to the command line parameters * 3.11.0.2 2019-03-05 fix CL_HOSTNAME again, first check hostname() for "." * 3.11.0.1 2019-03-04 fix CL_HOSTNAME * 3.11 2019-02-22 resolve path before do (pull request #46 datamuc) * 3.10 2018-11-30 detect systemctl improve message parsing for type wevtutil * 3.9 2018-06-11 add option maxage * 3.8.1.4 2017-11-13 increase number of capture groups to 20 * 3.8.1.3 2017-10-26 fix issue #33 * 3.8.1.2 2017-10-17 fix getfilefingerprint for automounted nfs-shares (device-no jumps) * 3.8.1.1 2017-07-26 fix rununique for windows * 3.8.1 2017-07-13 fix eventlog rewind&unstick pull request #22, journald filtering * 3.8.0.3 2017-07-05 bugfix in type wevtutil when eventlog contains spaces * 3.8.0.2 2017-04-25 reorg Makefile.am * 3.8.0.1 2017-04-24 add forgotten files to the dist * 3.8 2017-04-22 add type systemd (journald), pull request #15 from adrianlzt * 3.7.6.3 2016-11-14 fix perl undef mesg when truncating with %(0-9)s part II * 3.7.6.2 2016-11-11 fix perl undef mesg when truncating with %(0-9)s * 3.7.6.1 2016-11-11 truncate eventlog message with %(0-9)s * 3.7.6 2016-11-10 add option preview * 3.7.5.2 2016-07-13 fix debian packaging infrastructure * 3.7.5.1 2016-07-13 move debian files into debian/ * 3.7.5 2016-07-13 add debian package build tools (Thanks Hannes Hoerl) * 3.7.4.2 2016-06-22 bugfix for lastoffset and 16-bit-encodings * 3.7.4.1 2016-04-14 bugfix for flatfiles using privatestate bugfix for protocolfileerror * 3.7.4 2015-12-08 add global option protocolfileerror * 3.7.3.1 2015-11-02 add logfilemissing as command line option * 3.7.3 2015-09-29 bugfix for inversepat&allyoucaneat (pullrequest by ibpl) * 3.7.2 2015-09-22 add option logfilemissing=[warning|critical] * 3.7.1.5 2015-09-07 bugfix in --rununique, also add $options="rununique" * 3.7.1.4 2015-08-04 bugfix in loadstate(), very strange scenario * 3.7.1.3 2015-07-22 bugfix in --warning/--critical macros * 3.7.1.2 - 2015-06-11 cleanup my pidfile * 3.7.1.1 - 2015-06-03 fix a macro-bug * 3.7.1 - 2015-04-22 add homevartmp as another autodetect location for seekfiles * 3.7 - 2015-04-01 add type wevtutil to support EVTX (Crimson) event logs. * 3.6.3 - 2014-12-21 resolve macros in seekfilesdir * 3.6.2.1 - 2014-04-09 fix eventid-format for _tecad_win_ * 3.6.2 - 2014-04-08 eventlogformat _tecad_win_ * 3.6.1.1 - 2014-02-04 fix a race-condition (pid file) in unix-daemon-mode (thanks Klaus Wagner) * 3.6.1 - 2014-01-25 added search-option "capturegroups" add forgotten --allyoucaneat * 3.6 - 2013-11-14 added global option "nooutputhitcount" added search-option "thresholdexpiry=" okpattern resets threshold counters * 3.5.3.3 - 2013-09-24 exe files without x-bit can now run in a cygwin environment (Thanks Michael Glaser) * 3.5.3.2 - 2013-03-28 fixed a bug in allyoucaneat (if used with rotations) * 3.5.3.1 - 2012-11-29 --verbose finally works on the commandline htmlencode can also be an option inside a config file * 3.5.3 - 2012-10-26 add option htmlencode (Thanks Sven Nierlein) * 3.5.2.1 - 2012-09-19 fix a bug related to nfs-mounted logfiles under linux * 3.5.2 - 2012-06-21 fix a bug in CL_PATTERN_KEY (Thanks Frank Rothaupt) * 3.5.1 - 2012-06-02 add parameters --warning and --critical (they become CL_WARNING/CL_CRITICAL) add option "savestate" for type "virtual" * 3.5 - 2012-04-23 --timeout aborts searches in a controlled manner * 3.4.7.1 - 2012-01-16 fix a bug in maxmemsize and solaris fix a bug where a supersmartpostscript's output was overwritten by longoutput * 3.4.7 - 2012-01-10 add new type dumpel (customer's request bugfix in errpt's unstick method (Thanks Jim Winkle) * 3.4.6.1 - 2012-01-05 make rotatewait a global option make logfileerror a global option * 3.4.6 - 2012-01-04 add maxmemsize cleanup tab-indendation add option logfileerror (unlike seekfileerror it is local) add option rotatewait (sleep until chaos during rotation is over) [selected]searches can be regexp Eliminate "Use of qw(...) as parentheses is deprecated" warnings in perl 5.14 (Thanks Tommi) * 3.4.5.2 - 2011-11-08 set the path to gzip for hpux /opt/contrib..) fix a bug where % in error messages caused ugly perl-errors when used with scriptstdin (Thanks Thomas Klaradic) * 3.4.5.1 - 2011-09-28 seekfilesdir can be "autodetect" with a configfile also protocolsdir (dirname(dirname(cfgfile)) + [/var/tmp|/tmp] also scriptpath (dirname(dirname(cfgfile)) + [/local/lib/nagios/plugins|/lib/nagios/plugins] type executable fix a perl undef (patternkey stuff which i don't remember) * 3.4.5 add parameter --rununique * 3.4.4.2 - 2011-08-03 patterns can be hashes * 3.4.4.1 - 2011-05-31 seekfilesdir is now local (./var/tmp) in an OMD environment * 3.4.4 - 2011-04-19 add parameter patternfile * 3.4.3.2 - 2011-03-15 fix a bug with --type rotating::uniform on the commandline * 3.4.3.1 - 2011-03-10 create the pidfile's directory if it doesn't exist new option unstick (Thanks Holger Reif) * 3.4.3 - 2011-01-19 add pid file handling to avoid concurrent processes with --daemon * 3.4.2.2 - 2010-09-29 add pattern loglog0bz2log1bz2 (Thanks Christian Schulz) add pattern ehl (Thanks Daniel Haist) * 3.4.2.1 - 2010-08-04 add %u (User) to option eventlogformat * 3.4.2 - 2010-06-29 fixed a bug where exceptions only worked if patterns were defined. (Thanks Heiko) small patch so filenames can be specified with --tag * 3.4.1 - 2010-05-08 new option archivedirregexp fixed a bug in eventlogs. (take care of type EVENTLOG_SUCCESS) * 3.4 - 2010-05-07 used a new version of par::packer for check_logfiles.exe (there were problems if PERL5LIB was set by an oracle/veritas/... perl installation) * 3.3 - 2010-04-27 speedup in pattern matching new (global) option seekfileerror added Win32::Daemon to the windows version * 3.2 - 2010-04-08 better errorhandling for type=eventlog. non-existing eventlogs and dead remote servers result in unknown type=eventlog now opens a secure channel to ipc$ if necessary type=eventlog now checks if the desired eventlog exists (reads registry) speedup in tivoli mode add 099benchmark.t * 3.1.5 - 2010-03-05 lookback option is now allowed in the config file fixed a bug which caused a perl-warning (only if criticalpattern=.* and last line is empty). (Thanks Sven Nierlein) matching empty lines are displayed as _(null)_ * 3.1.4 - 2010-02-24 just beautify the release string * 3.1.3.2 - 2010-02-24 added option randominode (Thanks Sergio) implemented the allyoucaneat option in Eventlog added option preferredlevel * 3.1.3.1 - 2010-01-14 made the logfile name visible in PRIVATESTATE changed HOMEPATH to USERPROFILE for the Windows HOME (Thanks Richard Tryzna) * 3.1.3 - 2009-12-12 fixed a bug in module Ipmitool * 3.1.2 - 2009-12-08 fixed a bug in scriptparams+macros+batsccipt * 3.1.1 - 2009-12-02 max plugin output length is now configurable with $options="maxlength=8192" * 3.1 - 2009-11-22 report can now be set in a cfgfile (global, e.g. $options="report=long") new option "allyoucaneat" (the initial run starts from line 0) new option "eventlogformat" (e.g. options='eventlogformat="id:%i %m",..') Eventlog can now be filtered with include and exclude new module Esxdiag * 3.0.4 - 2009-09-20 accept the contents of a config file as encoded string * 3.0.3.1 - 2009-09-07 Fixed a bug where incorrect EventIDs were read from the EventLog * 3.0.3 - 2009-08-26 Speedup in Eventlog scans Under some OSs the daemon did not detach itself from the terminal * 3.0.2 - 2009-07-23 fixed a bug for --config. (Windows uses HOMEPATH instead of HOME) fixed a bug in Eventlog+Tivoli (Thanks Werner Breitschmid) * 3.0.1 - 2009-06-25 fixed a bug in Eventlog+Tivoli added match_them_all and match_never_ever as predefined patterns * 3.0 - 2009-06-19 added the ability to run as a windows service. (needs Win32::Daemon) * 2.6 2009-05-26 added the --lookback parameter to simulate filter-written of CheckEventLog --critical/warningpattern can now be "match_them_all" instead of ".*" --archivedir is now also a cmd line parameter added the --daemon parameter. warning/criticalthreshold moved into options. added --warning/criticalthreshold to the list of possible comdline parameters Sven Nierlein wrote a module which reads patterns from a Tivoli Format File. fixed incorrect calculation of protocolretention. (Thanks Rainer Rose) * 2.5.6.1 - 2009-03-25 there was some debugging output left from 2.5.6 * 2.5.6 - 2009-03-25 fixed a bug in oraclealertlog+sticky rewrote oraclealertlog so that the key is database time and not the plugin's system time added the --macro parameter, e.g. --macro CL_LOGIN=nagios --macro CL_PASS=secret added errorresource to type errpt added the --nocase parameter fixed a bug with line endings in unicode files * 2.5.5.2 - 2009-02-20 added the report variable to config files more extensive testing of the logfile's permissions added the option maxlength which truncates lines (Thanks Thomas Borger) added the option winwarncrit which uses EventLog types instead of patterns * 2.5.5.1 - 2009-02-02 another bugfix for blanks in protocolsdir i accidentially published a messed-up version of 2.5.5 * 2.5.5 - 2008-01-23 multiline output with --report=long/html bugfix in rotation patterns (Thanks Elbert Lai and Prasana Iyengar) bugfix in type=oraclealertlog bugfix in scripts and windows pathnames with blanks. (Thanks Juergen Walker) * 2.5 - 2008-11-04 native support for Windows eventlog (type=eventlog) * 2.4.1.9 - 2008-10-30 bugfix in handling of config file paths. (Thanks Ken Harford) * 2.4.1.8 - 2008-10-24 bugfix in Windows scriptpath. (Thanks Markus Wagner) relative pathnames for config files are now possible under windows * 2.4.1.7 - 2008-10-10 bugfix in rotating::uniform and macros in rotation bugfix scriptparams with CL_TAG (Thanks Markus Wagner) * 2.4.1.6 - 2008-09-03 added parameter --environment * 2.4.1.5 - 2008-08-15 syslogclient hostnames can be case insensitive with option nocase * 2.4.1.4 - 2008-07-20 scripts have access to a state hash, Environ. LAST_RUNTIME, RUN_COUNT bugfix in type=uniform * 2.4.1.3 - 2008-06-24 fixed a bug in --sticky= (Thanks Severin Rossignol) * 2.4.1.2 - 2008-06-18 fixed a bug in CL_DATE_YY (Thanks beboy) * 2.4.1.1 - 2008-05-29 archivedir can contain macros * 2.4.1 - 2008-05-22 fixed a bug in sticky code (Thanks Nils Mueller) * 2.4 - 2008-05-07 added support for oracle alert log through database connection * 2.3.3 - 2008-04-10 introduced -F which allows directories full of configfiles (ending in .cfg or .conf) fixed a typo in LOGLOG0LOG1 definition * 2.3.2.1 - 2008-02-26 fixed a bug which appeared with perl 5.10 tinkered with encoding. * 2.3.2 - 2008-02-12 added support for ipmitool system event log. fixed a small errpt bug. added decoding of ucs-2 encoded files as proposed by Dominic Horn. * 2.3.1.3 - 2008-01-28 small change to make it work with perl 5.10 * 2.3.1.2 - 2007-12-27 added macro CL_PROTOCOLFILE more commandline options Fixed a bug in conjunction with very big logfiles. * 2.3.1.1 - 2007-11-16 Fixed a bug concerning sticky. (Thanks Marc Richter) New option savethresholdcount. (Thanks Hannu Kivimäki) * 2.3.1 - 2007-10-14 Added search templates. Thanks Axel. Threshold counters are remembered. Fixed a big in scriptparams found by Niall Downie. Support for bzip2'ed archives * 2.3 - 2007-09-10 Added AIX errpt as a new type of logfile. Performance data are now in the expected format. Added the sticky option. (I hate it. No support!) Added the syslogclient option. Error counters can now be reset with okpatterns. Buxfixes for supersmart postscript output. * 2.2.4.1 - 2007-06-11 Fixed a bug (--searches) found by Mark Petersen * 2.2.4 - 2007-06-06 Added support for "virtual" files. (like /proc/*) * 2.2.3 - 2007-06-05 Fixed a bug with non-linux unices. Banged my head against the table. * 2.2.2 - 2007-06-02 Added support for supersmart pre/postscripts with no output * 2.2.1 - 2007-06-01 Added parameters to perl-based scripts Fixed bugs in DOS batch files * 2.2 - 2007-05-31 Scripts can now be code references. Added smart scripts. * 2.1.2 - 2007-05-24 Added the [no]case option to enable case insensitive searches. Fixed a bug related to acls and linux. (thx Marcus Fleige). * 2.1.1 - 2007-05-21 Removed sloppyness from the release 2.1 * 2.1 - 2007-05-21 Added support for Windows (ActiveState Perl) Added the mod_log_rotate method for Apache and Windows. Fixed a bug in configure for solaris/awk Added "selectedsearches" as proposed by Lars Stavholm. * 2.0 - 2007-05-09 New layout of code using perl objects. Added handling of nonrotating logfiles as proposed by Kai Nielsen. Added performance data. Bugs, improvements, cosmetics, tests * 1.3.6.1 - 2006-10-20 Corrected a bug which created protocol files even if no pattern matched. Added a delay option as proposed by some users of the syslog check method. * 1.3.6 Added execution of scripts if inverse patterns are not found. Corrected typos in README Added command line parameters as proposed by Hendrik "Andurin" Baecker. * 1.3.5 - 2006-08-23 Code cleanup Removed nsca support in favour of a more flexible script handling. Added support for script parameters and modeling of the script's input. Matches are now passed as environment parameters to scripts. * 1.3.4 - 2006-08-06 Added support for shifting logfilenames through macros. * 1.3.3 - 2006-07-03 Added nsca support for standalone use of check_logfiles * 1.3.2 - 2006-07-27 Added "watchdog" patterns which raise an alert when not found. Added exceptions for patterns which stop processing of a preceding match. More documentation in README Fixed syntax errors found by Doug Lochart. * 1.3.1 - 2006-07-24 Added automatic deletion of old protocol files. Added handling of an unreadable logfile. * 1.3 - 2006-07-04 Added an option for syslogservers to filter out foreign log entries. Added macros in patterns. Fixed a bug in timeout handling. Added Debian to the list of predefined rotation methods. * 1.2.6 - 2006-07-03 Added options {critical,warning}threshold as proposed by jorge cabrera. * 1.2.5 - 2006-04-17 Fixed a bug in the fake seek algorithm. * 1.2.4 - 2006-04-15 Added a workaround to enable seeking in a pipe. Minor bugfixing in tracing output. Added some more examples to README. * 1.2.3 - 2006-04-11 Minor modifications to tracing. Duplicate file detection to prevent scanning the same file twice. Added examples to README. * 1.2.2 - 2006-03-31 Added an new item to tracing as requested * 1.2.1 - 2006-03.27 Fixed a small bug in mtime comparison * 1.2 - 2006-03-27 Changed the default timeout to 60 seconds Added a better rotation detection Added -d option to activate extensive tracing Bugfixing and commenting * 1.1 - 2006-03-24 Added the first match to the plugin's output * 1.0 - 2006-03-12 Initial release check_logfiles-4.1.1/t/0000775000175000017500000000000014336703157011735 500000000000000check_logfiles-4.1.1/t/053protocolserror.t0000664000175000017500000001153214336703157015372 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/053pathswithblanks.t # # Test the capability of finding files, scripts etc with blanks in the pathname # use strict; use Test::More tests => 10; use Cwd 'abs_path'; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use File::Path; use constant TESTDIR => "."; rmtree TESTDIR."/prots"; mkdir TESTDIR."/prots"; diag("tick"); my $cl = Nagios::CheckLogfiles::Test->new({ seekfilesdir => TESTDIR."/var/tmp", #protocolsdir => TESTDIR."/mich/gibt/es/nicht", protocolsdir => TESTDIR."/prots", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", } ] }); diag("tick"); #printf "%s\n", Data::Dumper::Dumper($cl); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); diag("tick"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); diag("tick"); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); my @prots = glob(TESTDIR."/prots/check_logfiles.protocol*"); ok(scalar(@prots) == 1); $cl = Nagios::CheckLogfiles::Test->new({ seekfilesdir => TESTDIR."/var/tmp", #protocolsdir => TESTDIR."/mich/gibt/es/nicht", protocolsdir => TESTDIR."/prots", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", options => "noprotocol", } ] }); mkdir TESTDIR."/prots"; #printf "%s\n", Data::Dumper::Dumper($cl); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); @prots = glob(TESTDIR."/prots/check_logfiles.protocol*"); ok(scalar(@prots) == 1); rmtree TESTDIR."/prots"; $cl = Nagios::CheckLogfiles::Test->new({ options => "protocolfileerror=unknown", seekfilesdir => TESTDIR."/var/tmp", #protocolsdir => TESTDIR."/mich/gibt/es/nicht", protocolsdir => TESTDIR."/prots", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", } ] }); ####################mkdir TESTDIR."/prots"; diag("tick"); #printf "%s\n", Data::Dumper::Dumper($cl); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); diag("tick"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); diag("tick"); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag(Data::Dumper::Dumper($ssh->{matchlines})); diag(Data::Dumper::Dumper($ssh->{lastmsg})); ok($cl->expect_result(0, 0, 2, 1, 2)); ok($ssh->{matchlines}->{UNKNOWN}->[0]->[1] =~ /cannot write protocol file/); @prots = glob(TESTDIR."/prots/check_logfiles.protocol*"); ok(scalar(@prots) == 0); check_logfiles-4.1.1/t/033mwagnermacros.t0000664000175000017500000000352714336703157015144 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/033wagnermacros.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 3; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use Net::Domain qw(hostname hostdomain hostfqdn); use Socket; use constant TESTDIR => "."; # # some macros in patterns # some search specific macros # a dynamically named logfile # test also an external config file # # my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", macros => { CL_VG00 => '/dev/vg00', CL_VG => '/dev/vg' }, searches => [ { tag => 'Maestro', logfile => '/tmp/mytest/out.log', criticalpatterns => ['exception'], options => 'script,nocase', script => 'nagmsg', scriptparams => '-n chaos -m $CL_TAG$ -s warning -t "$CL_SERVICEOUTPUT$"', }, { tag => 'BACKUP', logfile => '/tmp/mytest/ou', rotation => '.*out\d.log', type => 'rotating::uniform', criticalpatterns => ['gaga','markus'], options => 'script,nocase', script => 'nagmsg', scriptparams => '-n chaos -m $CL_TAG$ -s critical -t "$CL_SERVICEOUTPUT$"', }, ] }); my $maestro = $cl->get_search_by_tag("Maestro"); my $backup = $cl->get_search_by_tag("BACKUP"); $maestro->delete_logfile(); $maestro->delete_seekfile(); $backup->delete_logfile(); $backup->delete_seekfile(); ok($maestro->{tag} eq $maestro->{macros}->{CL_TAG}); ok($backup->{tag} eq $backup->{macros}->{CL_TAG}); my $scriptparams = $backup->{scriptparams}; $backup->resolve_macros(\$scriptparams); diag($scriptparams); ok($scriptparams eq '-n chaos -m BACKUP -s critical -t "$CL_SERVICEOUTPUT$"'); check_logfiles-4.1.1/t/050perms.t0000664000175000017500000001352614336703157013424 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/050perms.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 21; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->restrict_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); ok(-e $ssh->{logfile}, "logfile exists"); ok(-f $ssh->{logfile}, "logfile is a file"); ok($^O =~/MSWin/ ? -r $ssh->{logfile} : ! -r $ssh->{logfile}, "logfile is readable"); ok(! $ssh->getfileisreadable($ssh->{logfile}), "logfile is unreadable"); my $fh = new IO::File; ok(($^O eq "cygwin" ? 1 : ! $fh->open($ssh->{logfile}, "r")), "can be opened"); $ssh->unrestrict_logfile(); $ssh->delete_logfile(); diag("now be less strict. no permission = warning only"); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "logfileerror=warning", } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->restrict_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 0, 0, 1)); printf "%s\n", Data::Dumper::Dumper($cl->{options}); printf "%s\n", Data::Dumper::Dumper($ssh->{options}); ok(-e $ssh->{logfile}, "logfile exists"); ok(-f $ssh->{logfile}, "logfile is a file"); ok($^O =~/MSWin/ ? -r $ssh->{logfile} : ! -r $ssh->{logfile}, "logfile is readable"); ok(! $ssh->getfileisreadable($ssh->{logfile}), "logfile is unreadable"); $fh = new IO::File; ok(($^O eq "cygwin" ? 1 : ! $fh->open($ssh->{logfile}, "r")), "can be opened"); $ssh->unrestrict_logfile(); $ssh->delete_logfile(); diag("now be less strict. no permission = warning only"); diag("and we use logfileerror global, which is the preferred way"); $cl = Nagios::CheckLogfiles::Test->new({ options => "logfileerror=warning", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->restrict_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 0, 0, 1)); ok(-e $ssh->{logfile}, "logfile exists"); ok(-f $ssh->{logfile}, "logfile is a file"); ok($^O =~/MSWin/ ? -r $ssh->{logfile} : ! -r $ssh->{logfile}, "logfile is readable"); ok(! $ssh->getfileisreadable($ssh->{logfile}), "logfile is unreadable"); $fh = new IO::File; ok(($^O eq "cygwin" ? 1 : ! $fh->open($ssh->{logfile}, "r")), "can be opened"); $ssh->unrestrict_logfile(); $ssh->delete_logfile(); check_logfiles-4.1.1/t/070rotpatterns.t0000664000175000017500000002135414336703157014663 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/004rotation.t # # Test the capability of finding rotated logfiles. # Use the predefined names. use strict; use Test::More tests => 5; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if ($^O =~ /MSWin/) { # in a desperate attempt... $ENV{PATH} = $ENV{PATH}.';C:\Programme\cygwin\bin;C:\cygwin\bin'; } sub delete_and_create_ramsch { my @archives = ( "messages", "messagess", "message", "messages.0", "messages.00", "messages0", "messagess.0", "message.0", "messagess.0", "messagess0", "messages.0.gz", "messages0gz", "messagess.0gz", "message.0gz", "messagess.0gz", "messagess0gz", "messages0.gz", "messages.00.gz", "messagess.0.gz", "message.0.gz", "messagess.0.gz", "messagess0.gz", "messages.1", "messages.01", "messages1", "messagess.1", "message.1", "messagess.1", "messagess1", "messages.1.gz", "messages.01.gz", "messages1gz", "messagess.1gz", "message.1gz", "messagess.1gz", "messagess1gz", "messages1.gz", "messagess.1.gz", "message.1.gz", "messagess.1.gz", "messagess1.gz", "messages.2", "messages.02", "messages2", "messagess.2", "message.2", "messagess.2", "messagess2", "messages.2.gz", "messages.02.gz", "messages2gz", "messagess.2gz", "message.2gz", "messagess.2gz", "messagess2gz", "messages2.gz", "messagess.2.gz", "message.2.gz", "messagess.2.gz", "messagess2.gz", "messages2xgz", "messagess.2xgz", "message.2xgz", "messagess.2xgz", "messagess2xgz", "messagessx2xgz", "messagex2xgz", "messagessx2xgz", "messages.10.gz", "messages..0.gz", "messages.12345678", "messages00000000", "messages000000000000", "messages00000000000", "messages000000", "messages00000000.gz", "messages000000000000.gz", "messages00000000000.gz", "messages000000.gz", "messages00000000xgz", "messages000000000000xgz", "messages00000000000xgz", "messages000000xgz", "messages-00000000.gz", "messages-000000000000.gz", "messages-00000000000.gz", "messages-000000.gz", "messages.00000000.gz", "messages.000000000000.gz", "messages.00000000000.gz", "messages.000000.gz", "messages.00000000xgz", "messages.000000000000xgz", "messages.00000000000xgz", "messages.000000xgz", "messages:00000000xgz", "messages:000000000000xgz", "messages:00000000000xgz", "messages:000000xgz", "messages.xxxxxxxxxgz", "messages.xxxxxxxxxxxxxgz", "messages.xxxxxxxxxxxxgz", "messages.xxxxxxxgz", "messages..........gz", "messages..............gz", "messages.............gz", "messages........gz", "messages11111111", "messages111111111111", "messages11111111111", "messages111111", "messages11111111.gz", "messages111111111111.gz", "messages11111111111.gz", "messages111111.gz", "messages11111111xgz", "messages111111111111xgz", "messages11111111111xgz", "messages111111xgz", "messages-11111111.gz", "messages-111111111111.gz", "messages-11111111111.gz", "messages-111111.gz", "messages.11111111.gz", "messages.111111111111.gz", "messages.11111111111.gz", "messages.111111.gz", "messages.11111111xgz", "messages.111111111111xgz", "messages.11111111111xgz", "messages.111111xgz", "messages:11111111xgz", "messages:111111111111xgz", "messages:11111111111xgz", "messages:111111xgz", "messages.0.bz2", "messages0bz2", "messagess.0bz2", "message.0bz2", "messagess.0bz2", "messagess0bz2", "messages0.bz2", "messages.00.bz2", "messagess.0.bz2", "message.0.bz2", "messagess.0.bz2", "messagess0.bz2", "messages.1.bz2", "messages.01.bz2", "messages1bz2", "messagess.1bz2", "message.1bz2", "messagess.1bz2", "messagess1bz2", "messages1.bz2", "messagess.1.bz2", "message.1.bz2", "messagess.1.bz2", "messagess1.bz2", "messages.2.bz2", "messages.02.bz2", "messages2bz2", "messagess.2bz2", "message.2bz2", "messagess.2bz2", "messagess2bz2", "messages2.bz2", "messagess.2.bz2", "message.2.bz2", "messagess.2.bz2", "messagess2.bz2", "messages2xbz2", "messagess.2xbz2", "message.2xbz2", "messagess.2xbz2", "messagess2xbz2", "messagessx2xbz2", "messagex2xbz2", "messagessx2xbz2", "messages.10.bz2", "messages..0.bz2", "messages00000000.bz2", "messages000000000000.bz2", "messages00000000000.bz2", "messages000000.bz2", "messages00000000xbz2", "messages000000000000xbz2", "messages00000000000xbz2", "messages000000xbz2", "messages-00000000.bz2", "messages-000000000000.bz2", "messages-00000000000.bz2", "messages-000000.bz2", "messages.00000000.bz2", "messages.000000000000.bz2", "messages.00000000000.bz2", "messages.000000.bz2", "messages.00000000xbz2", "messages.000000000000xbz2", "messages.00000000000xbz2", "messages.000000xbz2", "messages:00000000xbz2", "messages:000000000000xbz2", "messages:00000000000xbz2", "messages:000000xbz2", "messages.xxxxxxxxxbz2", "messages.xxxxxxxxxxxxxbz2", "messages.xxxxxxxxxxxxbz2", "messages.xxxxxxxbz2", "messages..........bz2", "messages..............bz2", "messages.............bz2", "messages........bz2", "messages11111111.bz2", "messages111111111111.bz2", "messages11111111111.bz2", "messages111111.bz2", "messages11111111xbz2", "messages111111111111xbz2", "messages11111111111xbz2", "messages111111xbz2", "messages-11111111.bz2", "messages-111111111111.bz2", "messages-11111111111.bz2", "messages-111111.bz2", "messages.11111111.bz2", "messages.111111111111.bz2", "messages.11111111111.bz2", "messages.111111.bz2", "messages.11111111xbz2", "messages.111111111111xbz2", "messages.11111111111xbz2", "messages.111111xbz2", "messages:11111111xbz2", "messages:111111111111xbz2", "messages:11111111111xbz2", "messages:111111xbz2", ); foreach my $ramsch (glob TESTDIR."/var/tmp/*") { unlink $ramsch; } foreach my $ramsch (@archives) { if ($ramsch =~ /gz$/) { open (RAMSCH, "| gzip >".TESTDIR."/var/tmp/".$ramsch); } elsif ($ramsch =~ /bz2$/) { open (RAMSCH, "| bzip2 >".TESTDIR."/var/tmp/".$ramsch); } else { open (RAMSCH, ">".TESTDIR."/var/tmp/".$ramsch); } printf RAMSCH "ramsch %s %d\n", $ramsch, rand 10000; # win32 fingerprint is the content close RAMSCH; } } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/tmp/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); delete_and_create_ramsch(); printf "look into %s\n", TESTDIR."/var/tmp/"; sleep 1; $ssh->trace("initial run"); $cl->run(); $ssh->{rotation} = "loglogdate8gz"; #$ssh->{rotation} = sprintf '^%s[\.\-]{0,1}[0-9]{8}\.gz$', $ssh->{logbasename}; $ssh->prepare(); $ssh->{logrotated} = 1; $ssh->{logmodified} = 1; $ssh->{laststate}->{logtime} = 0; $ssh->collectfiles(); diag(sprintf "pattern is /%s/", $ssh->{filenamepattern}); foreach (map { $_->{filename} } @{$ssh->{relevantfiles}}) { diag($_); } ok(scalar(@{$ssh->{relevantfiles}}) == 7); $ssh->{rotation} = "loglogdate8bz2"; #$ssh->{rotation} = sprintf '^%s[\.\-]{0,1}[0-9]{8}\.gz$', $ssh->{logbasename}; $ssh->prepare(); $ssh->{logrotated} = 1; $ssh->{logmodified} = 1; $ssh->{laststate}->{logtime} = 0; $ssh->collectfiles(); diag(sprintf "pattern is /%s/", $ssh->{filenamepattern}); foreach (map { $_->{filename} } @{$ssh->{relevantfiles}}) { diag($_); } ok(scalar(@{$ssh->{relevantfiles}}) == 7); $ssh->{rotation} = "loglog0log1gz"; #$ssh->{rotation} = sprintf '^%s\.((0)|([1-9]+\.gz))$', $ssh->{logbasename}, $ssh->{logbasename}; $ssh->prepare(); $ssh->{logrotated} = 1; $ssh->{logmodified} = 1; $ssh->{laststate}->{logtime} = 0; $ssh->collectfiles(); diag(sprintf "pattern is /%s/", $ssh->{filenamepattern}); foreach (map { $_->{filename} } @{$ssh->{relevantfiles}}) { diag($_); } ok(scalar(@{$ssh->{relevantfiles}}) == 8); $ssh->{rotation} = "loglog0gzlog1gz"; #$ssh->{rotation} = sprintf '^%s\.((0)|([1-9]+[0-9]*))\.gz$', $ssh->{logbasename}, $ssh->{logbasename}; $ssh->prepare(); $ssh->{logrotated} = 1; $ssh->{logmodified} = 1; $ssh->{laststate}->{logtime} = 0; $ssh->collectfiles(); diag(sprintf "pattern is /%s/", $ssh->{filenamepattern}); foreach (map { $_->{filename} } @{$ssh->{relevantfiles}}) { diag($_); } ok(scalar(@{$ssh->{relevantfiles}}) == 9); $ssh->{rotation} = "loglog0log1"; #$ssh->{rotation} = sprintf '^%s\.((0)|([1-9]+[0-9]*))$', $ssh->{logbasename}, $ssh->{logbasename}; $ssh->prepare(); $ssh->{logrotated} = 1; $ssh->{logmodified} = 1; $ssh->{laststate}->{logtime} = 0; $ssh->collectfiles(); diag(sprintf "pattern is /%s/", $ssh->{filenamepattern}); foreach (map { $_->{filename} } @{$ssh->{relevantfiles}}) { diag($_); } ok(scalar(@{$ssh->{relevantfiles}}) == 5); check_logfiles-4.1.1/t/019seekmigrate.t0000664000175000017500000000462114336703157014577 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/019seekmigrate.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 4; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ cfgbase => 'cfgcfg', protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # # now we have a seekfile with a 2.0 filename. transform it into a pre-2.0 # formatted seekfile # $ssh->revert_seekfile(); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # 4 nothing happened in the meantime $ssh->trace(sprintf "+----------------------- test %d ------------------", 4); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); check_logfiles-4.1.1/t/015timeout.t0000664000175000017500000000327114336703157013761 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/005negative.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 1; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < "action", protocolsdir => "./var/tmp", logfile => "./var/adm/messages", criticalpatterns => [ '.*ERROR.*', ], options => 'script', script => "send_snmptrap" }, { tag => "action2", protocolsdir => "./var/tmp", logfile => "./var/adm/messages", criticalpatterns => [ '.*ERROR.*', ], options => 'script', script => "send_snmptrap" }, ); EOCFG open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); my $action = $cl->get_search_by_tag("action"); my $action2 = $cl->get_search_by_tag("action2"); $action->delete_seekfile(); $action2->delete_seekfile(); $action->loggercrap(undef, undef, 100); $action2->loggercrap(undef, undef, 100); $cl->run(); #init sleep 1; $cl->reset(); $action->{script} = sub { sleep 5; return 3; }; $action2->{script} = sub { sleep 1; return 3; }; $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 10, " ERROR "); $action->loggercrap(undef, undef, 100); sleep 1; $cl->{timeout} = 10; my $now = time; $cl->run(); my $elapsed = time - $now; diag(sprintf "aborted after %d seconds", $elapsed); ok($elapsed > 16 && $elapsed < 20); check_logfiles-4.1.1/t/005norotation.t0000664000175000017500000001602114336703157014463 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/005norotation.t # # Test logfiles which will be deleted and recreated instead of rotated. # # fill a logfile with crap. run. must be ok # add criticals. run. must be critical # delete logfile. add crap. run. must be ok. tracefile must mention recreation # add errors. run .must be critical # delete logfile. run. must be critical # add 100 lines of crap. run. must be ok # delete logfile. add 10 lines of criticals. add 10 lines of crap. run. must be critical # delete logfile. run. must be critical # add 100 lines of crap. run. must be ok # delete logfile. add 10 lines of criticals. add 100 lines of crap. run. must be critical # delete logfile. touch logfile. run. must be ok. # the same with no_logfile_no_cry => 1 use strict; use Test::More tests => 22; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $ssh->trace("==== 1 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 500); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 2 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $ssh->trace("==== 3 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 4 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 200); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 200); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $ssh->trace("==== 5 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); $ssh->trace("==== 6 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 100); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 7 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->logger(undef, undef, 10, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 10, 0, 2)); $ssh->trace("==== 8 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); $ssh->trace("==== 9 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 10 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->logger(undef, undef, 10, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 100); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 10, 0, 2)); $ssh->trace("==== 11 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->touch_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # # # # now scream on deleted logfiles # $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "nologfilenocry" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $ssh->trace("==== 12 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 13 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 200); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 200); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $ssh->trace("==== 14 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 200); $ssh->loggercrap(undef, undef, 200); $ssh->loggercrap(undef, undef, 200); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 15 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 200); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 200); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $ssh->trace("==== 16 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 17 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 100); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 18 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->logger(undef, undef, 10, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 10, 0, 2)); $ssh->trace("==== 19 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 20 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 100); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 21 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->logger(undef, undef, 10, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 100); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 10, 0, 2)); $ssh->trace("==== 22 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->touch_logfile(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); check_logfiles-4.1.1/t/007thresholdok.t0000664000175000017500000001474514336703157014632 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/007thresholdok.t # # Test that all the Perl modules we require are available. # Simulate a portscan. Connections to port 80 are ok. # use strict; use Test::More tests => 11; use Cwd; use Data::Dumper; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; # # Count the hits, but reset the counter to 0 if an okpattern was found # # Case 1: nosavethresholdcount # reset # 9 criticals, 2 warnings # run: OK # 19 criticals, 12 warnings, 1 ok # run: OK # 19 criticals, ok, 9 criticals # run: OK # 19 criticals, ok, 19 criticals # run: CRITICAL (19) # my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, okpatterns => [ 'sshd restarted', ], options => 'criticalthreshold=10,warningthreshold=3,nosavethresholdcount', }] }); my $nmap = $cl->get_search_by_tag("nmap"); $cl->reset(); $nmap->delete_logfile(); $nmap->delete_seekfile(); diag("deleted logfile and seekfile"); $nmap->trace("deleted logfile and seekfile"); $nmap->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ## reset run $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 9, "connection refused"); # skip 9 -> 0 $nmap->logger(undef, undef, 2, "connection on port 80"); # skip 2 -> 0 $cl->run(); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); diag($cl->has_result()); diag($cl->{exitmessage}); diag("not enough errors/warnings"); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 19, "connection refused"); # skip 9, 1, skip 9 -> 1 $nmap->logger(undef, undef, 12, "connection on port 80"); # skip 2 -> 4 $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 2, "sshd restarted"); # 0WC $cl->run(); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); diag($cl->has_result()); diag($cl->{exitmessage}); diag("no errors/warnings. have been resetted"); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 19, "connection refused"); # skip 9, 1, skip 9 -> 1 $nmap->logger(undef, undef, 2, "sshd restarted"); # 0WC $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 9, "connection refused"); # skip 9 -> 0 $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag("no errors/warnings. have been resetted"); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 19, "connection refused"); # skip 9, 1, skip 9 -> 1 $nmap->logger(undef, undef, 2, "sshd restarted"); # 0WC $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 19, "connection refused"); # $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # # Case 2: savethresholdcount # reset # 9 criticals, 2 warnings # run: OK # 19 criticals, 12 warnings, 1 ok # run: OK # 19 criticals, ok, 9 criticals # run: OK # 19 criticals, ok, 9 criticals # run: OK # 19 criticals # run: CRITICAL (18) # $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, okpatterns => [ 'sshd restarted', ], options => 'criticalthreshold=10,warningthreshold=3,savethresholdcount', }] }); $nmap = $cl->get_search_by_tag("nmap"); $cl->reset(); $nmap->delete_logfile(); $nmap->delete_seekfile(); diag("deleted logfile and seekfile"); $nmap->trace("deleted logfile and seekfile"); $nmap->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ## reset run $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 9, "connection refused"); # skip 9 -> 0 $nmap->logger(undef, undef, 2, "connection on port 80"); # skip 2 -> 0 $cl->run(); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); diag($cl->has_result()); diag($cl->{exitmessage}); diag("not enough errors/warnings"); ok($cl->expect_result(0, 0, 0, 0, 0)); # counter is 9c2w $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 19, "connection refused"); # 1, skip 9, 1, skip 9 -> 2 $nmap->logger(undef, undef, 12, "connection on port 80"); # ...skip 2 -> 4 $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 2, "sshd restarted"); # 0WC $nmap->logger(undef, undef, 9, "connection refused"); # skip 9 -> 0 $nmap->logger(undef, undef, 2, "connection on port 80"); # skip 2 -> 0 $cl->run(); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); diag($cl->has_result()); diag($cl->{exitmessage}); diag("no errors/warnings. but there are counted hits 9c2w"); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 9) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 2)); $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 19, "connection refused"); # skip 9, 1, skip 9 -> 1 $nmap->loggercrap(undef, undef, 100); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag("no errors/warnings. have been resetted"); ok($cl->expect_result(0, 0, 2, 0, 2)); # 8 left ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 8) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 2)); diag(Data::Dumper::Dumper($nmap->{newstate}->{thresholdcnt})); check_logfiles-4.1.1/t/041wevtutil.t0000664000175000017500000001437014336703157014157 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/040eventlog.t # # Test that all the Perl modules we require are available. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use Nagios::CheckLogfiles::Search::Eventlog; use constant TESTDIR => "."; if (($^O ne "cygwin") and ($^O !~ /MSWin/)) { diag("this is not a windows machine"); plan skip_all => 'Test only relevant on Windows'; } else { plan tests => 12; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "app", type => "wevtutil", criticalpatterns => ["Adobe", "Photoshop" ], warningpatterns => ["Battery low" ], wevtutil => { eventlog => "application", } } ] }); $cl->make_windows_plugin(); my $app = $cl->get_search_by_tag("app"); $app->delete_seekfile(); $app->trace("deleted seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $app->trace(sprintf "+----------------------- test %d ------------------", 1); sleep 2; $app->trace("initial run"); $cl->run(); # cleanup diag("cleanup"); $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $app->trace(sprintf "+----------------------- test %d ------------------", 2); sleep 30; $app->logger(undef, undef, 1, "Photoshop problem"); $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 3 now find the two criticals and the two warnings $app->trace(sprintf "+----------------------- test %d ------------------", 3); sleep 120; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 2 now find the two criticals $app->trace(sprintf "+----------------------- test %d ------------------", 4); $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem2"); $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); #ok($cl->expect_result(0, 0, 6, 0, 2)); $cl->{perfdata} =~ /.*'app_criticals'=(\d+).*/; my $found = $1; diag(sprintf "reported %d errors so far. %d to come", $found, 6 - $found); ok($cl->{exitmessage} =~ /CRITICAL/); # 3 now find the two criticals and the two warnings $app->trace(sprintf "+----------------------- test %d ------------------", 5); sleep 65; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); if ($found == 6) { ok($cl->expect_result(0, 0, 0, 0, 0)); } else { ok($cl->expect_result(0, 0, 6 - $found, 0, 2)); } $app->logger(undef, undef, 2, "Alert: Battery low"); sleep 1; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); ###################################################### # lem"); $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $app->trace(sprintf "+----------------------- test %d ------------------", 4); $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $app->logger(undef, undef, 1, "Photoshop problem2"); $app->logger(undef, undef, 1, "Photoshop problem"); sleep 10; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); #ok($cl->expect_result(0, 0, 6, 0, 2)); $cl->{perfdata} =~ /.*'app_criticals'=(\d+).*/; $found = $1; diag(sprintf "reported %d errors so far. %d to come", $found, 6 - $found); ok($cl->{exitmessage} =~ /CRITICAL/); # 3 now find the two criticals and the two warnings $app->trace(sprintf "+----------------------- test %d ------------------", 5); sleep 65; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); if ($found == 6) { ok($cl->expect_result(0, 0, 0, 0, 0)); } else { ok($cl->expect_result(0, 0, 6 - $found, 0, 2)); } $app->logger(undef, undef, 2, "Alert: Battery low"); sleep 1; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); ###################################################### # # powershell -Command "echo hihi" # leaves # "PowerShell-Konsole wird gestartet." # and # siehe 041wevtutilps # and # "PowerShell-Konsole ist für Benutzereingaben bereit." # in # Microsoft-Windows-PowerShell/Operational diag("check the new channels"); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "msps", type => "wevtutil", criticalpatterns => ["Microsoft", "PowerShell.*(ready|bereit)" ], warningpatterns => ["PowerShell.*(started|gestartet)" ], warningexceptions => ["PowerShell.*DefaultAppDomain.*(started|gestartet)" ], wevtutil => { eventlog => "Microsoft-Windows-PowerShell/Operational", } } ] }); my $msps = $cl->get_search_by_tag("msps"); $msps->delete_seekfile(); $msps->trace("deleted seekfile"); $app->trace("initial run"); diag("cleanup"); $cl->reset_run(); # cleanup. it may find powershells from the last test run $cl->reset_run(); # now a reset run diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find 1 w 1 c $app->trace(sprintf "+----------------------- test %d ------------------", 2); diag("start the powershell"); system('powershell -Command "echo hihi"'); sleep 5; $cl->reset_run(); diag($cl->has_result()); diag($cl->{exitmessage}); printf "%s\n", Data::Dumper::Dumper($cl->{allerrors}); $msps = $cl->get_search_by_tag("msps"); printf "%s\n", Data::Dumper::Dumper($msps->{matchlines}); ok($cl->expect_result(0, 1, 1, 0, 2)); $cl->remove_windows_plugin(); check_logfiles-4.1.1/t/087randominode.t0000664000175000017500000001151614336703157014604 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/087randominode.t use strict; use Test::More tests => 11; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; sub changeinode { my $file = shift; printf "%s:%s:%s .. ", (stat $file)[0], (stat $file)[1], (stat $file)[7]; open TEMP1, ">temp1"; open LOG, $file; while () { print TEMP1 $_; } close LOG; close TEMP1; open TEMP2, ">temp2"; open TEMP1, "temp1"; while () { print TEMP2 $_; } close TEMP1; close TEMP2; unlink $file; rename "temp2", $file; printf "%s:%s:%s\n", (stat $file)[0], (stat $file)[1], (stat $file)[7]; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "randominode", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $ssh->trace("==== 1 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 500); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # ok this time don't touch the logfile $ssh->trace("==== 2 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now the inode changes # changeinode(TESTDIR."/var/adm/messages"); $ssh->trace("==== 3 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now the inode changes once more # changeinode(TESTDIR."/var/adm/messages"); $ssh->trace("==== 4 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 200); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 200); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $ssh->trace("==== 5 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 500); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); undef $cl; undef $ssh; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "randominode", rotation => 'loglog0log1', } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $ssh->trace("==== 1 ===="); sleep 1; $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 500); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # ok this time don't touch the logfile $ssh->trace("==== 2 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now the inode changes # changeinode(TESTDIR."/var/adm/messages"); $ssh->trace("==== 3 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now the inode changes once more # and rotate # changeinode(TESTDIR."/var/adm/messages"); rename TESTDIR."/var/adm/messages", TESTDIR."/var/adm/messages.0"; $ssh->trace("==== 4 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 200); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 200); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); changeinode(TESTDIR."/var/adm/messages"); $ssh->trace("==== 5 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 500); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); changeinode(TESTDIR."/var/adm/messages"); $ssh->trace("==== 6 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 200); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 200); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); check_logfiles-4.1.1/t/026case.t0000664000175000017500000000473214336703157013213 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/026case.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 3; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["Failed password", "!OKOK" ], warningpatterns => "Unknown user", warningexceptions => "Unknown user sepp", options => "nocase" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "FAIlEd pAsswOrd fOr InvAlId UsEr1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "OKOK"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "FAIlEd pAsswOrd fOr InvAlId UsEr2..."); $ssh->logger(undef, undef, 2, "OKOK"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown USER SEPP"); # exception $ssh->logger(undef, undef, 2, "Unknown USER HIASL"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "OKok"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); check_logfiles-4.1.1/t/077tivoli.t0000664000175000017500000004625714336703157013624 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/001simple.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 14; use Cwd; use lib "../plugins-scripts"; use Nagios::Tivoli::Config::Logfile; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; #my $tivoli = Nagios::Tivoli::Config::Logfile->new({ # formatfile => ["./etc/syslog_enh_logfile_linux.fmt2"], #}); my @privatestates = (); if ($^O =~ /MSWin/) { -f 'etc/tivoli.cfg' && system ('DEL /Q /S /F .\etc\tivoli.cfg'); } else { -f 'etc/tivoli.cfg' && system ("rm -rf etc/tivoli.cfg"); } my $configfile =< "tivtest", logfile => "./var/adm/messages", tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt"], #tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt2"], options => "supersmartscript", script => sub { \$tivoli = \$CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}; if (\$tivoli->{format_name} ne "NO MATCHING RULE") { printf "%s", \$CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}->{subject}; return \$tivoli->{exit_code}; } else { printf "%s", \$ENV{CHECK_LOGFILES_SERVICEOUTPUT}; return 2; } } } ); EOCFG open CCC, ">./etc/tivoli.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/tivoli.cfg"}); my $tivtest = $cl->get_search_by_tag("tivtest"); $tivtest->delete_logfile(); $tivtest->delete_seekfile(); $tivtest->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $tivtest->trace("initial run"); $tivtest->logger(undef, undef, 1, "start tivoli testing"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); my @examples = ( 'gateway1 Server Administrator: Instrumentation Service EventID: 1354 Power supply detected a failure Sensor location: PS 2 Status Chassis location: Main System Chassis Previous state was: Unknown Power Supply type: AC Power Supply state: Presence detected, Failure detected, AC lost', 'gateway1 Server Administrator: Instrumentation Service EventID: 1012 IPMI status Interface: OS', 'gateway1 Server Administrator: Instrumentation Service EventID: 1001 Server Administrator startup complete', 'gateway1 Server Administrator: Storage Service EventID: 2164 See readme.txt for a list of validated controller driver versions.', 'gateway1 Server Administrator: Instrumentation Service EventID: 1000 Server Administrator starting', 'gateway1 Server Administrator: Instrumentation Service EventID: 1306 Redundancy lost Redundancy unit: BMC PS Redundancy Chassis location: Main System Chassis Previous redundancy state was: Unknown', 'gateway1 Server Administrator: Instrumentation Service EventID: 1354 Power supply detected a failure Sensor location: PS 2 Status Chassis location: Main System Chassis Previous state was: Unknown Power Supply type: AC Power Supply state: Presence detected, Failure detected, AC lost', 'gateway1 Server Administrator: Instrumentation Service EventID: 1012 IPMI status Interface: OS', 'gateway1 Server Administrator: Instrumentation Service EventID: 1001 Server Administrator startup complete', 'gateway1 Server Administrator: Storage Service EventID: 2164 See readme.txt for a list of validated controller driver versions.', 'gateway1 Server Administrator: Instrumentation Service EventID: 1000 Server Administrator starting', 'gateway1 Server Administrator: Instrumentation Service EventID: 1306 Redundancy lost Redundancy unit: BMC PS Redundancy Chassis location: Main System Chassis Previous redundancy state was: Unknown', 'gateway1 Server Administrator: Instrumentation Service EventID: 1354 Power supply detected a failure Sensor location: PS 2 Status Chassis location: Main System Chassis Previous state was: Unknown Power Supply type: AC Power Supply state: Presence detected, Failure detected, AC lost', 'gateway1 Server Administrator: Instrumentation Service EventID: 1012 IPMI status Interface: OS', 'gateway1 Server Administrator: Instrumentation Service EventID: 1001 Server Administrator startup complete', 'gateway1 Server Administrator: Storage Service EventID: 2164 See readme.txt for a list of validated controller driver versions.', 'gateway1 Server Administrator: Instrumentation Service EventID: 1053 Temperature sensor detected a warning value Sensor location: BMC Ambient Temp Chassis location: Main System Chassis Previous state was: OK (Normal) Temperature sensor value (in Degrees Celsius): 21.0', 'gateway1 Server Administrator: Instrumentation Service EventID: 1052 Temperature sensor returned to a normal value Sensor location: BMC Ambient Temp Chassis location: Main System Chassis Previous state was: Non-Critical (Warning) Temperature sensor value (in Degrees Celsius): 20.0' ); $tivtest->trace(sprintf "+----------------------- test %d ------------------", 1); # MINOR/1 Log_Linux_HW_Dell_Error # %t %s Server Administrator: %s Service EventID: %s4 %s* # -V3 $3 # -V4 $4 # -V5 $5 # silo PRINTF("%s4", V4) # msg PRINTF("%s Service EventID: %s4 %s", V3, V4, V5) # severity MINOR # END # FORMAT *DISCARD* # %t %s Server Administrator: Storage Service EventID: %s* #END $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Storage Service EventID: 1004 on PE 1850"); # -V3 Storage # -V4 100 # -V5 on PE 1850 # silo PRINTF("%s4", V4) = 1004 # msg PRINTF("%s Service EventID: %s4 %s", V3, V4, V5) # = Storage Service EventID: 1004 on PE 1850 # fliegt aber raus wg discard # deshalb nochmal aber ohne Storage $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Power Service EventID: 1004 on PE 1850"); # = Power Service EventID: 1004 on PE 1850 # DISCARD* (Log_Linux_HW_Dell_Error) # %t %s Server Administrator: %s Service EventID: 1304 %s* $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Storage Service EventID: 1304 on PE 1850"); # FORMAT Logfile_Base # %t %s %s* # hostname LABEL # adapter_host LABEL # date $1 # origin $2 # msg $3 # END # FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base # %t %s ServerView RAID: [0013][%s] %s* # id 0013 # msg $4 # severity CRITICAL # END # CRITICAL/2 Log_Linux_HW_Serverview FOLLOWS Logfile_Base # %t %s ServerView RAID: [0013][%s] %s* $tivtest->logger("fjssrv", "ServerView RAID:", 1,"[0013][IO_ERR] io timeout"); # io timeout # MINOR/1 Log_Unix_ClusterStatus # FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base # %t %s %s CLUSTERSTATUS %s* # -V3 $3 # -V4 $4 # msg PRINTF("%s CLUSTERSTATUS %s", V3, V4) # severity MINOR # END $tivtest->logger('fjssrv', 'hacluster', 1, "CLUSTERSTATUS no response from cluster peer"); # hacluster CLUSTERSTATUS no response from cluster peer # CRITICAL/2 Log_Unix_ClusterStatus # FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base # %t %s %s CLUSTERSTATUS %s* is in faulted or inconsistent state ! # -V3 $3 # -V4 $4 # msg PRINTF("%s CLUSTERSTATUS %s is in faulted or inconsistent state !", V3, V4) # severity CRITICAL # END # %t %s %s CLUSTERSTATUS %s* is in faulted or inconsistent state ! $tivtest->logger('fjssrv', 'hacluster', 1, "CLUSTERSTATUS cluster forsc is in faulted or inconsistent state !"); # hacluster CLUSTERSTATUS cluster forsc is in faulted or inconsistent state ! #$tivtest->loggercrap(undef, undef, 100); sleep 1; $tivtest->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # 2 now find the two criticals $tivtest->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); #$tivtest->loggercrap(undef, undef, 10); # MINOR $tivtest->logger('srvxy', 'Server Administrator:', 2, "Screen Service EventID: 113 screen is black"); # Screen Service EventID: 113 screen is black # CRITICAL $tivtest->logger('srvxy', "ServerView RAID:", 2, "[0426][MIRR_KAPUTT] mirror broken"); # mirror broken # MINOR $tivtest->logger('srvxy', "ServerView RAID:", 1, "Drive Array Device Failure battery low"); # ServerView RAID: Drive Array Device Failure battery low #$tivtest->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 2, 0, 2)); ok (${$tivtest->{matchlines}->{WARNING}}[0]->[1] eq "Screen Service EventID: 113 screen is black"); ok (${$tivtest->{matchlines}->{WARNING}}[1]->[1] eq "Screen Service EventID: 113 screen is black"); ok (${$tivtest->{matchlines}->{CRITICAL}}[0]->[1] eq "Raid kaputt: mirror broken"); # 6 ok (${$tivtest->{matchlines}->{CRITICAL}}[1]->[1] eq "Raid kaputt: mirror broken"); ok (${$tivtest->{matchlines}->{WARNING}}[2]->[1] eq "ServerView RAID: Drive Array Device Failure battery low"); #diag(Data::Dumper::Dumper($tivtest->{matchlines})); #diag(Data::Dumper::Dumper($tivtest->{privatestate})); #diag(Data::Dumper::Dumper($cl->{privatestate}->{tivtest})); #diag(Data::Dumper::Dumper($tivtest)); #diag(Data::Dumper::Dumper($cl)); diag("-----------------------"); diag("-----multiline------------------"); diag("-----------------------"); $cl->reset(); # Log_Linux_HW_GAM (silo B) #$tivtest->loggercrap(undef, undef, 10); #$tivtest->logger(undef, undef, 1, "SeqNo=4 ctl=0 chn=0 tgt=0 lun=0 Event= 87:MLXEV_SYSDEV_CRITICAL occurred at Fri Jun 5 12:26:47 2009 and logged at Fri Jun 5 12:26:47 2009", 1); #$tivtest->logger(undef, undef, 1, "SeqNo=4 ctl=0 chn=0 tgt=0 lun=0 Event= B:MLYEV_SYSDEV_CRITICAL occurred at Fri Jun 5 12:27:47 2009 and logged at Fri Jun 5 12:27:47 2009", 1); #$tivtest->logger(undef, undef, 1, "SeqNo=4 ctl=0 chn=0 tgt=0 lun=0 Event= XY:MLYEV_SYSTEM_CRITICAL occurred at Fri Jun 5 12:27:47 2009 and logged at Fri Jun 5 12:27:47 2009", 1); $tivtest->logger(undef, undef, 1, "SeqNo=4 ctl=0 chn=0 tgt=0 lun=0 Event= 87:MLXEV_SYSDEV_CRITICAL", 1); $tivtest->logger(undef, undef, 1, " occurred at Fri Jun 5 12:26:47 2009 and logged at Fri Jun 5 12:26:47 2009", 1); $tivtest->logger(undef, undef, 1, "SeqNo=8 ctl=0 chn=0 tgt=0 lun=0 Event= XY:MLXEV_SYSDEV_AECHZ", 1); $tivtest->logger(undef, undef, 1, " occurred at Fri Jun 5 12:28:47 2009 and logged at Fri Jun 5 12:28:47 2009", 1); #$tivtest->loggercrap(undef, undef, 10); #%s* Event= B:%s%n occurred at %s* and logged at %s* # erbt msg PRINTF("%s Event= %s:%s", V1, silo, msgpart) sleep 1; $cl->run(); diag("now run"); #printf STDERR "%s\n", Data::Dumper::Dumper($tivtest->{matchlines}); ok(${$tivtest->{matchlines}->{WARNING}}[0]->[1] =~ /.+ Event= 87:MLXEV_SYSDEV_CRITICAL$/); ok(${$tivtest->{matchlines}->{WARNING}}[1]->[1] eq "SeqNo=8 ctl=0 chn=0 tgt=0 lun=0 Event= XY:MLXEV_SYSDEV_AECHZ"); diag($cl->has_result()); diag($cl->{exitmessage}); #diag(Data::Dumper::Dumper($tivtest->{matchlines})); #diag(Data::Dumper::Dumper($tivtest->{privatestate})); ################################################################### # nochmal abschnitt 1 aber mit anderem mapping # minor => critical # critical => critical diag ("modify mappings"); if ($^O =~ /MSWin/) { -f 'etc/tivoli2.cfg' && system ('DEL /Q /S /F .\etc\tivoli2.cfg'); } else { -f 'etc/tivoli2.cfg' && system ("rm -rf etc/tivoli2.cfg"); } sleep 1; $configfile =< "tivtest2", logfile => "./var/adm/messages", tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt"], #tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt2"], tivolimapping => { minor => 2, warning => 2, critical => 2, }, options => "supersmartscript", script => sub { \$tivoli = \$CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}; if (\$tivoli->{format_name} ne "NO MATCHING RULE") { printf "%s", \$CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}->{subject}; return \$tivoli->{exit_code}; } else { printf "%s", \$ENV{CHECK_LOGFILES_SERVICEOUTPUT}; return 2; } } } ); EOCFG open CCC, ">./etc/tivoli2.cfg"; print CCC $configfile; close CCC; sleep 1; undef $cl; my $xcl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/tivoli2.cfg"}); $tivtest = $xcl->get_search_by_tag("tivtest2"); $tivtest->delete_logfile(); $tivtest->delete_seekfile(); $tivtest->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $tivtest->trace("initial run"); $tivtest->logger(undef, undef, 1, "start tivoli testing"); $xcl->run(); diag($xcl->has_result()); diag($xcl->{exitmessage}); ok($xcl->expect_result(0, 0, 0, 0, 0)); # MINOR/1 Log_Linux_HW_Dell_Error # %t %s Server Administrator: %s Service EventID: %s4 %s* # -V3 $3 # -V4 $4 # -V5 $5 # silo PRINTF("%s4", V4) # msg PRINTF("%s Service EventID: %s4 %s", V3, V4, V5) # severity MINOR # END # FORMAT *DISCARD* # %t %s Server Administrator: Storage Service EventID: %s* #END $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Storage Service EventID: 1004 on PE 1850"); # -V3 Storage # -V4 100 # -V5 on PE 1850 # silo PRINTF("%s4", V4) = 1004 # msg PRINTF("%s Service EventID: %s4 %s", V3, V4, V5) # = Storage Service EventID: 1004 on PE 1850 # fliegt aber raus wg discard # deshalb nochmal aber ohne Storage $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Power Service EventID: 1004 on PE 1850"); # = Power Service EventID: 1004 on PE 1850 # DISCARD* (Log_Linux_HW_Dell_Error) # %t %s Server Administrator: %s Service EventID: 1304 %s* $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Storage Service EventID: 1304 on PE 1850"); # FORMAT Logfile_Base # %t %s %s* # hostname LABEL # adapter_host LABEL # date $1 # origin $2 # msg $3 # END # FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base # %t %s ServerView RAID: [0013][%s] %s* # id 0013 # msg $4 # severity CRITICAL # END # CRITICAL/2 Log_Linux_HW_Serverview FOLLOWS Logfile_Base # %t %s ServerView RAID: [0013][%s] %s* $tivtest->logger("fjssrv", "ServerView RAID:", 1,"[0013][IO_ERR] io timeout"); # io timeout # MINOR/1 Log_Unix_ClusterStatus # FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base # %t %s %s CLUSTERSTATUS %s* # -V3 $3 # -V4 $4 # msg PRINTF("%s CLUSTERSTATUS %s", V3, V4) # severity MINOR # END $tivtest->logger('fjssrv', 'hacluster', 1, "CLUSTERSTATUS no response from cluster peer"); # hacluster CLUSTERSTATUS no response from cluster peer # CRITICAL/2 Log_Unix_ClusterStatus # FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base # %t %s %s CLUSTERSTATUS %s* is in faulted or inconsistent state ! # -V3 $3 # -V4 $4 # msg PRINTF("%s CLUSTERSTATUS %s is in faulted or inconsistent state !", V3, V4) # severity CRITICAL # END # %t %s %s CLUSTERSTATUS %s* is in faulted or inconsistent state ! $tivtest->logger('fjssrv', 'hacluster', 1, "CLUSTERSTATUS cluster forsc is in faulted or inconsistent state !"); # hacluster CLUSTERSTATUS cluster forsc is in faulted or inconsistent state ! #$tivtest->loggercrap(undef, undef, 100); sleep 1; $tivtest->trace("initial run"); $xcl->run(); diag($xcl->has_result()); diag($xcl->{exitmessage}); ok($xcl->expect_result(0, 0, 4, 0, 2)); ################################################################### # nochmal aber ohne handler-script # minor => critical # critical => critical diag ("no handler"); if ($^O =~ /MSWin/) { -f 'etc/tivoli3.cfg' && system ('DEL /Q /S /F .\etc\tivoli3.cfg'); } else { -f 'etc/tivoli3.cfg' && system ("rm -rf etc/tivoli3.cfg"); } sleep 1; $configfile =< "tivtest2", logfile => "./var/adm/messages", tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt"], tivolimapping => { minor => 2, warning => 2, critical => 2, }, } ); EOCFG open CCC, ">./etc/tivoli3.cfg"; print CCC $configfile; close CCC; sleep 1; undef $cl; my $ycl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/tivoli3.cfg"}); $tivtest = $ycl->get_search_by_tag("tivtest2"); $tivtest->delete_logfile(); $tivtest->delete_seekfile(); $tivtest->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $tivtest->trace("initial run"); $tivtest->logger(undef, undef, 1, "start tivoli testing"); $ycl->run(); diag($ycl->has_result()); diag($ycl->{exitmessage}); ok($ycl->expect_result(0, 0, 0, 0, 0)); # MINOR/1 Log_Linux_HW_Dell_Error # %t %s Server Administrator: %s Service EventID: %s4 %s* # -V3 $3 # -V4 $4 # -V5 $5 # silo PRINTF("%s4", V4) # msg PRINTF("%s Service EventID: %s4 %s", V3, V4, V5) # severity MINOR # END # FORMAT *DISCARD* # %t %s Server Administrator: Storage Service EventID: %s* #END $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Storage Service EventID: 1004 on PE 1850"); # -V3 Storage # -V4 100 # -V5 on PE 1850 # silo PRINTF("%s4", V4) = 1004 # msg PRINTF("%s Service EventID: %s4 %s", V3, V4, V5) # = Storage Service EventID: 1004 on PE 1850 # fliegt aber raus wg discard # deshalb nochmal aber ohne Storage $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Power Service EventID: 1004 on PE 1850"); # = Power Service EventID: 1004 on PE 1850 # DISCARD* (Log_Linux_HW_Dell_Error) # %t %s Server Administrator: %s Service EventID: 1304 %s* $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Storage Service EventID: 1304 on PE 1850"); # MINOR/1 Log_Unix_ClusterStatus # FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base # %t %s %s CLUSTERSTATUS %s* # -V3 $3 # -V4 $4 # msg PRINTF("%s CLUSTERSTATUS %s", V3, V4) # severity MINOR # END $tivtest->logger('fjssrv', 'hacluster', 1, "CLUSTERSTATUS no response from cluster peer"); # hacluster CLUSTERSTATUS no response from cluster peer # CRITICAL/2 Log_Unix_ClusterStatus # FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base # %t %s %s CLUSTERSTATUS %s* is in faulted or inconsistent state ! # -V3 $3 # -V4 $4 # msg PRINTF("%s CLUSTERSTATUS %s is in faulted or inconsistent state !", V3, V4) # severity CRITICAL # END # %t %s %s CLUSTERSTATUS %s* is in faulted or inconsistent state ! $tivtest->logger('fjssrv', 'hacluster', 1, "CLUSTERSTATUS cluster forsc is in faulted or inconsistent state !"); # hacluster CLUSTERSTATUS cluster forsc is in faulted or inconsistent state ! # FORMAT Logfile_Base # %t %s %s* # hostname LABEL # adapter_host LABEL # date $1 # origin $2 # msg $3 # END # FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base # %t %s ServerView RAID: [0013][%s] %s* # id 0013 # msg $4 # severity CRITICAL # END # CRITICAL/2 Log_Linux_HW_Serverview FOLLOWS Logfile_Base # %t %s ServerView RAID: [0013][%s] %s* $tivtest->logger("fjssrv", "ServerView RAID:", 1,"[0013][IO_ERR] io timeout"); # io timeout $tivtest->loggercrap(undef, undef, 100); sleep 1; $ycl->run(); diag($ycl->has_result()); diag($ycl->{exitmessage}); ok($ycl->expect_result(0, 0, 4, 0, 2)); check_logfiles-4.1.1/t/059rotatewait.t0000664000175000017500000000365514336703157014474 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/o59rotatewait.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 2; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ options => "rotatewait", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["Failed password", "!OKOK" ], warningpatterns => "Unknown user", warningexceptions => "Unknown user sepp", options => "nocase" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "FAIlEd pAsswOrd fOr InvAlId UsEr1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "OKOK"); sleep 1; # # wait until **:[00,15,30,45]:00 my ($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; while ($min != 0 && $min != 15 && $min != 30 && $min != 45) { sleep 1; ($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; diag("wait.....".(scalar localtime)); } my $now = time; diag(scalar localtime); # $ssh->trace("initial run"); $cl->run(); # # must be **:**:15 diag(scalar localtime); ok((time - $now) > 14); # diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); check_logfiles-4.1.1/t/011searches.t0000664000175000017500000001073414336703157014066 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/011searches.t # # Test logfiles which will be deleted and recreated instead of rotated. # use strict; use Test::More tests => 10; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user8", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "test", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user9", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, { tag => "doppelnull", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); EOCFG open CCC, ">./etc/searches.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/searches.cfg", selectedsearches => ['ssh', 'null'] }); ok(scalar @{$cl->{searches}} == 2); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); #my $test = $cl->get_search_by_tag("test"); #$test->delete_logfile(); #$test->delete_seekfile(); #$test->trace("deleted logfile and seekfile"); my $null = $cl->get_search_by_tag("null"); $null->delete_logfile(); $null->delete_seekfile(); $null->trace("deleted logfile and seekfile"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 3-4 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 2); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 2); # ssh logs instead of test $ssh->loggercrap(undef, undef, 2); $ssh->logger(undef, undef, 2, "Failed password for invalid user9"); $ssh->loggercrap(undef, undef, 2); $null->loggercrap(undef, undef, 2); $null->logger(undef, undef, 2, "Failed password is nonsense"); $null->loggercrap(undef, undef, 2); printf "calling run for 3, 4\n"; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); ok($cl->{exitmessage} =~ /CRITICAL - \(4 errors\) - .* Failed password is nonsense /); $ssh->trace("==== 5 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 3, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 20); # ssh logs instead of test $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 200, "Failed password for invalid user9"); $ssh->loggercrap(undef, undef, 20); $null->loggercrap(undef, undef, 20); $null->logger(undef, undef, 4, "Failed password is nonsense"); $null->loggercrap(undef, undef, 20); my $command = sprintf 'perl ../plugins-scripts/check_logfiles -f ./etc/searches.cfg --searches=ssh,null'; $ssh->trace("executing %s", $command); my $output = `$command`; diag($output); diag($? >> 8); ok(($? >> 8) == 2); ok($output =~ /CRITICAL - \(7 errors .* Failed password is nonsense /); diag("only searches with .*null.*"); $command = sprintf 'perl ../plugins-scripts/check_logfiles -f ./etc/searches.cfg --searches=\'.*null.*\''; diag(sprintf "executing %s", $command); $ssh->trace("executing %s", $command); $output = `$command`; diag($output); diag($? >> 8); #ok(($? >> 8) == 2); ok($output =~ / 'null_warnings'=/); ok($output =~ / 'doppelnull_warnings'=/); diag("only searches with null"); # doppelnull wird nicht ausgefuehrt, da 'null' keine * und ? enthaelt und daher # nicht als regexp zaehlt $command = sprintf 'perl ../plugins-scripts/check_logfiles -f ./etc/searches.cfg --searches=\'null\''; diag(sprintf "executing %s", $command); $ssh->trace("executing %s", $command); $output = `$command`; diag($output); diag($? >> 8); #ok(($? >> 8) == 2); ok($output =~ / 'null_warnings'=/); ok($output !~ / 'doppelnull_warnings'=/); check_logfiles-4.1.1/t/053patterninstate.t0000664000175000017500000000477014336703157015347 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/053reportlong.t # # Test if the matching pattern appears in the privatestate # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; plan tests => 3; my @patterns = (); my $configfile =< "door", logfile => "./var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "supersmartscript", script => sub { my \$pattern = \$CHECK_LOGFILES_PRIVATESTATE->{matchingpattern}; printf "my pattern was (%s)\n", \$pattern; \$pattern =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord(\$1))/seg; printf STDERR "encoded pattern is %s\n", \$pattern; \$pattern =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex(\$1))/seg; printf STDERR "decoded pattern is %s\n", \$pattern; return 2; } } ); EOCFG open CCC, ">./etc/patterninstate.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/patterninstate.cfg"}); my $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $door->trace(sprintf "+----------------------- test %d ------------------", 1); $door->loggercrap(undef, undef, 100); sleep 1; $door->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $door->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the door openA"); $door->logger(undef, undef, 1, "the door openB"); $door->logger(undef, undef, 1, "the door openD"); $door->logger(undef, undef, 1, "the window openC"); $door->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); ok($cl->{exitmessage} =~ /my pattern was \(window open\)/); check_logfiles-4.1.1/t/093longseekfile.t0000664000175000017500000000653714336703157014760 00000000000000#!/usr/bin/perl -w # ~/check_logfiles/test/093longseekfile.t.t # Pathnames have a max length of 256. If there is a long and complicated # absolute path of a seekfile and/or a very long tag, then the seekfile # might be longer than 256 characters. This leads to an error, when the # plugin tries to write it. use strict; use Test::More tests => 4; use Cwd; use File::Basename; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if ($^O =~ /MSWin/) { system ('rd /S /Q .\var\hirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharn'); system ('md var\hirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharn'); } else { system("rm -rf ./var/hirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharn"); mkdir "./var/hirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharn"; } my $logdir = sprintf "./var/hirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharnhirnhornharn"; mkdir $logdir; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "goasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassschoasmassschoasmassschoasmassschoasmass", logfile => $logdir."/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", } ] }); my $ssh = $cl->get_search_by_tag("goasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassschoasmassschoasmassschoasmassschoasmass"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); my $beforelen = length($ssh->{tag}) + length($logdir."/messages"); my $afterlen = length(basename($ssh->{seekfile})); diag($beforelen); diag($afterlen); diag($ssh->{seekfile}); ok($beforelen > 250); # 200 plus -hash ok($afterlen < 206); check_logfiles-4.1.1/t/027errpt.t0000664000175000017500000000355314336703157013435 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/026case.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 3; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if ($^O ne "aix") { diag ("this test only runs on aix if at all"); ok(1); ok(1); ok(1); exit 0; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "mem", type => "errpt", criticalpatterns => ["Memory failure"], options => "noprotocol" } ] }); my $mem = $cl->get_search_by_tag("mem"); $mem->delete_logfile(); $mem->delete_seekfile(); $mem->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $mem->trace(sprintf "+----------------------- test %d ------------------", 1); $mem->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 2 now find the two criticals $mem->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); sleep 62; # 3 now find the two criticals and the two warnings $mem->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); sleep 300; # 3 now find the two criticals and the two warnings # $mem->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); check_logfiles-4.1.1/t/081rununique.t0000664000175000017500000000313514336703157014330 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/050perms.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 5; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < "unique", logfile => "./var/adm/messages", criticalpatterns => [ 'blabla', ], }); EOCFG open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); my $pidfile = $cl->construct_pidfile(); diag($pidfile); my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } } my $command = $perlpath.' ../plugins-scripts/check_logfiles --config ./etc/check_action.cfg --rununique'; if ($^O =~ /MSWin/) { $command =~ s/\//\\/g; } my $output = `$command`; diag($command); diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); open PID, ">$pidfile"; close PID; ok(-e $pidfile, "pidfile exists"); $output = `$command`; diag($output); ok(($output =~ /Exiting because another check is already running/), "aborts correctly"); ok(($output =~ /Exiting because another check is already running/) && (($? >> 8) == 3)); unlink $pidfile; $output = `$command`; diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); check_logfiles-4.1.1/t/090matches.t0000664000175000017500000000330014336703157013713 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/016smartaction.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 2; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < "smart", logfile => "./var/adm/messages", criticalpatterns => [ 'bla ((pat1) blub (pat2.*)) bla', ], options => 'smartscript,capturegroups,noprotocol', script => "script.sh" }); EOCFG open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); my $action = $cl->get_search_by_tag("smart"); $action->{script} = sub { my $num = $ENV{CHECK_LOGFILES_CAPTURE_GROUPS}; printf "%d:pat1(%s)pat2(%s)pat3(%s)", $ENV{CHECK_LOGFILES_CAPTURE_GROUPS}, $ENV{CHECK_LOGFILES_CAPTURE_GROUP1}, $ENV{CHECK_LOGFILES_CAPTURE_GROUP2}, $ENV{CHECK_LOGFILES_CAPTURE_GROUP3}; return 2; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $cl->run(); #init $cl->reset(); $cl->run(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "bla pat1 blub pat2kaas bla"); $action->loggercrap(undef, undef, 100); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} eq "CRITICAL - (1 errors) - 3:pat1(pat1 blub pat2kaas)pat2(pat1)pat3(pat2kaas) "); ok($cl->expect_result(0, 0, 1, 0, 2)); check_logfiles-4.1.1/t/030windows.t0000664000175000017500000001532314336703157013763 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/030windows.t # # Test everything using windows pathnames. # use strict; use Test::More tests => 1; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; diag("not in this release"); ok(1); exit 0; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 3 ===="); $ssh->rotate(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 4 ===="); printf "%s\n", Data::Dumper::Dumper($ssh->{options}); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); # now write messages and find them $ssh->trace("==== 5 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 6 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 7 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # repeat but this time with nologfilenocry $cl->reset(); $ssh = $cl->get_search_by_tag("ssh"); $ssh->{options}->{logfilenocry} = 0; $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 8 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); printf "%s\n", Data::Dumper::Dumper($cl); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 9 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 10 ===="); $ssh->rotate(); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 11 ===="); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now write messages and find them $ssh->trace("==== 12 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 13 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 14 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); check_logfiles-4.1.1/t/019maxage.t0000664000175000017500000000333514336703157013542 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/009maxage.t # use strict; use Test::More tests => 4; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "maxage=1m" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); sleep 65; # no writes, file completely inactive $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 65; # writes, but then no activity for 65s $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 3, 0, 2)); check_logfiles-4.1.1/t/053reportlong.t0000664000175000017500000003435214336703157014474 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/053reportlong.t # # Test everything using windows encoding. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; plan tests => 35; my $cl = Nagios::CheckLogfiles::Test->new({ options => 'report=long', protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); ok($ssh->{options}->{report} eq "long"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 1, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 1, "something with Unknown user"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); diag($cl->{long_exitmessage}); ok($cl->{long_exitmessage} =~ /tag ssh CRITICAL\n.*user2.*\n.*Unknown/m); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Failed password for invalid user3"); $ssh->logger(undef, undef, 1, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); ok($cl->{long_exitmessage} =~ /tag ssh CRITICAL\n.*user3\n.*user4\n.*sepp/m); my $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user8", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "test", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user9", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); EOCFG open CCC, ">./etc/searches.cfg"; print CCC $configfile; close CCC; $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/searches.cfg", selectedsearches => ['ssh', 'null'] }); ok(scalar @{$cl->{searches}} == 2); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); my $null = $cl->get_search_by_tag("null"); $null->delete_logfile(); $null->delete_seekfile(); $null->trace("deleted logfile and seekfile"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace("==== 3-4 ===="); sleep 1; $cl->reset(); # 2 criticals for ssh $ssh->loggercrap(undef, undef, 2); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->logger(undef, undef, 2, "Failed password for invalid user9"); $ssh->loggercrap(undef, undef, 2); # 2 warnings for ssh $ssh->logger(undef, undef, 2, "found Unknown user"); # ssh logs instead of test # 2 warnings for null $null->loggercrap(undef, undef, 2); $null->logger(undef, undef, 2, "this is crappy"); $null->loggercrap(undef, undef, 2); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 4, 2, 0, 2)); ok($cl->{exitmessage} =~ /CRITICAL - \(2 errors, 4 warnings.*- .* Failed password .*user8 /); diag($cl->{long_exitmessage}); # --ok 10 ok($cl->{long_exitmessage} =~ /tag ssh CRITICAL\n.*user8.*\n.*user8.*\n.*Unknown.*\n.*Unknown.*\ntag null WARNING\n.*crap.*\n.*crap/); $ssh->trace("==== very long output ===="); diag("==== very long output ===="); sleep 1; $cl->reset(); # 2 criticals for ssh $ssh->loggercrap(undef, undef, 2); foreach (1..300) { $ssh->logger(undef, undef, 1, "Failed password for invalid user88"); } $cl->run(); #diag($cl->{long_exitmessage}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 300, 0, 2)); diag($cl->{exitmessage}); diag(length $cl->{long_exitmessage}); ok((length $cl->{long_exitmessage} <= 4096) && (length $cl->{long_exitmessage} > 3000)); $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user8", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "test", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user9", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); EOCFG printf STDERR "======================================================\n"; open CCC, ">./etc/searcheslong.cfg"; print CCC $configfile; close CCC; $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/searcheslong.cfg", selectedsearches => ['ssh'] }); ok(scalar @{$cl->{searches}} == 1); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); # init $cl->reset(); #$ssh->loggercrap(undef, undef, 2); foreach (1..700) { $ssh->logger(undef, undef, 1, "Failed password for invalid user8"); } $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 700, 0, 2)); diag(length $cl->{long_exitmessage}); my $length = 700 * (length("Failed password for invalid user8") + 8 + 3 + 3); diag($length); # Apr 15 15:49:56, 8 for the time, 2 for day, 2 for month with blanks ok((length $cl->{long_exitmessage} <= 8192) && ($length > 8192)); # zeilen mit returncode 0 sollen nur im longoutput auftauchen, wenn sie # Treffer von okpattern waren. # Return 0 aus einem Supersmartscript zaehlt nicht. $cl = Nagios::CheckLogfiles::Test->new({ options => 'report=long', protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky", } ] }); my $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $door->trace(sprintf "+----------------------- test %d ------------------", 1); $door->loggercrap(undef, undef, 100); sleep 1; $door->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $door->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the door open1"); $door->logger(undef, undef, 1, "the door open2"); $door->logger(undef, undef, 1, "the door open3"); $door->logger(undef, undef, 1, "the door open4"); $door->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{long_exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); $cl->reset(); $door->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the door open5"); $door->logger(undef, undef, 2, "the door closed"); $door->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag("longexit".$cl->{long_exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); my $sum = 0; map { $sum += $_ } map { scalar(@{$door->{matchlines}->{$_}}) } keys %{$door->{matchlines}}; ok($sum == 0); diag("final".$cl->{long_exitmessage}); ok($cl->{long_exitmessage} eq ""); $cl = Nagios::CheckLogfiles::Test->new({ options => 'report=long', protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "supersmartscript", script => sub { my $line = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; $line =~ /open(\w+)/; print "kaas".$1; return 0 if $1 eq "D"; return 2; }, } ] }); $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $door->trace(sprintf "+----------------------- test %d ------------------", 1); $door->loggercrap(undef, undef, 100); sleep 1; $door->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $door->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the door openA"); $door->logger(undef, undef, 1, "the door openB"); $door->logger(undef, undef, 1, "the door openC"); $door->logger(undef, undef, 1, "the door openD"); $door->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); $sum = 0; map { $sum += $_ } map { scalar(@{$door->{matchlines}->{$_}}) } keys %{$door->{matchlines}}; ok($sum == 4); ok(scalar(@{$door->{matchlines}->{CRITICAL}}) == 3); ok(scalar(@{$door->{matchlines}->{OK}}) == 1); diag("final".$cl->{long_exitmessage}); my @x = split(/\n/, $cl->{long_exitmessage}); ok(scalar(@x) == 4); ok($cl->{long_exitmessage} !~ /kaas4/); ok($cl->expect_result(1, 0, 3, 0, 2)); # handle empty lines $cl = Nagios::CheckLogfiles::Test->new({ options => 'report=long', protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => '.*', okpatterns => 'schnorch!', } ] }); $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $door->trace(sprintf "+----------------------- test %d ------------------", 1); $door->loggercrap(undef, undef, 100); sleep 1; $door->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $door->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 10, "schnorch!"); $door->logger(undef, undef, 1, "the door open1"); $door->logger(undef, undef, 1, "the door open2"); $door->logger(undef, undef, 1, "the door open3"); $door->logger(undef, undef, 1, "the door open4"); my $logfh = IO::File->new(); $logfh->autoflush(1); if ($logfh->open($door->{logfile}, "a")) { $logfh->printf("\n"); $logfh->printf("\n"); $logfh->printf("\n"); $logfh->printf("\n"); $logfh->close(); } sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); $sum = 0; map { $sum += $_ } map { scalar(@{$door->{matchlines}->{$_}}) } keys %{$door->{matchlines}}; ok($sum == 8); ok(scalar(@{$door->{matchlines}->{CRITICAL}}) == 8); diag("final".$cl->{long_exitmessage}."final"); @x = split(/\n/, $cl->{long_exitmessage}); ok(scalar(@x) == 9); printf "%s\n", Data::Dumper::Dumper(\@x); ok($cl->{long_exitmessage} =~ /tag door CRITICAL\n.*open1\n.*open2\n.*open3\n.*open4\n_\(null\)_\n_\(null\)_\n_\(null\)_\n_\(null\)_\n/m); ok($cl->expect_result(0, 0, 8, 0, 2)); check_logfiles-4.1.1/t/etc/0000755000175000017500000000000014336703157012506 500000000000000check_logfiles-4.1.1/t/etc/syslog_enh_logfile_linux.fmt0000755000175000017500000004767414336703157020255 00000000000000// Format file for catching messages from Linux syslogd FORMAT Logfile_Base %t %s %s* hostname LABEL adapter_host LABEL date $1 origin $2 msg $3 END FORMAT Log_Unix_MonitoringCheck FOLLOWS Logfile_Base %t %s EM2FM: %s* severity MINOR END FORMAT Xprint_Cpu FOLLOWS Logfile_Base %s %s %s %s %s xprint_cpu: PID %s %s consumed %s cpu in %s sec! -month $1 -day $2 -time $3 -host $4 -pid $6 -cmd $7 -percent $8 -period $9 severity CRITICAL msg PRINTF("%s %s %s %s: xprint_cpu: PID %s %s consumed %s cpu in %s sec!", month, day, time, host, pid, cmd, percent, period) END FORMAT UC4_ServerStillstand %s %s %s %s %s UC4 Logfile waechst nicht, UC4 pruefen hostname LABEL adapter_host LABEL -date1 $1 -date2 $2 -time $3 date PRINTF("%s %s %s", date1, date2, time) origin $4 sub_source UC4_Monitor severity FATAL msg PRINTF("%s: UC4 Logfile waechst nicht, UC4 pruefen !", origin) END FORMAT GAM_Base %s* Event= %s:%s%n occurred at %s* and logged at %s* hostname LABEL adapter_host LABEL origin DEFAULT -V1 $1 silo $2 -msgpart $3 date $4 msg PRINTF("%s Event= %s:%s", V1, silo, msgpart) severity MINOR END FORMAT Log_Linux_HW_GAM FOLLOWS GAM_Base %s* Event= B:%s%n occurred at %s* and logged at %s* silo "B" -msgpart $2 date $3 END FORMAT Log_Linux_HW_GAM FOLLOWS GAM_Base %s* Event= C:%s%n occurred at %s* and logged at %s* silo "C" -msgpart $2 date $3 END FORMAT Log_Linux_HW_GAM FOLLOWS GAM_Base %s* Event= 24:%s%n occurred at %s* and logged at %s* silo "24" -msgpart $2 date $3 END FORMAT Log_Linux_HW_GAM FOLLOWS GAM_Base %s* Event= 3A:%s%n occurred at %s* and logged at %s* silo "3A" -msgpart $2 date $3 END FORMAT Log_Linux_HW_GAM FOLLOWS GAM_Base %s* Event= 87:%s%n occurred at %s* and logged at %s* silo "87" -msgpart $2 date $3 END FORMAT Log_Linux_HW_GAM FOLLOWS GAM_Base %s* Event= 8F:%s%n occurred at %s* and logged at %s* silo "8F" -msgpart $2 date $3 END FORMAT Log_Unix_Vxfs_Inconsistent FOLLOWS Logfile_Base %t %s vxfs: %s* vx_direrr: vx_dirrem_5 %s* -V3 $3 -V4 $4 msg PRINTF("%s vx_direrr: vx_dirrem_5 %s", V3, V4) severity CRITICAL END FORMAT Log_Unix_Vxfs_Inconsistent FOLLOWS Logfile_Base %t %s vxfs: %s* vx_direrr: vx_dirscan_2 %s* -V3 $3 -V4 $4 msg PRINTF("%s vx_direrr: vx_dirscan_2 %s", V3, V4) severity CRITICAL END FORMAT Log_Unix_CPU_ThresholdViolation FOLLOWS Logfile_Base %t %s %s* CPU-SCHWELLWERT UEBERSCHRITTEN msg "CPU-SCHWELLWERT UEBERSCHRITTEN" severity CRITICAL END FORMAT Logfile_Login FOLLOWS Logfile_Base %t %s login: %s* sub_source login END FORMAT Logfile_Kernel FOLLOWS Logfile_Base %t %s kernel: %s* sub_source unix severity MINOR END FORMAT Log_Linux_DDM_Error FOLLOWS Logfile_Kernel %t %s kernel: DDM: Error%s* -V3 $3 msg PRINTF("DDM: Error%s", V3) END FORMAT Log_Linux_DDM_Error FOLLOWS Logfile_Kernel %t %s kernel: DDM: Error %s* -V3 $3 msg PRINTF("DDM: Error %s", V3) END FORMAT Log_Linux_VFSFileMax FOLLOWS Logfile_Kernel %t %s kernel: VFS: file-max limit %s* -V3 $3 msg PRINTF("VFS: file-max limit %s", V3) END FORMAT Log_Linux_Oops FOLLOWS Logfile_Kernel %t %s kernel: Oops: %s* -V3 $3 msg PRINTF("Oops: %s", V3) END FORMAT Log_Linux_Kernel_BUG FOLLOWS Logfile_Kernel %t %s kernel: Kernel BUG -V3 "kernel: Kernel BUG" msg PRINTF ("%s", V3) END FORMAT Log_Unix_HW_Fan_Test FOLLOWS Logfile_Kernel %t %s %s* redundant fan test failed. -v3 $3 msg PRINTF("%s redundat fan test failed.", v3) severity MINOR END FORMAT Log_Unix_HW_Correctable_Err FOLLOWS Logfile_Kernel %t %s %s* correctable error detected %s* -v3 $3 -v4 $4 msg PRINTF("%s correctable error detected %s", v3, v4) severity MINOR END FORMAT Log_Unix_HW_BadSuperblock FOLLOWS Logfile_Base %t %s %s BAD SUPER BLOCK: %s -V3 $3 -V4 $4 msg PRINTF("%s BAD SUPER BLOCK: %s", V3, V4) severity MINOR END FORMAT Log_Unix_HW_BadSuperblock FOLLOWS Logfile_Base %t %s %s BAD SUPER BLOCK: / -V3 $3 msg PRINTF("%s BAD SUPER BLOCK: /", V3) severity MINOR END FORMAT Log_Unix_BadTrap FOLLOWS Logfile_Base %t %s %s BAD TRAP -V3 $3 msg PRINTF("%s BAD TRAP", V3) severity MINOR END FORMAT Log_Unix_BadTrap FOLLOWS Logfile_Base %t %s %s Data fault -V3 $3 msg PRINTF("%s Data fault", V3) severity MINOR END FORMAT Log_Unix_Init FOLLOWS Logfile_Base %t %s %s Can't invoke /etc/init, error int -V3 $3 msg PRINTF("%s Can't invoke /etc/init, error int", V3) severity MINOR END FORMAT Log_Unix_CorruptLabel FOLLOWS Logfile_Base %t %s %s corrupt label - wrong magic number or corrupt label - label checksum failed -V3 $3 msg PRINTF("%s corrupt label - wrong magic number or corrupt label - label checksum failed ", V3) severity MINOR END FORMAT Log_Unix_DataAccess FOLLOWS Logfile_Base %t %s %s data access exception -V3 $3 msg PRINTF("%s data access exception", V3) severity MINOR END FORMAT Log_Unix_CantCheck FOLLOWS Logfile_Base %t %s %s %s: CAN'T CHECK FILE SYSTEM. -V3 $3 -V4 $4 msg PRINTF("%s %s: CAN'T CHECK FILE SYSTEM.", V3, V4) severity MINOR END FORMAT Log_Unix_CantCheck FOLLOWS Logfile_Base %t %s %s fsck: Can't open %s -V3 $3 -V4 $4 msg PRINTF("%s fsck: Can't open %s", V3, V4) severity MINOR END FORMAT Log_Unix_Inconsistency FOLLOWS Logfile_Base %t %s %s %s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. -V3 $3 -V4 $4 msg PRINTF("%s %s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.", V3, V4) severity MINOR END FORMAT Log_Unix_FailedInitAdapter FOLLOWS Logfile_Base %t %s %s failed to initialize adapter -V3 $3 msg PRINTF("%s failed to initialize adapter", V3) severity MINOR END FORMAT Log_Unix_FileTableOverflow FOLLOWS Logfile_Base %t %s %s File table overflow -V3 $3 msg PRINTF("%s File table overflow", V3) severity MINOR END FORMAT Log_Unix_HW_EthernetJammed FOLLOWS Logfile_Base %t %s %s %s: Ethernet jammed -V3 $3 -V4 $4 msg PRINTF("%s %s: Ethernet jammed", V3, V4) severity MINOR END FORMAT Log_Unix_HW_NoCarrier FOLLOWS Logfile_Base %t %s %s %s: no carrier -V3 $3 -V4 $4 msg PRINTF("%s %s: no carrier", V3, V4) severity MINOR END FORMAT Log_Unix_HW_NoCarrier FOLLOWS Logfile_Base %t %s %s No carrier-- cable disconnected or hub link test disabled? -V3 $3 msg PRINTF("%s No carrier-- cable disconnected or hub link test disabled?", V3) severity MINOR END FORMAT Log_Unix_HW_NoCarrier FOLLOWS Logfile_Base %t %s %s No carrier-- transceiver cable problem? -V3 $3 msg PRINTF("%s No carrier-- transceiver cable problem?", V3) severity MINOR END FORMAT Log_Unix_IfBadAddress FOLLOWS Logfile_Base %t %s %s bad address %s -V3 $3 -V4 $4 msg PRINTF("%s bad address %s", V3, V4) severity MINOR END FORMAT Log_Unix_UnknownTcpService FOLLOWS Logfile_Base %t %s %s %s/tcp: unknown service -V3 $3 -V4 $4 msg PRINTF("%s %s/tcp: unknown service", V3, V4) severity MINOR END FORMAT Log_Unix_UnknownUdpService FOLLOWS Logfile_Base %t %s %s %s/udp: unknown service -V3 $3 -V4 $4 msg PRINTF("%s %s/udp: unknown service", V3, V4) severity MINOR END FORMAT Log_Unix_TooManyFiles FOLLOWS Logfile_Base %t %s %s Too many open files -V3 $3 msg PRINTF("%s Too many open files", V3) severity MINOR END FORMAT Log_Unix_HW_IOError FOLLOWS Logfile_Base %t %s %s I/O error -V3 $3 msg PRINTF("%s I/O error", V3) severity MINOR END FORMAT Log_Unix_KernelReadError FOLLOWS Logfile_Base %t %s %s kernel read error -V3 $3 msg PRINTF("%s kernel read error", V3) severity MINOR END FORMAT Log_Unix_Killed FOLLOWS Logfile_Base %t %s %s Killed -V3 $3 msg PRINTF("%s Killed", V3) severity MINOR END FORMAT Log_Unix_HW_MemoryError FOLLOWS Logfile_Base %t %s %s Memory error! -V3 $3 msg PRINTF("%s Memory error!", V3) severity MINOR END FORMAT Log_Unix_MemoryLeak FOLLOWS Logfile_Base %t %s %s memory leaks -V3 $3 msg PRINTF("%s memory leaks", V3) severity MINOR END FORMAT Log_Unix_GivingUpMount FOLLOWS Logfile_Base %t %s %s giving up on: %s -V3 $3 -V4 $4 msg PRINTF("%s giving up on: %s", V3, V4) severity MINOR END FORMAT Log_Unix_MountNotOk FOLLOWS Logfile_Base %t %s %s the state of %s is not okay -V3 $3 -V4 $4 msg PRINTF("%s the state of %s is not okay", V3, V4) severity MINOR END FORMAT Log_Unix_CannotMount FOLLOWS Logfile_Base %t %s %s panic -boot: Could not mount filesystem -V3 $3 msg PRINTF("%s panic -boot: Could not mount filesystem", V3) severity MINOR END FORMAT Log_Unix_PanicMutex FOLLOWS Logfile_Base %t %s %s panic: mutex_adaptive_exit -V3 $3 msg PRINTF("%s panic: mutex_adaptive_exit", V3) severity MINOR END FORMAT Log_Unix_HW_ScsiParityError FOLLOWS Logfile_Base %t %s %s SCSI %s DATA IN %s parity error -V3 $3 -V4 $4 -V5 $5 msg PRINTF("%s SCSI %s DATA IN %s parity error", V3, V4, V5) severity MINOR END FORMAT Log_Unix_HW_ScsiTransportFailed FOLLOWS Logfile_Base %t %s %s SCSI transport failed: reason 'reset' -V3 $3 msg PRINTF("%s SCSI transport failed: reason 'reset'", V3) severity MINOR END FORMAT Log_Unix_SliceTooSmall FOLLOWS Logfile_Base %t %s %s Slice %s is too small to contain %s replicas -V3 $3 -V4 $4 -V5 $5 msg PRINTF("%s Slice %s is too small to contain %s replicas", V3, V4, V5) severity MINOR END FORMAT Log_Unix_UnexpectedFsInconsistency FOLLOWS Logfile_Base %t %s %s THE FOLLOWING FILE SYSTEM(S) HAD AN UNEXPECTED INCONSISTENCY: -V3 $3 msg PRINTF("%s THE FOLLOWING FILE SYSTEM(S) HAD AN UNEXPECTED INCONSISTENCY:", V3) severity MINOR END FORMAT Log_Unix_HW_ScsiBusHung FOLLOWS Logfile_Base %t %s %s The SCSI %s is hung. Perhaps an external device is turned off. -V3 $3 -V4 $4 msg PRINTF("%s The SCSI %s is hung. Perhaps an external device is turned off.", V3, V4) severity MINOR END FORMAT Log_Unix_UnableToInstallDriver FOLLOWS Logfile_Base %t %s %s Unable to install/attach driver '%s' -V3 $3 -V4 $4 msg PRINTF("%s Unable to install/attach driver '%s'", V3, V4) severity MINOR END FORMAT Log_Unix_ErrorWritingName FOLLOWS Logfile_Base %t %s %s error writing name when booting -V3 $3 msg PRINTF("%s error writing name when booting", V3) severity MINOR END FORMAT Log_Unix_UnableToRepairFs FOLLOWS Logfile_Base %t %s %s WARNING:Unable to repair the %s filesystem. Run fsck -V3 $3 -V4 $4 msg PRINTF("%s WARNING:Unable to repair the %s filesystem. Run fsck", V3, V4) severity MINOR END FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base %t %s %s CLUSTERSTATUS %s* -V3 $3 -V4 $4 msg PRINTF("%s CLUSTERSTATUS %s", V3, V4) severity MINOR END FORMAT Log_Unix_ClusterStatus FOLLOWS Logfile_Base %t %s %s CLUSTERSTATUS %s* is in faulted or inconsistent state ! -V3 $3 -V4 $4 msg PRINTF("%s CLUSTERSTATUS %s is in faulted or inconsistent state !", V3, V4) severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [%s][MAJOR] %s* id $3 msg $4 severity MINOR END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [%s][ERROR] %s* id $3 msg $4 severity MINOR END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview RAID: [%s][ERROR] %s* id $3 msg $4 severity MINOR END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview RAID: [%s][error] %s* id $3 msg $4 severity MINOR END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview RAID: [%s][MAJOR] %s* id $3 msg $4 severity MINOR END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview RAID: [%s][major] %s* id $3 msg $4 severity MINOR END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [2071][MINOR] %s* id 2071 msg $3 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0638][%s] %s* id 0638 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0640][%s] %s* id 0640 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0642][%s] %s* id 0642 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0644][%s] %s* id 0644 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0214][%s] %s* id 0214 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0217][%s] %s* id 0217 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0221][%s] %s* id 0221 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0638][%s] %s* id 0638 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0640][%s] %s* id 0640 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0642][%s] %s* id 0642 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0644][%s] %s* id 0644 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0214][%s] %s* id 0214 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0217][%s] %s* id 0217 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s Serverview: [0221][%s] %s* id 0221 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0013][%s] %s* id 0013 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0051][%s] %s* id 0051 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0052][%s] %s* id 0052 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0053][%s] %s* id 0053 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0054][%s] %s* id 0054 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0079][%s] %s* id 0079 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0154][%s] %s* id 0154 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0204][%s] %s* id 0204 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0418][%s] %s* id 0418 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0422][%s] %s* id 0422 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0426][%s] %s* id 0426 msg $4 severity CRITICAL END FORMAT Log_Linux_HW_Serverview FOLLOWS Logfile_Base %t %s ServerView RAID: [0426][%s] %s* id 0426 -V4 $4 msg PRINTF("Raid kaputt: %s", V4) severity CRITICAL END FORMAT Log_Linux_HW_IM_DriveArrayDeviceFailure FOLLOWS Logfile_Base %t %s %s* Drive Array Device Failure %s* -V3 $3 -V4 $4 msg PRINTF("%s Drive Array Device Failure %s", V3, V4) severity MINOR END FORMAT Log_Linux_HW_Dell_Error FOLLOWS Logfile_Base %t %s Server Administrator: %s Service EventID: %s3 %s* -V3 $3 -V4 $4 -V5 $5 silo PRINTF("%s3", V4) msg PRINTF("%s Service EventID: %s3 %s", V3, V4, V5) severity MINOR END FORMAT Log_Linux_HW_Dell_Error FOLLOWS Logfile_Base %t %s Server Administrator: %s Service EventID: %s4 %s* -V3 $3 -V4 $4 -V5 $5 silo PRINTF("%s4", V4) msg PRINTF("%s Service EventID: %s4 %s", V3, V4, V5) severity MINOR END FORMAT Log_Linux_HW_Dell_Error FOLLOWS Logfile_Base %t %s Server Administrator: %s Service EventID: %s5 %s* -V3 $3 -V4 $4 -V5 $5 silo PRINTF("%s5", V4) msg PRINTF("%s Service EventID: %s5 %s", V3, V4, V5) severity MINOR END FORMAT Log_Linux_HW_Dell_Error FOLLOWS Logfile_Base %t %s Server Administrator: %s Service EventID: %s6 %s* -V3 $3 -V4 $4 -V5 $5 silo PRINTF("%s6", V4) msg PRINTF("%s Service EventID: %s6 %s", V3, V4, V5) severity MINOR END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: 1003 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: 1303 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: 1304 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: %s0 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: %s1 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: %s2 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: %s7 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: %s8 %s* END FORMAT *DISCARD* %t %s Server Administrator: %s Service EventID: %s9 %s* END FORMAT Log_Linux_HW_Dell_Storage_Error_super FOLLOWS Logfile_Base %t %s Server Administrator: Storage Service EventID: 2%s %s* -silopart $3 silo PRINTF("2%s", silopart) -msgpart $4 msg PRINTF("Storage Service EventID: 2%s %s", silopart, msgpart) severity MINOR END FORMAT *DISCARD* %t %s Server Administrator: Storage Service EventID: %s* END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2129 %s* -silopart "129" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2113 %s* -silopart "113" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2112 %s* -silopart "112" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2107 %s* -silopart "107" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2103 %s* -silopart "103" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2102 %s* -silopart "102" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2083 %s* -silopart "083" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2082 %s* -silopart "082" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2081 %s* -silopart "081" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2080 %s* -silopart "080" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2079 %s* -silopart "079" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2076 %s* -silopart "076" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2056 %s* -silopart "056" -msgpart $3 END FORMAT Log_Linux_HW_Dell_Storage_Error FOLLOWS Log_Linux_HW_Dell_Storage_Error_super %t %s Server Administrator: Storage Service EventID: 2048 %s* -silopart "048" -msgpart $3 severity CRITICAL END FORMAT Log_Unix_LAN_SendLimitReached FOLLOWS Logfile_Base %t %s CPS: LAN_HBA_MON %s: Send Limit %s* silo $3 -msgpart $4 msg PRINTF("LAN_HBA_MON %s: Send Limit %s", silo, msgpart) severity MINOR END FORMAT Log_Unix_LAN_ReceiveLimitReached FOLLOWS Logfile_Base %t %s CPS: LAN_HBA_MON %s: Receive Limit %s* silo $3 -msgpart $4 msg PRINTF("LAN_HBA_MON %s: Receive Limit %s", silo, msgpart) severity MINOR END FORMAT Log_Unix_LAN_TrafficLimitReached FOLLOWS Logfile_Base %t %s CPS: LAN_HBA_MON %s: Traffic Limit %s* silo $3 -msgpart $4 msg PRINTF("LAN_HBA_MON %s: Traffic Limit %s", silo, msgpart) severity MINOR END FORMAT Log_Unix_Maintenance_Error FOLLOWS Logfile_Base %t %s %s: Maintenance-ERROR: %s* -V3 $3 -V4 $4 msg PRINTF("%s: Maintenance-ERROR: %s", V3, V4) severity CRITICAL END FORMAT *DISCARD* %t %s sshd[%s* END FORMAT *DISCARD* %t %s sendmail[%s* END FORMAT *DISCARD* %t %s su: %s* END FORMAT *DISCARD* %t %s innd: %s* END FORMAT *DISCARD* %t %s nnrpd[%s* END FORMAT *DISCARD* %t [%s] %t: %s* END FORMAT *DISCARD* %t %s last message repeated %s times END FORMAT *DISCARD* %t %s syslogd %s: restart. END FORMAT *DISCARD* %t %s syslogd: restart END FORMAT *DISCARD* %t %s PAM-unix2[%s* END FORMAT *DISCARD* %t %s pksd[%s* END check_logfiles-4.1.1/t/etc/patternfile.pat0000755000175000017500000000023414336703157015453 00000000000000$criticalpatterns = [ "Failed password", "Failed powersupply", ]; $warningpatterns = "Unknown user"; $warningexceptions = [ "Unknown user lausser" ]; check_logfiles-4.1.1/t/etc/searcheslong.cfg0000644000175000017500000000202414336703157015562 00000000000000 $options = 'report=long,maxlength=8192'; $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user8", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "test", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user9", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); check_logfiles-4.1.1/t/etc/tivoli2.cfg0000664000175000017500000000175214336703157014506 00000000000000 $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "tivtest2", logfile => "./var/adm/messages", tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt"], #tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt2"], tivolimapping => { minor => 2, warning => 2, critical => 2, }, options => "supersmartscript", script => sub { $tivoli = $CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}; if ($tivoli->{format_name} ne "NO MATCHING RULE") { printf "%s", $CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}->{subject}; return $tivoli->{exit_code}; } else { printf "%s", $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; return 2; } } } ); check_logfiles-4.1.1/t/etc/searches.cfg0000664000175000017500000000213514336703157014707 00000000000000 $options = "supersmartpostscript"; $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user8", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "test", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user9", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); $postscript = sub { printf "uiuiuiuiuiui\n"; return 2; }; check_logfiles-4.1.1/t/etc/etc/0000755000175000017500000000000014336703157013261 500000000000000check_logfiles-4.1.1/t/etc/etc/002patch.cfg0000664000175000017500000000126214336703157015206 00000000000000 $options = "supersmartpostscript"; $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user723", warningpatterns => "Unknown user", warningexceptions => ['Unknown user hiasl'], options => "perfdata,nologfilenocry" }, ); $postscript = sub { printf "hundsglump varreckts!!! %s | %s\n", $ENV{CHECK_LOGFILES_SERVICEOUTPUT}, $ENV{CHECK_LOGFILES_SERVICEPERFDATA}; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; }; check_logfiles-4.1.1/t/etc/etc/001patch.cfg0000664000175000017500000000117114336703157015204 00000000000000 $options = "supersmartpostscript"; $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user81", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, ); $postscript = sub { printf "hundsglump varreckts nommol!!! %s | %s\n", $ENV{CHECK_LOGFILES_SERVICEOUTPUT}, $ENV{CHECK_LOGFILES_SERVICEPERFDATA}; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; }; check_logfiles-4.1.1/t/etc/check_warn.cfg0000644000175000017500000000077714336703157015226 00000000000000$protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ({ tag => 'some_tag', logfile => 'some_log', criticalpatterns => [ 'some_string', ], options => 'supersmartscript', script => sub { foreach my $key (sort(keys %ENV)) { next unless $key =~ /^CHECK/; printf "%s=%s ", $key, $ENV{$key}; } return 2; } }); check_logfiles-4.1.1/t/etc/check_null.cfg0000664000175000017500000000074414336703157015225 00000000000000$protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; $scriptpath = "./bin"; $options = "supersmartpostscript"; @searches = ( { tag => "smart", logfile => "./var/adm/messages", criticalpatterns => [ '.*connection unexpectedly closed.*', '.*rsync error.*', 'Thermometer', ], warningpatterns => [ '.*total size is 0 .*', ], }); $postscript = sub { print "0"; return 0; }; check_logfiles-4.1.1/t/etc/templates.cfg0000644000175000017500000000124214336703157015104 00000000000000 $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { template => "outlook", logfile => "./var/adm/messages", criticalpatterns => "mailbox corrupt", warningpatterns => "mailbox full", options => 'perfdata,syslogclient=$CL_TAG$' }, { template => "excel", logfile => "./var/adm/messages", criticalpatterns => "oo file found", options => 'perfdata,syslogclient=$CL_TAG$' }, { tag => "simple", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }); check_logfiles-4.1.1/t/etc/syslog_enh_logfile_linux.fmt20000755000175000017500000000062514336703157020320 00000000000000// Format file for catching messages from Linux syslogd FORMAT GAM_Base %s* Event= %s:%s%n occurred at %s* and logged at %s* hostname LABEL adapter_host LABEL origin DEFAULT -V1 $1 silo $2 -msgpart $3 date $4 msg PRINTF("%s Event= %s:%s", V1, silo, msgpart) severity MINOR END FORMAT Log_Linux_HW_GAM FOLLOWS GAM_Base %s* Event= B:%s%n occurred at %s* and logged at %s* silo "B" -msgpart $2 date $3 END check_logfiles-4.1.1/t/etc/check_critfirst.cfg0000644000175000017500000001014414336703157016255 00000000000000@searches = ({ tag => 'critfirst', logfile => 'var/tmp/eventlog', #type => 'eventlog', #eventlog => { # eventlog => 'application', # include => { # eventtype => 'error,warning', # }, #}, # 'winwarncrit' mappt windows Kritikalitaet auf Nagios: ERROR->CRITICAL, WARNING->WARNING options => 'supersmartscript,winwarncrit,noperfdata,noprotocol,preferredlevel=critical,eventlogformat="(id:%i/so:%s) - %m"', script => \&reformat_output, criticalpatterns => [ # hier stehen die Events (die im Eventlog vom Typ Warning oder Error sein koennen) # bei deren Auftauchen sofort gehandelt werden muss, die also Nagios-seitig # als CRITICAL eingestuft werden sollen. 'id:1069 so:ClusSvc .* msg:Cluster Resource .* in Ressourcengruppe .* ist fehlgeschlagen', ], # TODO: Dies ist nur ein Beispiel, wie man ein durch winwarncrit kritisches Event # wieder auf Warning zurueckstufen kann: criticalexceptions => [ 'id:.* so:.* ca:.* msg:.*Faulting application.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack.dll.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack200.exe.*', 'id:.* so:AdsmClientService ca:.* msg:.*', 'id:.* so:Perflib ca:.* msg:.*', 'id:.* so:Userenv ca:.* msg:.*', 'id:0010 so:.* ca:.* msg:.*', 'id:0020 so:OCS_INVENTORY_SERVICE ca:.* msg:.*', 'id:0033 so:SideBySide ca:.* msg:.*', 'id:0050 so:ProIsam ca:.* msg:.*', 'id:0109 so:.* ca:.* msg:.*', 'id:0215 so:.* ca:.* msg:.*', 'id:0502 so:Folder Redirection ca:.* msg:.*', 'id:1000 so:.* ca:.* msg:.*', 'id:1002 so:.* ca:.* msg:.*', 'id:1026 so:.* ca:.* msg:.*', 'id:1306 so:BCAAA ca:.* msg:.*', 'id:1308 so:BCAAA ca:.* msg:.*', 'id:1313 so:BCAAA ca:.* msg:.*', 'id:1325 so:.* ca:.* msg:.*', 'id:1529 so:Microsoft-Windows-User_Profiles_Service ca:.* msg:Roaming user profiles across forests are disabled.*', 'id:4096 so:.* ca:.* msg:.*', 'id:4187 so:mgmtagnt ca:2 msg:.*', ], warningexceptions => [ # die hier aufgeführten Events, sollen nicht weiter beachtet werden. # \ mit \\\ angeben sonst gibt es Fehlermeldungen # '.* .* .* msg:.*\\\Registry\\\User.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack.dll.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack200.exe.*', 'id:.* so:TCLINKLN ca:.* msg:.*', 'id:.* so:TCLINKSC ca:.* msg:.*', 'id:.* so:TCLINKSCT ca:.* msg:.*', 'id:0010 so:.* ca:.* msg:.*', 'id:0020 so:OCS_INVENTORY_SERVICE ca:.* msg:.*', 'id:0033 so:SideBySide ca:.* msg:', 'id:0050 so:ProIsam ca:.* msg:.*', 'id:0502 so:ERA_SERVER ca:.* msg:.*', 'id:0502 so:Folder Redirection ca:.* msg:.*', 'id:1000 so:.* ca:.* msg:.*', 'id:1002 so:.* ca:.* msg:.*', 'id:1026 so:.* ca:.* msg:.*', 'id:1030 so:Userenv ca:.* msg:.*', 'id:1055 so:Userenv ca:.* msg:.*', 'id:1058 so:Userenv ca:.* msg:.*', 'id:1109 so:Userenv ca:.* msg:.*', 'id:11312 so:FSPeripheryApplication ca:.* msg:.*', 'id:1306 so:BCAAA ca:.* msg:.*', 'id:1309 so:ASP.Net_xxx ca:.* msg:.*', 'id:1313 so:BCAAA ca:.* msg:.*', 'id:1325 so:.* ca:.* msg:.*', 'id:1516 so:Userenv ca:.* msg:.*', 'id:1517 so:Userenv ca:.* msg:.*', 'id:1524 so:Userenv ca:.* msg:.*', 'id:1529 so:Microsoft-Windows-User_Profiles_Service ca:.* msg:Roaming user profiles across forests are disabled.*', 'id:1529 so:Userenv ca:.* msg:.*', 'id:1530 so:User Profile Service ca:.* msg:.*', 'id:16022 so:TCOSS ca:.* msg:.*', 'id:2003 so:Perflib ca:.* msg:.*', 'id:4096 so:Server_Intelligence_Agent ca:.* msg:.*', 'id:4097 so:AdsmClientService ca:.* msg:.*', 'id:4099 so:AdsmClientService ca:.* msg:.*', 'id:4100 so:AdsmClientService ca:.* msg:.*', 'id:4101 so:AdsmClientService ca:.* msg:.*', 'id:4103 so:AdsmClientService ca:.* msg:.*', 'id:4187 so:mgmtagnt ca:2 msg:.*', ], # saemtliche anderen Events (auch solche, die noch niemals vorgekommen sind) # erscheinen in Nagios als WARNING. warningpatterns => [ '.*', ], },); sub reformat_output{ (my $out = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}) =~ s/.*id:(.*)?so:(.*)?/ID:$1 SO:$2/; print $out; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; } $options = 'report=long'; check_logfiles-4.1.1/t/etc/encodeme.cfg0000644000175000017500000000100114336703157014656 00000000000000 @searches = ({ tag => "test", logfile => "/var/log/messages", rotation => "SOLARIS", criticalpatterns => [ "ERROR", "root on none", ], options => "script", script => sub { use LWP; print "hello world"; my $browser = LWP::UserAgent->new(); my $response = $browser->post( 'https://10.0.15.248/monitor/upload/upload.php', [text1 => 'blabla', text2 => 'blablubb', 'Datei' => [undef,'job_name',], ], 'Content_Type' => 'form-data', ); } }); check_logfiles-4.1.1/t/etc/tivoli.cfg0000664000175000017500000000153614336703157014424 00000000000000 $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "tivtest", logfile => "./var/adm/messages", tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt"], #tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt2"], options => "supersmartscript", script => sub { $tivoli = $CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}; if ($tivoli->{format_name} ne "NO MATCHING RULE") { printf "%s", $CHECK_LOGFILES_PRIVATESTATE->{tivolimatch}->{subject}; return $tivoli->{exit_code}; } else { printf "%s", $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; return 2; } } } ); check_logfiles-4.1.1/t/etc/tivoli3.cfg0000664000175000017500000000065214336703157014505 00000000000000 $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "tivtest2", logfile => "./var/adm/messages", tivolipatterns => ["./etc/syslog_enh_logfile_linux.fmt"], tivolimapping => { minor => 2, warning => 2, critical => 2, }, } ); check_logfiles-4.1.1/t/etc/2check_action.cfg0000644000175000017500000000116014336703157015601 00000000000000$protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; $scriptpath = "./bin"; $MACROS = { CL_NSCA_HOST_ADDRESS => 'nagios.dierichs.de', CL_NSCA_PORT => 5555, }; @searches = ( { tag => "action", logfile => "./var/adm/messages", criticalpatterns => [ '.*ERROR.*', ], options => 'supersmartscript', script => "send_nsca", scriptparams => '-H $CL_NSCA_HOST_ADDRESS$ -p $CL_NSCA_PORT$ -to $CL_NSCA_TO_SEC$ -c $CL_NSCA_CONFIG_FILE$', scriptstdin => '$CL_HOSTNAME$\t$CL_SERVICEDESC$\t$CL_SERVICESTATEID$\t$CL_SERVICEOUTPUT$\n', }); check_logfiles-4.1.1/t/etc/patternfile2.pat0000755000175000017500000000004614336703157015536 00000000000000$criticalpatterns = [ "ALAAARM", ]; check_logfiles-4.1.1/t/etc/check_actionhash.cfg0000644000175000017500000000133414336703157016366 00000000000000 $options = "report=long"; $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ({ tag => "smart", logfile => "./var/adm/messages", criticalpatterns => { 'pat1' => '.*connection unexpectedly closed.*', 'pat2' => '.*rsync error.*', }, warningpatterns => { 'pat1' => '.*total size is 0 .*', }, options => 'supersmartscript', script => sub { my $level = lc $ENV{CHECK_LOGFILES_SERVICESTATE}; my $output = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; my $patnum = $ENV{CHECK_LOGFILES_PATTERN_KEY}; printf "%s.%s.%s\n", $level, $patnum, $output; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; }, }); check_logfiles-4.1.1/t/etc/check_html.cfg0000644000175000017500000000031414336703157015206 00000000000000$protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ({ tag => "html", logfile => "./var/adm/messages", criticalpatterns => ["head.*body"], }); $options = "htmlencode"; check_logfiles-4.1.1/t/etc/check_action.cfg0000664000175000017500000000042614336703157015525 00000000000000 $protocolsdir = "homevartmp:"."."."/var/tmp"; $seekfilesdir = "homevartmp:"."."."/var/tmp"; @searches = ( { tag => "ssh", logfile => "."."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ); check_logfiles-4.1.1/t/etc/check_flood.cfg0000644000175000017500000000666114336703157015360 00000000000000 sub timestamp { my $string = shift; my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; # Oct 31 15:49:21 $string =~ /^(\w+)\s+(\d+) (\d+):(\d+):(\d+)/; my $time = POSIX::mktime($5, $4, $3, $2, { "Jan" => 0, "Feb" => 1, "Mar" => 2, "Apr" => 3, "May" => 4, "Jun" => 5, "Jul" => 6, "Aug" => 7, "Sep" => 8, "Oct" => 9, "Nov" => 10, "Dec" => 11 }->{$1}, $year); return $time; } sub flood_check { my $fc = shift; # max flood events count my $fp = shift; # max flood time period for $fc events my $en = shift; # event name (key) which identifies flood check data $FLOOD{ $en } ||= []; # make empty flood array for this event name my $ar = $FLOOD{ $en }; # get array ref for event's flood array my $ec = @$ar; # events count in the flood array if( $ec >= $fc ) { # flood array has enough events to do real flood check my $ot = $$ar[0]; # oldest event timestamp in the flood array my $tp = time() - $ot; # time period between current and oldest event # now calculate time in seconds until next allowed event my $wait = int( ( $ot + ( $ec * $fp / $fc ) ) - time() ); if( $wait > 0 ) { # positive number of seconds means flood in progress # event should be rejected or postponed return $wait; } # negative or 0 seconds means that event should be accepted # oldest event is removed from the flood array shift @$ar; } # flood array is not full or oldest event is already removed # so current event has to be added push @$ar, time(); # event is ok return 0; } sub is_flood { my $events = shift; my $event_time = shift; my $flood_events = shift; # max flood events count my $flood_period = shift; # max flood time period for $fc events my $num_events = scalar(@{$events}); if ($num_events >= $flood_events) { printf STDERR "num_events %d flood_events %d\n", $num_events, $flood_events; # enough elements to make a reliable calculation my $oldest_event_time = $$events[0]; my $period = $event_time - $oldest_event_time; printf STDERR "oldest %s ... period %d\n", scalar localtime $oldest_event_time, $period; my $wait = int( ( $oldest_event_time + ( $num_events * $flood_period / $flood_events ) ) - $event_time ); if ($wait > 0) { return $wait; } else { shift @{$events}; return 0; } } else { push(@{$events}, $event_time); return 0; } } $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; $scriptpath = "./bin"; @searches = ({ tag => "flood", logfile => "./var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], options => "supersmartscript", script => sub { my $line = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; if (! exists $CHECK_LOGFILES_PRIVATESTATE->{eventhistory}) { $CHECK_LOGFILES_PRIVATESTATE->{eventhistory} = []; printf STDERR "initialized eventhistory\n"; } my $flood = is_flood($CHECK_LOGFILES_PRIVATESTATE->{eventhistory}, timestamp($line), 5, 10); if ($flood) { printf "floot reached %.3f at %s\n", $flood, scalar localtime timestamp($line); return 2; } else { return 0; } }, }); #$options = "supersmartpostscript"; $postscript = sub { my $state = $CHECK_LOGFILES_PRIVATESTATE; #printf STDERR "%s\n", Data::Dumper::Dumper($state); return 0; }; check_logfiles-4.1.1/t/etc/patterninstate.cfg0000644000175000017500000000165614336703157016164 00000000000000 $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { tag => "door", logfile => "./var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "supersmartscript", script => sub { my $pattern = $CHECK_LOGFILES_PRIVATESTATE->{matchingpattern}; printf "my pattern was (%s) ", $pattern; $pattern =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; printf STDERR "encoded pattern is %s ", $pattern; $pattern =~ s/%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg; printf STDERR "decoded pattern is %s ", $pattern; return 2; } } ); check_logfiles-4.1.1/t/etc/check_kaas.cfg0000644000175000017500000000052714336703157015167 00000000000000$protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; $scriptpath = "./bin"; $options = "supersmartpostscript"; @searches = ( { tag => "smart", logfile => "./var/adm/messages2", criticalpatterns => [ '.*rsync error.*', ], }); $postscript = sub { # return undefined message return 0; }; check_logfiles-4.1.1/t/etc/templates2.cfg0000644000175000017500000000124214336703157015166 00000000000000 $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ( { template => "outlook", logfile => "./var/adm/messages", criticalpatterns => "mailbox corrupt", warningpatterns => "mailbox full", options => 'perfdata,syslogclient=$CL_TAG$' }, { template => "excel", logfile => "./var/adm/messages", criticalpatterns => "oo file found", options => 'perfdata,syslogclient=$CL_TAG$' }, { tag => "simple", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }); check_logfiles-4.1.1/t/etc/check_macroseek.cfg0000644000175000017500000000040714336703157016216 00000000000000$protocolsdir = '/tmp/$MACAMACA$'; $seekfilesdir = '/tmp/$MACAMACA$'; @searches = ({ tag => "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", }); check_logfiles-4.1.1/t/etc/check_glump.cfg0000644000175000017500000000076014336703157015373 00000000000000$seekfilesdir = "./var/tmp"; $scriptpath = "./bin"; $options = "supersmartpostscript"; @searches = ( { tag => "smart", logfile => "./var/adm/messages", criticalpatterns => [ '.*connection unexpectedly closed.*', '.*rsync error.*', '!.*FIN.*', 'Thermometer', ], warningpatterns => [ '.*total size is 0 .*', ], }); $postscript = sub { # return undefined message return 0; }; check_logfiles-4.1.1/t/etc/patternfile5.pat0000755000175000017500000000031614336703157015541 00000000000000$criticalpatterns = { "pat1" => "Failed password", "pat2" => "Failed powersupply", }; $warningpatterns = { "pat1" => "Unknown user", }; $warningexceptions = { "epat1" => "Unknown user lausser", }; check_logfiles-4.1.1/t/053pathswithblanks.t0000664000175000017500000002133514336703157015504 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/053pathswithblanks.t # # Test the capability of finding files, scripts etc with blanks in the pathname # use strict; use Test::More tests => 15; use Cwd 'abs_path'; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "./i have a lot of holes"; my $testdir = TESTDIR; my $vardir = TESTDIR."/var"; my $tmpdir = TESTDIR."/var/tmp"; my $logdir = TESTDIR."/var/adm"; my $bindir = TESTDIR."/bin"; my $logfile = TESTDIR."/var/adm/holes holes holes.log"; foreach ($testdir, $vardir, $tmpdir, $logdir, $bindir) { mkdir $_; } open LOL, ">$logfile"; printf LOL "muss existieren, damit abs_path funktioniert"; close LOL; printf "testdir %s\n", $testdir; printf "logfile %s\n", $logfile; $testdir = abs_path($testdir); $tmpdir = abs_path($tmpdir); $logdir = abs_path($logdir); $logfile = abs_path($logfile); if ($^O =~ /Win/) { $bindir = abs_path($bindir).';C:\Program Files\dummy'; } else { $bindir = abs_path($bindir).':/usr/so a kaas/ummy'; } printf "testdir %s\n", $testdir; printf "logfile %s\n", $logfile; unlink $logfile; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => $tmpdir, seekfilesdir => $tmpdir, scriptpath => $bindir, searches => [ { tag => "ssh", logfile => $logfile, criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", } ] }); #printf "%s\n", Data::Dumper::Dumper($cl); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 3 ===="); $ssh->rotate(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 4 ===="); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); # now write messages and find them $ssh->trace("==== 5 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 6 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 7 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # repeat but this time with nologfilenocry $cl->reset(); $ssh = $cl->get_search_by_tag("ssh"); $ssh->{options}->{logfilenocry} = 0; $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 8 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 9 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 10 ===="); $ssh->rotate(); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 11 ===="); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now write messages and find them $ssh->trace("==== 12 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 13 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 14 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); # now add a script, produce 20 criticals, rescript them to 20 warnings # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 15 ===="); $ssh->{script} = "crit2warn.sh"; $ssh->{options}->{script} = 1; $ssh->{options}->{smartscript} = 1; $ssh->{options}->{supersmartscript} = 1; $cl->reset(); if ($^O =~ /MSWin/) { $ssh->{script} = "crit2warn.bat"; $cl->create_file((split(/;/, $bindir))[0]."/crit2warn.bat", 0755, " \@echo off echo status \"%CHECK_LOGFILES_SERVICESTATEID%\" echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" exit 1 "); } else { $ssh->{script} = "crit2warn.sh"; $cl->create_file((split(/:/, $bindir))[0]."/crit2warn.sh", 0755, " echo status \"\$CHECK_LOGFILES_SERVICESTATEID\" echo output \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit 1 "); } $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 10, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 10, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 20, 0, 0, 1)); check_logfiles-4.1.1/t/035htmlencode.t0000664000175000017500000000577114336703157014426 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/001simple.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 4; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < "html", logfile => "./var/adm/messages", criticalpatterns => ["head.*body"], }); EOCFG open CCC, ">./etc/check_html.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => "./var/tmp", seekfilesdir => "./var/tmp", searches => [ { tag => "html", logfile => "./var/adm/messages", criticalpatterns => ["head.*body"], } ] }); my $html = $cl->get_search_by_tag("html"); my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $html->{logfile} =~ s/\//\\/g; } $cl->delete_file("./var/adm/messages"); $cl->delete_file("./var/tmp/check_html.._var_adm_messages.html"); $html->trace("deleted logfile and seekfile"); $html->logger(undef, undef, 1, "A&B"); my $command = sprintf $perlpath.' ../plugins-scripts/check_logfiles --config=etc/check_html.cfg '; my $output = `$command`; diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); # 1 critical $html->trace(sprintf "+----------------------- test %d ------------------", 2); $html->logger(undef, undef, 1, "A&B"); sleep 1; $output = `$command`; diag($output); ok(($output =~ /A&B<\/head>/) && (($? >> 8) == 2)); sleep 1; printf STDERR "now i add --htmlencode\n"; diag($command." --htmlencode"); $html->trace(sprintf "+----------------------- test %d ------------------", 2); $html->logger(undef, undef, 1, "A&B"); sleep 1; ### zuletzt und command neu aufbauen ohne cfgfile nur options $output = `$command --htmlencode`; diag($output); ok(($output =~ /A&B<\/head>/) && (($? >> 8) == 2)); printf STDERR "now i add options/htmlencode\n"; $configfile = < "html", logfile => "./var/adm/messages", criticalpatterns => ["head.*body"], }); \$options = "htmlencode"; EOCFG open CCC, ">./etc/check_html.cfg"; print CCC $configfile; close CCC; # 1 critical $html->trace(sprintf "+----------------------- test %d ------------------", 2); $html->logger(undef, undef, 1, "A&B"); sleep 1; diag($command); $output = `$command`; diag($output); ok(($output =~ /<head title="bled">A&B<\/head><body title='bb'>/) && (($? >> 8) == 2)); check_logfiles-4.1.1/t/075winwarncrit.t0000664000175000017500000001377014336703157014655 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/075winwarncrit.t # # Test that all the Perl modules we require are available. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; use Data::Dumper; sub sleep_until_next_minute { my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; while ($sec < 59) { sleep 1; ($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; } sleep 2; # now it is ~ hh:00, hh:01 } if ($^O !~ /MSWin/) { diag("this is not a windows machine (cygwin does not work since vista)"); plan skip_all => 'Test only relevant on Windows'; } else { plan tests => 6; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", type => "eventlog", #criticalpatterns => ["Adobe", "Firewall" ], options => "winwarncrit", eventlog => { eventlog => "application", } } ] }); $cl->make_windows_plugin(); my $ssh = $cl->get_search_by_tag("ssh"); if ($^O !~ /MSWin|cygwin/) { diag("windows only"); foreach (1..7) {ok(1)}; exit 0; } $ssh->delete_seekfile(); $ssh->trace("deleted seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); sleep_until_next_minute(); $ssh->trace("initial run"); $cl->run(); # cleanup diag("1st run"); $cl->reset(); diag("cleanup"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep 30; $ssh->logger(undef, undef, 1, "Firewall problem1", undef, { EventType => 'Error', EventID => '12', Source => 'checkpoint', }); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 3 now find the 10 criticals and 3 warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); sleep 30; $ssh->logger(undef, undef, 10, "Firewall problem1", undef, { EventType => 'Error', EventID => '12', Source => 'checkpoint', }); $ssh->logger(undef, undef, 3, "Firewall problem1", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 3, "Firewall problem1", undef, { EventType => 'Information', EventID => '10', Source => 'checkpoint', }); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 10, 0, 2)); diag($cl->{perfdata}); ok($cl->{perfdata} =~ /'ssh_lines'=16/); # 4 now find the them with the command line $ssh->trace(sprintf "+----------------------- test %d ------------------", 4); sleep 30; $ssh->logger(undef, undef, 10, "Firewall problem1", undef, { EventType => 'Error', EventID => '12', Source => 'checkpoint', }); $ssh->logger(undef, undef, 3, "Firewall problem1", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 3, "Firewall problem1", undef, { EventType => 'Information', EventID => '10', Source => 'checkpoint', }); sleep 2; my $perlpath = ""; chomp $perlpath; if ($^O =~ /MSWin/) { if (-x '../plugins-scripts/check_logfiles.exe') { $perlpath = ''; } elsif (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl '; } else { $perlpath = 'C:\Perl\bin\perl '; } $ssh->{logfile} =~ s/\//\\/g; } else { foreach (glob "/cygdrive/c/*awberry*/perl/bin/perl.exe") { $perlpath = $_." "; last; } } my $command = sprintf $perlpath.'../plugins-scripts/check_logfiles --seekfilesdir "%s" --tag %s --type eventlog:eventlog=application --winwarncrit', TESTDIR."/var/tmp", $ssh->{tag}, $ssh->{patterns}->{CRITICAL}->[0], $ssh->{patterns}->{WARNING}->[0], $ssh->{rotation}, $ssh->{logfile}; diag($command); my $output = `$command`; ok($output =~ /10 errors, 3 warnings.*ssh_lines=16/); # 5 now find the them with the command line $ssh->trace(sprintf "+----------------------- test %d ------------------", 5); sleep 30; $ssh->logger(undef, undef, 10, "Firewall problem1", undef, { EventType => 'Error', EventID => '12', Source => 'checkpoint', }); $ssh->logger(undef, undef, 1, "Firewall problem10", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 1, "Firewall problem11", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 1, "Firewall problem12", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 1, "Feuerwall problem1", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 1, "Feuerwall problem2", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 1, "Feuerwall problem3", undef, { EventType => 'Warning', EventID => '11', Source => 'checkpoint', }); $ssh->logger(undef, undef, 3, "Feuerwall problem0", undef, { EventType => 'Information', EventID => '10', Source => 'checkpoint', }); sleep 2; $command = sprintf $perlpath.'../plugins-scripts/check_logfiles --seekfilesdir "%s" --tag %s --type eventlog:eventlog=application --winwarncrit --criticalpattern "Hilfaeaeaeae" --warningpattern "Feurio|problem0" --report long', TESTDIR."/var/tmp", $ssh->{tag}, $ssh->{patterns}->{CRITICAL}->[0], $ssh->{patterns}->{WARNING}->[0], $ssh->{rotation}, $ssh->{logfile}; # Feuerwall problem1-3 werden doppelt gezählt, 1. wegen warning, 2. wegen pattern diag($command); $output = `$command`; diag($output); ok($output =~ /10 errors, 9 warnings.*ssh_lines=19/); $cl->remove_windows_plugin(); check_logfiles-4.1.1/t/026preview.t0000664000175000017500000000662214336703157013761 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/026preview.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 5; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ options => "preview=5", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages1", criticalpatterns => ["_CRIT_" ], warningpatterns => "_WARN_", options => "noprotocol" }, { tag => "nop", logfile => TESTDIR."/var/adm/messages2", criticalpatterns => ["_CRIT_" ], warningpatterns => "_WARN_", options => "noprotocol" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $ssh->loggercrap(undef, undef, 100); my $nop = $cl->get_search_by_tag("nop"); $nop->delete_logfile(); $nop->delete_seekfile(); $nop->trace("deleted logfile and seekfile"); $nop->loggercrap(undef, undef, 100); $nop->trace("initial run"); $cl->run(); $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 1, "_CRIT_err1", 1); $ssh->logger(undef, undef, 1, "_CRIT_err2", 1); $ssh->logger(undef, undef, 1, "_CRIT_err3", 1); $ssh->logger(undef, undef, 1, "_CRIT_err4", 1); $ssh->logger(undef, undef, 1, "_CRIT_err5", 1); $ssh->logger(undef, undef, 1, "_CRIT_err6", 1); sleep 2; $ssh->loggercrap(undef, undef, 100); $nop->trace(sprintf "+----------------------- test %d ------------------", 1); $nop->logger(undef, undef, 1, "_CRIT_Err1", 1); $nop->logger(undef, undef, 1, "_CRIT_Err2", 1); $nop->logger(undef, undef, 1, "_CRIT_Err3", 1); $nop->logger(undef, undef, 1, "_WARN_War1", 1); $nop->logger(undef, undef, 1, "_WARN_War2", 1); sleep 2; $nop->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 9, 0, 2)); ok($cl->{exitmessage} eq "CRITICAL - (9 errors, 2 warnings) - _CRIT_Err3, _CRIT_Err2, _CRIT_Err1, _CRIT_err6, _CRIT_err5 "); $nop->logger(undef, undef, 1, "_ZOIGS_", 1); $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 1, "_CRIT_err1", 1); $ssh->logger(undef, undef, 1, "_CRIT_err2", 1); $ssh->logger(undef, undef, 1, "_CRIT_err3", 1); $ssh->logger(undef, undef, 1, "_CRIT_err4", 1); $ssh->logger(undef, undef, 1, "_CRIT_err5", 1); $ssh->logger(undef, undef, 1, "_CRIT_err6", 1); sleep 2; $ssh->loggercrap(undef, undef, 100); $nop->trace(sprintf "+----------------------- test %d ------------------", 1); $nop->logger(undef, undef, 1, "_CRIT_Err1", 1); $nop->logger(undef, undef, 1, "_CRIT_Err2", 1); $nop->logger(undef, undef, 1, "_CRIT_Err3", 1); $nop->logger(undef, undef, 1, "_WARN_War1", 1); $nop->logger(undef, undef, 1, "_WARN_War2", 1); sleep 2; $nop->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("only 4"); $cl->set_option("preview", 4); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 9, 0, 2)); ok($cl->{exitmessage} eq "CRITICAL - (9 errors, 2 warnings) - _CRIT_Err3, _CRIT_Err2, _CRIT_Err1, _CRIT_err6 "); check_logfiles-4.1.1/t/012lairdofglencairn.t0000664000175000017500000000420514336703157015571 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/001simple.t # # Test that all the Perl modules we require are available. # # vielen Dank für die Info. Mein Problem wäre jetzt in diesem Fall, das sich die Logdateien jeden Tag bzw. jedes mal anders nennen. Einige Logdateien tragen den Namen LOGBUCH20060801230000{b] und andere [B]LOGFILE_200631. Also einmal mit Jahr, Monat, Tag, Stunde, Minute, Sekunde und das andere Logfile mit Jahr, Kalenderwoche. Habe das zur Zeit mit Platzhaltern gelöst. Also wenn ich in einem Skript LOGFILE_JJJJKW stehen habe, wird der Dateiname durch das aktuelle Jahr und die aktuelle Kalenderwoche ersetzt. use strict; use Test::More tests => 2; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", macros => { VARDIR => '/var/adm', EVILUSER => 'lausser/2'}, searches => [ { tag => "ssh", logfile => TESTDIR.'$VARDIR$/LOGFILE_$CL_DATE_YYYY$$CL_DATE_CW$', criticalpatterns => ["Failed password", 'evil user $EVILUSER$ logged in'], warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. # # BUT!!!! these might be one-shot logfiles. they must be searched from pos 0 # $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); sleep 1; $ssh->trace(sprintf "initial run for file %s", $ssh->{logfile}); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->logger(undef, undef, 1, "alert! evil user lausser/2 logged in"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 3, 0, 2)); check_logfiles-4.1.1/t/009simplemacros.t0000664000175000017500000002204614336703157014775 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/009simplemacros.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 12; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use Net::Domain qw(hostname hostdomain hostfqdn); use Socket; use constant TESTDIR => "."; # # some macros in patterns # some search specific macros # a dynamically named logfile # test also an external config file # # my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", macros => { CL_VG00 => '/dev/vg00', CL_VG => '/dev/vg' }, searches => [ { tag => "lvm", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["SCSI errors", 'the ipaddress macro: $CL_IPADDRESS$', 'the hostname macro: $CL_HOSTNAME$', 'the domain macro: $CL_DOMAIN$', 'the fqdn macro: $CL_FQDN$', 'the servicedesc macro: $CL_SERVICEDESC$', 'the year macro: $CL_DATE_YYYY$', 'the 2year macro: $CL_DATE_YY$', 'the month macro: $CL_DATE_MM$', ], warningpatterns => ["mpio: disk .* disappeared", "mpio: no light"], criticalexceptions => '$CL_VG00$' } ] }); my $lvm = $cl->get_search_by_tag("lvm"); $lvm->delete_logfile(); $lvm->delete_seekfile(); $lvm->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $lvm->logger(undef, undef, 2, "Failed password for invalid user1..."); $lvm->logger(undef, undef, 200, "SCSI errors at device /dev/vg00"); sleep 1; $lvm->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $cl->reset(); $lvm->loggercrap(undef, undef, 100); $lvm->logger(undef, undef, 2, "SCSI errors at device /dev/vg00"); $lvm->logger(undef, undef, 2, "mpio: no light"); $lvm->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); # now find the two criticals and the two warnings $cl->reset(); $lvm->loggercrap(undef, undef, 100); $lvm->logger(undef, undef, 20, "SCSI errors at device /dev/vg00"); $lvm->logger(undef, undef, 2, "mpio: no light"); $lvm->logger(undef, undef, 20, "SCSI errors at device /dev/vg01"); $lvm->logger(undef, undef, 20, "SCSI errors at device /dev/vg04"); $lvm->loggercrap(undef, undef, 100); $lvm->logger(undef, undef, 2, "SCSI errors at device /dev/vg01"); $lvm->logger(undef, undef, 20, "SCSI errors at device /dev/vg00"); $lvm->logger(undef, undef, 2, "mpio: no light"); $lvm->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 4, 42, 0, 2)); # now find our ip-address $lvm->trace("==== 4 ===="); $cl->reset(); $lvm->loggercrap(undef, undef, 100); diag(sprintf "setting ip address to %s", inet_ntoa(scalar gethostbyname(hostname()))); $lvm->logger(undef, undef, 2, sprintf "the hostname macro: %s", hostname()); $lvm->logger(undef, undef, 2, sprintf "the domain macro: %s", hostdomain()); $lvm->logger(undef, undef, 2, sprintf "the fqdn macro: %s", hostfqdn()); $lvm->logger(undef, undef, 2, sprintf "the ipaddress macro: %s", inet_ntoa(scalar gethostbyname(hostname()))); $lvm->logger(undef, undef, 2, sprintf "the servicedesc macro: %s", $cl->{cfgbase}); my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; $lvm->logger(undef, undef, 2, sprintf "the year macro: %s", $year + 1900); $lvm->logger(undef, undef, 2, sprintf "the 2year macro: %02s", $year - 100); $lvm->logger(undef, undef, 2, sprintf "the month macro: %s", sprintf "%02d", $mon + 1); $lvm->logger(undef, undef, 2, "mpio: no light"); $lvm->loggercrap(undef, undef, 100); sleep 1; system("ls -li ./var/adm/messages"); $cl->run(); $lvm->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 16, 0, 2)); $cl->trace("-----------------------phase2-----------------------"); my $configfile = < "lvm", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ['the username macro: \$CL_USERNAME\$'], } ); EOCFG my $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; unlink "./etc/check_action.cfg" if -f "./etc/check_action.cfg"; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $username = scalar getpwuid $>; if ($^O =~ /(cygwin|MSWin)/ && $username =~ /(\w+)\+(\w+)/) { # hostname+username $username = $2; } diag("i am user $username"); $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => './etc/check_action.cfg'}); $lvm = $cl->get_search_by_tag("lvm"); $cl->reset(); $lvm->logger(undef, undef, 2, "SCSI errors at device /dev/vg00"); sleep 1; $lvm->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $lvm->loggercrap(undef, undef, 10); $lvm->logger(undef, undef, 1, "the username macro: $username hohoho"); $lvm->loggercrap(undef, undef, 10); sleep 1; system("ls -li ./var/adm/messages"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); $cl->trace("-----------------------phase3-----------------------"); diag("check macros in prescript"); $configfile = < "lvm", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ['the username macro: \$CL_USERNAME\$'], } ); EOCFG $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; unlink "./etc/check_action.cfg" if -f "./etc/check_action.cfg"; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; $username = scalar getpwuid $>; if ($^O =~ /(cygwin|MSWin)/ && $username =~ /(\w+)\+(\w+)/) { # hostname+username $username = $2; } diag("i am user $username"); $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => './etc/check_action.cfg'}); $lvm = $cl->get_search_by_tag("lvm"); $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} =~ /i am user $username/); # prescript sees macros ok($cl->expect_result(0, 0, 1, 0, 2)); diag("check macros in postscript"); $configfile = < "lvm", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ['the username macro: \$CL_USERNAME\$'], } ); EOCFG $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; unlink "./etc/check_action.cfg" if -f "./etc/check_action.cfg"; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => './etc/check_action.cfg'}); $lvm = $cl->get_search_by_tag("lvm"); $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} =~ /i am service check_action/); # postscript sees macros ok($cl->expect_result(0, 0, 1, 0, 2)); diag("check macros in smartscript"); $configfile = < "lvm", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ['the username macro: \$CL_USERNAME\$'], options => 'supersmartscript', script => sub { printf "i send my hit via nsca and i use the desc %s\\n", \$ENV{CHECK_LOGFILES_NSCA_SERVICEDESC}; return 2; }, } ); EOCFG $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; diag("./etc/check_action.cfg exists") if -f "./etc/check_action.cfg"; unlink "./etc/check_action.cfg" if -f "./etc/check_action.cfg"; diag("./etc/check_action.cfg deleted") if ! -f "./etc/check_action.cfg"; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; $cl = undef; $lvm = undef; $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => './etc/check_action.cfg'}); $lvm = $cl->get_search_by_tag("lvm"); $cl->reset(); $lvm->loggercrap(undef, undef, 10); $lvm->logger(undef, undef, 1, "the username macro: $username hohoho"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} =~ /i send my hit via nsca and i use the desc check_action/); # script sees macros ok($cl->expect_result(0, 0, 1, 0, 2)); check_logfiles-4.1.1/t/034preferredlevel.t0000664000175000017500000001521314336703157015301 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/001simple.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 11; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["Failed password", "user3"], warningpatterns => '.*', } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals # and 2 warnings, because of the .* $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # set the new preferredlevel option $ssh->set_option('preferredlevel', 'critical'); # # 3 now find the two criticals # do not match the warningpatterns, prefer critical $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 4 now find the four criticals # do not match the warningpatterns, prefer critical $ssh->trace(sprintf "+----------------------- test %d ------------------", 4); $cl->reset(); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); # set the new preferredlevel option $ssh->set_option('preferredlevel', 'warning'); # # 5 now find the two warnings # do not match the (4) criticalpatterns, prefer warning $ssh->trace(sprintf "+----------------------- test %d ------------------", 5); $cl->reset(); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); undef $cl; undef $ssh; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["Failed password", "user3"], warningpatterns => '.*', options => 'preferredlevel=critical', } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 6 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 6); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # # 7 now find the two criticals # do not match the warningpatterns, prefer critical $ssh->trace(sprintf "+----------------------- test %d ------------------", 7); $cl->reset(); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # # 8 now find the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 8); $cl->reset(); $ssh->logger(undef, undef, 2, "schnorch! orch! ksorch!"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); undef $cl; undef $ssh; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["Failed password", "user3"], warningpatterns => '.*', options => 'preferredlevel=warning', } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 9 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 9); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # # 10 now find the two warnings # do not match the (4) criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 10); $cl->reset(); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); # # 11 now find the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 11); $cl->reset(); $ssh->logger(undef, undef, 2, "schnorch! orch! ksorch!"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); check_logfiles-4.1.1/t/032encoding.t0000664000175000017500000000363314336703157014062 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/032encoding.t # # Test everything using windows encoding. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if (($^O ne "cygwin") and ($^O !~ /MSWin/)) { diag("this is not a windows machine"); plan skip_all => 'Test only relevant on Windows'; } elsif (! -f 'c:\Windows\Tasks\SchedLgU.txt' || ! -f 'C:\WINDOWS\SchedLgU.txt' || ! -f 'c:\Windows\Tasks\SchedLgU.txt') { diag("no suitable file was found"); plan skip_all => 'Test can only run with an encoded file'; } else { plan tests => 2; } my $cl = Nagios::CheckLogfiles::Test->new({ options => "supersmartpostscript", postscript => sub { printf "doooooof\n"; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; }, protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "enc", type => 'simple', logfile => -f 'c:\Windows\Tasks\SchedLgU.txt' ? 'c:\Windows\Tasks\SchedLgU.txt' : 'C:\WINDOWS\SchedLgU.txt', #criticalpatterns => "MpCmdRun\.exe", # sollte immer drinstehen wegen was auch immer criticalpatterns => ['Ergebnis', 'Gestartet'], options => 'encoding=ucs-2' } ] }); my $enc = $cl->get_search_by_tag("enc"); $enc->delete_seekfile(); $enc->trace("deleted seekfile"); $enc->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $enc->{newstate}->{logoffset} = 0; $enc->{newstate}->{logtime} = 0; $enc->savestate(); # now find the two criticals $enc->trace("==== 2 ===="); $cl->reset(); sleep 1; $cl->run(); #printf "%s\n", Data::Dumper::Dumper($enc->{matchlines}); #printf "%s\n", Data::Dumper::Dumper($cl); diag($cl->has_result()); diag($cl->{exitmessage}); #ok($cl->expect_result(0, 0, 2, 0, 2)); # genaue zahl kann variieren ok($cl->{exitcode} == 2); check_logfiles-4.1.1/t/031lapping.t0000664000175000017500000000437214336703157013726 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/031lapping.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 3; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 3 now find the two criticals and the two warnings. detect the new file. $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $ssh->delete_logfile(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); check_logfiles-4.1.1/t/010gzrotation.t0000664000175000017500000001547714336703157014501 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/010gzrotation.t # # Test the capability of finding rotated logfiles. # use strict; use Test::More tests => 14; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if ($^O =~ /MSWin/) { $ENV{PATH} = $ENV{PATH}.';C:\Programme\cygwin\bin;C:\cygwin\bin'; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 3 ===="); $ssh->rotate_compress(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 4 ===="); $ssh->rotate_compress(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); # now write messages and find them $ssh->trace("==== 5 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 6 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 7 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # repeat but this time with nologfilenocry $cl->reset(); $ssh = $cl->get_search_by_tag("ssh"); $ssh->{options}->{logfilenocry} = 0; $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 8 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 9 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 10 ===="); $ssh->rotate_compress(); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 11 ===="); $ssh->rotate_compress(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now write messages and find them $ssh->trace("==== 12 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 13 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 14 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate_compress(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); check_logfiles-4.1.1/t/007threshold.t0000664000175000017500000003772314336703157014301 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/007threshold.t # # Test that all the Perl modules we require are available. # Simulate a portscan. Connections to port 80 are ok. # use strict; use Test::More tests => 36; use Cwd; use Data::Dumper; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3 }] }); my $nmap = $cl->get_search_by_tag("nmap"); $cl->reset(); $nmap->delete_logfile(); $nmap->delete_seekfile(); diag("deleted logfile and seekfile"); $nmap->trace("deleted logfile and seekfile"); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 1 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..70) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); $nmap->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 170 C insges. / 10 # 2 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..100) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 99 C 1 W } $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 30, "connection on port 80"); # 30 W $nmap->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $nmap->dump_protocol(); #diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 199 C 31 W # 3 # 199 = 19 * _10_ + 9, 31 = 10 * _3_ + 1 # rest 9 C 1 W $cl->reset(); $cl->run(); # logfile did not change. do nothing ok($cl->expect_result(0, 0, 0, 0, 0)); # 4 sleep 10; $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 12, "connection refused"); # 9 waren uebrig, + 12 = 21 # es ist auch noch eine warning uebrig. diese ist aber erst dann wieder relevant, wenn noch weitere neue warnings dazukommen und die schwelle ueberschreiten $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 5 ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 1) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 1)); # 6 $cl->reset(); $nmap->logger(undef, undef, 9, "connection refused"); # 1 C uebrig, + 9 = 10 $nmap->logger(undef, undef, 5, "connection on port 80"); # 1 W uebrig + 5 = 6 $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 1, 0, 2)); # 7 ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 0) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); # 8 $cl = undef; $nmap = undef; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, options => "nosavethresholdcount", }] }); $nmap = $cl->get_search_by_tag("nmap"); $cl->reset(); $nmap->delete_logfile(); $nmap->delete_seekfile(); diag(Data::Dumper::Dumper($nmap->{options})); diag("deleted logfile and seekfile"); $nmap->trace("deleted logfile and seekfile"); $nmap->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ## reset run 9 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..70) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); $nmap->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 10 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..100) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 99C 1 W } $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 30, "connection on port 80"); # 30 W $nmap->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $nmap->dump_protocol(); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 11 $cl->reset(); $cl->run(); ok($cl->expect_result(0, 0, 0, 0, 0)); # 12 $cl->reset(); diag("thresholdcnt must be 0"); diag(Data::Dumper::Dumper($cl->{allerrors})); diag(Data::Dumper::Dumper($nmap->{threshold})); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 12, "connection refused hihi"); # 12 C $cl->run(); diag("now it is"); diag(Data::Dumper::Dumper($nmap->{matchlines})); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); diag(Data::Dumper::Dumper($cl->{allerrors})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 13 $cl->reset(); $nmap->logger(undef, undef, 9, "connection refused hoho"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 14 ok($nmap->{thresholdcnt}->{CRITICAL} == 9); $cl->reset(); $nmap->logger(undef, undef, 15, "connection refused haha"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 16 ok($nmap->{thresholdcnt}->{CRITICAL} == 5); #################################################################### # now the same but with the new method # options => 'criticalthreshold=x,warningthreshold=y $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, options => 'criticalthreshold=10,warningthreshold=3', }] }); $nmap = $cl->get_search_by_tag("nmap"); $cl->reset(); $nmap->delete_logfile(); $nmap->delete_seekfile(); diag("deleted logfile and seekfile"); $nmap->trace("deleted logfile and seekfile"); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 1 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..70) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); $nmap->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 170 C insges. / 10 # 2 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..100) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 99 C 1 W } $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 30, "connection on port 80"); # 30 W $nmap->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $nmap->dump_protocol(); #diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 199 C 31 W # 3 # 199 = 19 * _10_ + 9, 31 = 10 * _3_ + 1 # rest 9 C 1 W $cl->reset(); $cl->run(); # logfile did not change. do nothing ok($cl->expect_result(0, 0, 0, 0, 0)); # 4 sleep 10; $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 12, "connection refused"); # 9 waren uebrig, + 12 = 21 # es ist auch noch eine warning uebrig. diese ist aber erst dann wieder relevant, wenn noch weitere neue warnings dazukommen und die schwelle ueberschreiten $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 5 ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 1) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 1)); # 6 $cl->reset(); $nmap->logger(undef, undef, 9, "connection refused"); # 1 C uebrig, + 9 = 10 $nmap->logger(undef, undef, 5, "connection on port 80"); # 1 W uebrig + 5 = 6 $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 1, 0, 2)); # 7 ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 0) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); # 8 $cl = undef; $nmap = undef; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, options => 'criticalthreshold=10,warningthreshold=3,nosavethresholdcount', }] }); $nmap = $cl->get_search_by_tag("nmap"); $cl->reset(); $nmap->delete_logfile(); $nmap->delete_seekfile(); diag(Data::Dumper::Dumper($nmap->{options})); diag("deleted logfile and seekfile"); $nmap->trace("deleted logfile and seekfile"); $nmap->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ## reset run 9 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..70) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); $nmap->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 10 $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..100) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 99C 1 W } $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 30, "connection on port 80"); # 30 W $nmap->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $nmap->dump_protocol(); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); #diag(Data::Dumper::Dumper($nmap->{laststate})); #diag(Data::Dumper::Dumper($nmap->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 11 $cl->reset(); $cl->run(); ok($cl->expect_result(0, 0, 0, 0, 0)); # 12 $cl->reset(); diag("thresholdcnt must be 0"); diag(Data::Dumper::Dumper($cl->{allerrors})); diag(Data::Dumper::Dumper($nmap->{threshold})); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 12, "connection refused hihi"); # 12 C $cl->run(); diag("now it is"); diag(Data::Dumper::Dumper($nmap->{matchlines})); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); diag(Data::Dumper::Dumper($cl->{allerrors})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 13 $cl->reset(); $nmap->logger(undef, undef, 9, "connection refused hoho"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 14 ok($nmap->{thresholdcnt}->{CRITICAL} == 9); $cl->reset(); $nmap->logger(undef, undef, 15, "connection refused haha"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 16 ok($nmap->{thresholdcnt}->{CRITICAL} == 5); ###### now with --criticalthreshold --warningtheshold $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, options => 'criticalthreshold=10,warningthreshold=3,nosavethresholdcount', }] }); $nmap = $cl->get_search_by_tag("nmap"); $cl->reset(); $nmap->delete_logfile(); $nmap->delete_seekfile(); diag(Data::Dumper::Dumper($nmap->{options})); diag("deleted logfile and seekfile"); $nmap->trace("deleted logfile and seekfile"); $nmap->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; # dummy command my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $nmap->{logfile} =~ s/\//\\/g; } my $command = sprintf $perlpath.' ../plugins-scripts/check_logfiles --tag=nmap --criticalpattern="(connection refused)|(connection on port\\s+\\d+)|(session aborted)" --warningpattern="(.*total size is 0 .*)|(connection on port\\s+80[^\\d]*)" --logfile %s --warningthreshold 3 --criticalthreshold 10 --seekfilesdir "%s"', $nmap->{logfile}, $nmap->{seekfilesdir}; diag("now run a dummy commandline"); my $output = `$command`; diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); $cl->reset(); $nmap->loggercrap(undef, undef, 100); $nmap->logger(undef, undef, 100, "connection refused"); # 100 C $nmap->loggercrap(undef, undef, 100); foreach my $port (1..70) { $nmap->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $nmap->trace("executing %s", $command); diag("now run the real commandline which expects 17 criticals"); $output = `$command`; diag($output); ok(($output =~ /CRITICAL - \(17 errors/) && (($? >> 8) == 2)); check_logfiles-4.1.1/t/028sticky.t0000664000175000017500000007631114336703157013612 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/028sticky.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 120; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $now = time; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky", } ] }); my $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $door->trace(sprintf "+----------------------- test %d ------------------", 1); $door->logger(undef, undef, 2, "Failed password for invalid user1..."); sleep 2; $door->loggercrap(undef, undef, 100); sleep 1; $door->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $door->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the door open1"); $door->logger(undef, undef, 1, "the door open2"); $door->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); ok($cl->{exitmessage} =~ /2 errors in/); # 3 no error messages but still critical (inherited the last ones) $door->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $door->loggercrap(undef, undef, 100); $door->logger(undef, undef, 2, "Failed password for invalid user3"); $door->loggercrap(undef, undef, 100); $door->logger(undef, undef, 2, "Unknown user sepp"); $door->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); #printf "%s\n", Data::Dumper::Dumper($door->{newstate}); ok($cl->expect_result(0, 0, 2, 0, 2)); ok($cl->{exitmessage} =~ /2 errors in/); # 4 nothing happens but the error sticks like shit $door->trace(sprintf "+----------------------- test %d ------------------", 4); $cl->reset(); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); #printf "%s\n", Data::Dumper::Dumper($door->{newstate}); ok($cl->expect_result(0, 0, 2, 0, 2)); ok($cl->{exitmessage} =~ /2 errors in/); # 5 a new error appears $door->trace(sprintf "+----------------------- test %d ------------------", 5); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open3"); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 3, 0, 2)); ok($cl->{exitmessage} =~ /3 errors in.*open3 \.\.\./); # 6 one more time. still critical $door->trace(sprintf "+----------------------- test %d ------------------", 6); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 3, 0, 2)); ok($cl->{exitmessage} =~ /3 errors in.*open3 \.\.\./); # 7 enough. send a remedy pattern $door->trace(sprintf "+----------------------- test %d ------------------", 7); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 2, "door closed"); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ok($cl->{exitmessage} =~ /no errors/); # 8 really over? $door->trace(sprintf "+----------------------- test %d ------------------", 8); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 9 stick again $door->trace(sprintf "+----------------------- test %d ------------------", 9); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open"); $door->loggercrap(undef, undef, 10); $door->{maxstickytime} = 15; sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 15 left ok($cl->{exitmessage} =~ /1 errors in.*open\s*$/); # 10 still stick. 5 seconds pass. $door->trace(sprintf "+----------------------- test %d ------------------", 10); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 10 left ok($cl->{exitmessage} =~ /1 errors in.*open\s*$/); # 11 still sticky. let 11 seconds pass. $door->trace(sprintf "+----------------------- test %d ------------------", 11); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); sleep 11; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 3 left # 12 still sticky. let 5 seconds pass. now it expires $door->trace(sprintf "+----------------------- test %d ------------------", 12); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); sleep 5; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ok($cl->{exitmessage} =~ /no errors/); ########### next test is the same, but one time a new error message prolongs the stickytime # maxsticky still 15 # 13 enough. send a remedy pattern $door->trace(sprintf "+----------------------- test %d ------------------", 13); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 2, "door closed"); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 14 really over? $door->trace(sprintf "+----------------------- test %d ------------------", 14); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 15 stick $door->trace(sprintf "+---------------------- test %d ------------------", 15); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open1"); $door->loggercrap(undef, undef, 10); $door->{maxstickytime} = 15; sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # sticking starts. 15 seconds left. ok($cl->{exitmessage} =~ /1 errors.*open1\s*$/); # 16 still stick. $door->trace(sprintf "+----------------------- test %d ------------------", 16); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); sleep 10; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 5 seconds left ok($cl->{exitmessage} =~ /1 errors.*open1\s*$/); # 17 prolong for another 15 secs $door->trace(sprintf "+----------------------- test %d ------------------", 15); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open2"); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); # again 15 seconds diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); #the sticky + the new error ok($cl->{exitmessage} =~ /2 errors.*open2 \.\.\.*$/); ok(scalar(@{$door->{newstate}->{matchlines}->{CRITICAL}}) == 1); # 18 still sticky. let 5 seconds pass. $door->trace(sprintf "+----------------------- test %d ------------------", 18); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); sleep 5; $cl->run(); # still 10 diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); #the sticky error ok($cl->{exitmessage} =~ /1 errors.*open2\s*$/); # 19 still sticky. let 12 seconds pass. now it expires $door->trace(sprintf "+----------------------- test %d ------------------", 19); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); sleep 12; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl = undef; $door = undef; # ## # repeat the stuff with maxstickytime, but this time initialize cl with sticky=15 # $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky=15", } ] }); my $x = @{$cl->{searches}}[0]; diag(sprintf "1 optsticky %d / maxsticky %d", $x->{options}->{sticky}, $x->{maxstickytime}); $door = $cl->get_search_by_tag("door"); diag(sprintf "2 optsticky %d / maxsticky %d", $door->{options}->{sticky}, $door->{maxstickytime}); $door->delete_logfile(); $door->delete_seekfile(); diag(sprintf "3 optsticky %d / maxsticky %d", $door->{options}->{sticky}, $door->{maxstickytime}); $door->trace("deleted logfile and seekfile"); diag(sprintf "MAXMAX %d" ,$door->{maxstickytime}); ok($door->{maxstickytime} == 15); # 20 ok($door->{options}->{sticky} == 1); # 30 enough. send a remedy pattern $door->trace(sprintf "+----------------------- test %d ------------------", 30); $cl->reset(); diag("send remedy"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 2, "door closed"); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 31 really over? $door->trace(sprintf "+----------------------- test %d ------------------", 31); $cl->reset(); diag("send nothing"); $door->loggercrap(undef, undef, 10); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 32 stick again $door->trace(sprintf "+----------------------- test %d ------------------", 32); $cl->reset(); diag("send 1 warning"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open"); $door->loggercrap(undef, undef, 10); sleep 2; $now = time; diag(sprintf "%d seconds from %d passed", time - $now, $door->{maxstickytime}); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 15 left # 33 still stick. 5 seconds pass. $door->trace(sprintf "+----------------------- test %d ------------------", 33); $cl->reset(); diag("send 1 not relevant"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); diag(sprintf "it is %s", scalar localtime); diag(sprintf "sleep until %s (%d s)", scalar localtime ($now + 5), ($now + 5) - time); sleep (($now + 5) - time); diag(sprintf "%d seconds from %d passed", time - $now, $door->{maxstickytime}); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 10 left # 34 still sticky. let 5 seconds pass. $door->trace(sprintf "+----------------------- test %d ------------------", 34); $cl->reset(); diag("send 1 not relevant"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); diag(sprintf "it is %s", scalar localtime); diag(sprintf "sleep until %s (%d s)", scalar localtime ($now + 10), ($now + 10) - time); sleep (($now + 10) - time); diag(sprintf "%d seconds from %d passed", time - $now, $door->{maxstickytime}); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 5 left # 35 still sticky. let 5 seconds pass. now it expires $door->trace(sprintf "+----------------------- test %d ------------------", 35); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window broken"); $door->loggercrap(undef, undef, 10); diag(sprintf "it is %s", scalar localtime); diag(sprintf "sleep until %s (%d s)", scalar localtime ($now + 15), ($now + 15) - time); sleep (($now + 15) - time + 1); diag(sprintf "%d seconds from %d passed", time - $now, $door->{maxstickytime}); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 36 new sticky error $door->trace(sprintf "+----------------------- test %d ------------------", 36); $cl->reset(); diag("send 1 critical go"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open"); $door->loggercrap(undef, undef, 10); sleep 2; diag(sprintf "%d seconds from %d passed", time - $now, $door->{maxstickytime}); $cl->run(); diag(sprintf "sticky is %d", $door->{options}->{sticky}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 15 left # 37 relief $door->trace(sprintf "+----------------------- test %d ------------------", 37); $cl->reset(); diag("send 3 relief"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window closed"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window closed"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window closed"); $door->loggercrap(undef, undef, 10); sleep 2; diag(sprintf "%d seconds from %d passed", time - $now, $door->{maxstickytime}); $cl->run(); diag(sprintf "sticky is %d", $door->{options}->{sticky}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($door->{options}->{sticky} == 4); ok($cl->expect_result(0, 0, 0, 0, 0)); # diag("test block 3"); # # critical sticky # then comes a warning # and the result must still be sticky critical with the critical message $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky", } ] }); $door = $cl->get_search_by_tag("door"); diag(sprintf "2 optsticky %d / maxsticky %d", $door->{options}->{sticky}, $door->{maxstickytime}); $door->delete_logfile(); $door->delete_seekfile(); diag(sprintf "3 optsticky %d / maxsticky %d", $door->{options}->{sticky}, $door->{maxstickytime}); $door->trace("deleted logfile and seekfile"); ok($door->{options}->{sticky} == 1); # # first initialize # $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag(sprintf "sticky is %d", $door->{options}->{sticky}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($door->{options}->{sticky} == 1); ok($cl->expect_result(0, 0, 0, 0, 0)); # # # first a critical $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # # # then an empty run $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # # # now the warning $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window unlocked"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); # # # then an empty run and we should see the 1 critical $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); # # # another warning and another critical $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window unlocked2"); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open2"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # # # then ther should only be the first critical left $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # diag("test block 4"); # sticky=15 # critical sticky # sleep 10 # then comes a warning # and the result must still be sticky critical with the critical message # sleep 6 # and the result must still be sticky warning # sleep 4 # and the result must still be sticky warning # sleep 6 # ok $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky=15,noprotocol", } ] }); $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # # first initialize # $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag(sprintf "sticky is %d", $door->{options}->{sticky}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($door->{options}->{sticky} == 1); ok($cl->expect_result(0, 0, 0, 0, 0)); # # # first a critical $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # # # then an empty run $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # sleep 10; # # now the warning $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window unlocked"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); # # # then an empty run and we should see the 1 critical + 1 warning $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); # sleep 6; # # the critical should have expired, but a second warning came $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window unlocked2"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); # sleep 4; # # warning1 is 10 seconds old, warning2 4 seconds $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); # ok($cl->{exitmessage} =~ /unlocked2 \.\.\./); diag("now we should see expiry in the trace"); sleep 6; # # warning1 is 16 seconds old, expired. warning2 is 10 seconds old $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 0, 0, 1)); # diag("---".$cl->{exitmessage}."--"); ok($cl->{exitmessage} =~ /unlocked2\s*$/); diag("sleep 6"); sleep 6; # # then everything has expired $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # diag("test block 5"); # sticky=15 # critical sticky # sleep 10 # then comes a warning # and the result must still be sticky critical with the critical message # sleep 6 # and the result must still be sticky warning # sleep 4 # and the result must still be sticky warning # sleep 6 # ok $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", options => "report=long", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky=15,noprotocol", } ] }); $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # # first initialize # $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag(sprintf "sticky is %d", $door->{options}->{sticky}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($door->{options}->{sticky} == 1); ok($cl->expect_result(0, 0, 0, 0, 0)); # # # first a critical $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # # # then an empty run $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # sleep 10; # # now the warning $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window unlocked1"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); # # # then an empty run and we should see the 1 critical + 1 warning $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{long_exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); # sleep 6; # # the critical should have expired, but a second warning came $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window unlocked2"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); # sleep 4; # # warning1 is 10 seconds old, warning2 4 seconds $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 0, 0, 1)); # ok($cl->{exitmessage} =~ /unlocked2 \.\.\./); diag($cl->{long_exitmessage}); ok($cl->{long_exitmessage} =~ /tag door WARNING/); ok($cl->{long_exitmessage} =~ /unlocked1/); ok($cl->{long_exitmessage} =~ /unlocked2/); diag("now we should see expiry in the trace"); sleep 6; # # warning1 is 16 seconds old, expired. warning2 is 10 seconds old $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 0, 0, 1)); # ok($cl->{exitmessage} =~ /unlocked2\s*$/); diag($cl->{long_exitmessage}); ok($cl->{long_exitmessage} =~ /tag door WARNING/); ok($cl->{long_exitmessage} !~ /unlocked1/); ok($cl->{long_exitmessage} =~ /unlocked2/); diag("sleep 6"); sleep 6; # # then everything has expired $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # ok($door->{options}->{report} eq "long"); diag("okpatterns"); # # first initialize # $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag(sprintf "sticky is %d", $door->{options}->{sticky}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($door->{options}->{sticky} == 1); ok($cl->expect_result(0, 0, 0, 0, 0)); # # a new error appears $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open1"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # one more time. still critical $door->trace(sprintf "+----------------------- test %d ------------------", 6); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # enough. send a remedy pattern $door->trace(sprintf "+----------------------- test %d ------------------", 7); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open2"); $door->logger(undef, undef, 1, "window closed"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # confirm $cl->reset(); $cl->run(); ok($cl->expect_result(0, 0, 0, 0, 0)); # # a new error appears $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open1"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); ok($cl->{exitmessage} =~ /open1/); # enough. send a remedy pattern $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "window closed"); $door->logger(undef, undef, 1, "the window open2"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); ok($cl->{exitmessage} =~ /open2/); diag("expire old events with report=short, check the numbers"); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", options => "report=short", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky=15,noprotocol", } ] }); $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # # first initialize # $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # # a new error appears $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open1"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); ok($cl->{exitmessage} =~ /\(1 errors\).*open1\s*$/); # 5s later, another two sleep 5; $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window open2"); $door->logger(undef, undef, 10, "the window open3"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 12, 0, 2)); ok($cl->{exitmessage} =~ /\(12 errors\).*open3 \.\.\./); # 5s later, another one sleep 5; $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the window unlocked1"); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 12, 0, 2)); ok($cl->{exitmessage} =~ /\(12 errors, 1 warnings\).*open3 \.\.\./); # one more time. still critical $cl->reset(); $door->loggercrap(undef, undef, 10); $door->loggercrap(undef, undef, 10); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 12, 0, 2)); ok($cl->{exitmessage} =~ /\(12 errors, 1 warnings\).*open3 \.\.\./); # first critical expires sleep 5; $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 11, 0, 2)); ok($cl->{exitmessage} =~ /\(11 errors, 1 warnings\).*open3 \.\.\./); ok(scalar(@{$door->{newstate}->{matchlines}->{CRITICAL}}) == 1); ok(scalar(@{$door->{newstate}->{matchlines}->{WARNING}}) == 1); # eleven critical expire sleep 5; $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 0, 0, 1)); ok($cl->{exitmessage} =~ /\(1 warnings\).*unlocked1\s*$/); ok(scalar(@{$door->{newstate}->{matchlines}->{CRITICAL}}) == 0); ok(scalar(@{$door->{newstate}->{matchlines}->{WARNING}}) == 1); my $matchlines = { "OK" => [], "WARNING" => [], "CRITICAL" => [], "UNKNOWN" => [], }; foreach my $event (@{$door->{newstate}->{matchlines}->{WARNING}}) { push(@{$matchlines->{WARNING}}, $event->[1]); $door->{newstate}->{laststicked} = $event->[0]; } $door->{newstate}->{matchlines} = $matchlines; my $seekfh = new IO::File; if ($seekfh->open($door->{seekfile}, "w")) { my $dumpstate = Data::Dumper->new([$door->{newstate}], [qw(state)]); #printf("save %s\n", $dumpstate->Dump()); $dumpstate = Data::Dumper->new([$door->{newstate}], [qw(state)]); $seekfh->printf("%s\n", $dumpstate->Dump()); $seekfh->printf("\n1;\n"); $seekfh->close(); } $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 0, 0, 1)); ok($cl->{exitmessage} =~ /\(1 warnings\).*unlocked1\s*$/); ok(scalar(@{$door->{newstate}->{matchlines}->{CRITICAL}}) == 0); ok(scalar(@{$door->{newstate}->{matchlines}->{WARNING}}) == 1); sleep 16; $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); diag("now test unstick"); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "door", logfile => TESTDIR."/var/adm/messages", criticalpatterns => ["door open", "window open"], warningpatterns => ["door unlocked", "window unlocked"], okpatterns => ["door closed", "window closed"], options => "sticky", } ] }); $door = $cl->get_search_by_tag("door"); $door->delete_logfile(); $door->delete_seekfile(); $door->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $door->trace(sprintf "+----------------------- test %d ------------------", 1); $door->logger(undef, undef, 2, "Failed password for invalid user1..."); sleep 2; $door->loggercrap(undef, undef, 100); sleep 1; $door->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $door->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $door->loggercrap(undef, undef, 10); $door->logger(undef, undef, 1, "the door open1"); $door->logger(undef, undef, 1, "the door open2"); $door->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); ok($cl->{exitmessage} =~ /2 errors in/); $door->unstick(); $cl->reset(); $door->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); check_logfiles-4.1.1/t/Makefile.in0000664000175000017500000002717014336703157013731 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = t ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = am__maybe_remake_depfiles = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_OPTS = @INSTALL_OPTS@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PROTOCOLS_DIR = @PROTOCOLS_DIR@ RELEASE = @RELEASE@ SED = @SED@ SEEKFILES_DIR = @SEEKFILES_DIR@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ TRUSTED_PATH = @TRUSTED_PATH@ VERSION = @VERSION@ WARRANTY = @WARRANTY@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_nagios_group = @with_nagios_group@ with_nagios_user = @with_nagios_user@ AUTOMAKE_OPTIONS = 1.3 no-dependencies #all: tests TEST_VERBOSE = 0 TEST_TYPE = test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = *.t TESTDB_SW = -d EXTRA_DIST = *.t bin var etc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu t/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu t/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile tests: $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE))" $(TEST_FILES) # PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) clean: rm -f var/adm/this_is_random* # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: check_logfiles-4.1.1/t/086macroinglobals.t0000664000175000017500000000466614336703157015310 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/086macroinglobals.t # # Test replacements of macros in seekfilesdir # use strict; use Test::More tests => 3; use Cwd; use File::Path; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $protocolsdir = ($^O =~/MSWin/) ? 'C:\TEMP\$MACAMACA$' : '/tmp/$MACAMACA$'; my $seekfilesdir = ($^O =~/MSWin/) ? 'C:\TEMP\$MACAMACA$' : '/tmp/$MACAMACA$'; my $resolved_seekfilesdir = $seekfilesdir; $resolved_seekfilesdir =~ s/\$MACAMACA\$/gsuhjch/; my $configfile = < "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", }); EOCFG open CCC, ">./etc/check_macroseek.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => $seekfilesdir, seekfilesdir => $seekfilesdir, searches => [ { tag => "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); File::Path::rmtree($resolved_seekfilesdir); ok(! -d $resolved_seekfilesdir); my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $ssh->{logfile} =~ s/\//\\/g; } my $command = $perlpath.' ../plugins-scripts/check_logfiles --config ./etc/check_macroseek.cfg --macro MACAMACA=gsuhjch'; $ssh->trace("executing %s", $command); $ssh->trace("deleting logfile and seekfile"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 1 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); my $output = `$command`; diag($output); diag($seekfilesdir); diag($resolved_seekfilesdir); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); ok(-d $resolved_seekfilesdir); File::Path::rmtree($resolved_seekfilesdir); check_logfiles-4.1.1/t/006negative.t0000664000175000017500000001224714336703157014100 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/005negative.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 7; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "rsync", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ '.*connection unexpectedly closed.*', '.*rsync error.*', 'rsync:.*', '!.*DEBUT.*', '!.*FIN.*', '!.*building file list.*', '!.*files to consider.*', '!.*sent .* bytes\s+received .* bytes\s+.* bytes/sec.*', '!.*total size is .* \s+speedup is .*' ], warningpatterns => [ '.*total size is 0 .*', '.*sent 0 bytes.*', '.*received 0 bytes.*' ], }] }); $Data::Dumper::Indent = 1; #printf "%s\n", Data::Dumper::Dumper($cl); my $rsync = $cl->get_search_by_tag("rsync"); $cl->reset(); $rsync->delete_logfile(); $rsync->delete_seekfile(); diag("deleted logfile and seekfile"); $rsync->trace("deleted logfile and seekfile"); $rsync->logger(undef, undef, 1, "Failed password for invalid user1..."); diag("wrote 1 message"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6, 0, 2)); $cl->reset(); $rsync->delete_logfile(); $rsync->delete_seekfile(); $rsync->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $rsync->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6, 0, 2)); $cl->reset(); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "Ici le DEBUT "); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 4, "there was an rsync error"); $rsync->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); $rsync->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 8, 0, 2)); # backup working perfectly $cl->reset(); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "DEBUT du backup"); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "building file list ... done"); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "files to consider:..."); $rsync->logger(undef, undef, 1, "file file file"); $rsync->logger(undef, undef, 1, "sent 871 bytes received 26 bytes 163.09 bytes/sec"); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "total size is 30053 speedup is 33.50"); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "FIN du backup"); sleep 1; $cl->run(); $rsync->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # backup with warning $cl->reset(); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "DEBUT du backup"); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "building file list ... done"); $rsync->logger(undef, undef, 1, "files to consider:..."); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "file file file"); $rsync->logger(undef, undef, 1, "sent 0 bytes received 0 bytes 0 bytes/sec"); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "total size is 0 speedup is 0"); $rsync->loggercrap(undef, undef, 100); $rsync->logger(undef, undef, 1, "FIN du backup"); $rsync->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $rsync->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 0, 0, 1)); #backup did not run at all $cl->reset(); sleep 1; $cl->run(); $rsync->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6, 0, 2)); # allyoucaneat means, read everything during the initial run. # but we don't want an alert on missing patterns $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ options => "allyoucaneat", tag => "rsync", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ '.*connection unexpectedly closed.*', '.*rsync error.*', 'rsync:.*', '!.*DEBUT.*', '!.*FIN.*', '!.*building file list.*', '!.*files to consider.*', '!.*sent .* bytes\s+received .* bytes\s+.* bytes/sec.*', '!.*total size is .* \s+speedup is .*' ], warningpatterns => [ '.*total size is 0 .*', '.*sent 0 bytes.*', '.*received 0 bytes.*' ], }] }); $rsync = $cl->get_search_by_tag("rsync"); $cl->reset(); $rsync->delete_logfile(); $rsync->delete_seekfile(); diag("deleted logfile and seekfile"); $rsync->trace("deleted logfile and seekfile"); $rsync->logger(undef, undef, 1, "Failed password for invalid user1..."); diag("wrote 1 message"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); check_logfiles-4.1.1/t/100flooddetect.t0000664000175000017500000005160614336703157014567 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/100flooddetect.t # # Test that all the Perl modules we require are available. # Events need not exceed a certain rate. Timestamps need to be taken into account. # A short history of events needs to be saved after every run. # With the advent of a critical pattern, the rate of events needs to be calculated. # # Test 1: # Maximum of 10 event per minute can be tolerated # Simulate a check_period of 5 minutes # Start - within the first minute create an event every 2 seconds # use strict; use Test::More tests => 36; use Cwd; use Data::Dumper; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = <<'EOCFG'; sub timestamp { my $string = shift; my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; # Oct 31 15:49:21 $string =~ /^(\w+)\s+(\d+) (\d+):(\d+):(\d+)/; my $time = POSIX::mktime($5, $4, $3, $2, { "Jan" => 0, "Feb" => 1, "Mar" => 2, "Apr" => 3, "May" => 4, "Jun" => 5, "Jul" => 6, "Aug" => 7, "Sep" => 8, "Oct" => 9, "Nov" => 10, "Dec" => 11 }->{$1}, $year); return $time; } sub flood_check { my $fc = shift; # max flood events count my $fp = shift; # max flood time period for $fc events my $en = shift; # event name (key) which identifies flood check data $FLOOD{ $en } ||= []; # make empty flood array for this event name my $ar = $FLOOD{ $en }; # get array ref for event's flood array my $ec = @$ar; # events count in the flood array if( $ec >= $fc ) { # flood array has enough events to do real flood check my $ot = $$ar[0]; # oldest event timestamp in the flood array my $tp = time() - $ot; # time period between current and oldest event # now calculate time in seconds until next allowed event my $wait = int( ( $ot + ( $ec * $fp / $fc ) ) - time() ); if( $wait > 0 ) { # positive number of seconds means flood in progress # event should be rejected or postponed return $wait; } # negative or 0 seconds means that event should be accepted # oldest event is removed from the flood array shift @$ar; } # flood array is not full or oldest event is already removed # so current event has to be added push @$ar, time(); # event is ok return 0; } sub is_flood { my $events = shift; my $event_time = shift; my $flood_events = shift; # max flood events count my $flood_period = shift; # max flood time period for $fc events my $num_events = scalar(@{$events}); if ($num_events >= $flood_events) { printf STDERR "num_events %d flood_events %d\n", $num_events, $flood_events; # enough elements to make a reliable calculation my $oldest_event_time = $$events[0]; my $period = $event_time - $oldest_event_time; printf STDERR "oldest %s ... period %d\n", scalar localtime $oldest_event_time, $period; my $wait = int( ( $oldest_event_time + ( $num_events * $flood_period / $flood_events ) ) - $event_time ); if ($wait > 0) { return $wait; } else { shift @{$events}; return 0; } } else { push(@{$events}, $event_time); return 0; } } $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; $scriptpath = "./bin"; @searches = ({ tag => "flood", logfile => "./var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], options => "supersmartscript", script => sub { my $line = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; if (! exists $CHECK_LOGFILES_PRIVATESTATE->{eventhistory}) { $CHECK_LOGFILES_PRIVATESTATE->{eventhistory} = []; printf STDERR "initialized eventhistory\n"; } my $flood = is_flood($CHECK_LOGFILES_PRIVATESTATE->{eventhistory}, timestamp($line), 5, 10); if ($flood) { printf "floot reached %.3f at %s\n", $flood, scalar localtime timestamp($line); return 2; } else { return 0; } }, }); #$options = "supersmartpostscript"; $postscript = sub { my $state = $CHECK_LOGFILES_PRIVATESTATE; #printf STDERR "%s\n", Data::Dumper::Dumper($state); return 0; }; EOCFG open CCC, ">./etc/check_flood.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_flood.cfg" }); my $flood = $cl->get_search_by_tag("flood"); $cl->reset(); $flood->delete_logfile(); $flood->delete_seekfile(); diag("deleted logfile and seekfile"); $flood->trace("deleted logfile and seekfile"); $flood->logger(undef, undef, 100, "connection refused"); # 100 C diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 1 diag("now write an event every two seconds. duration is 2 minutes"); my $tic = time; #foreach my $sec (1..120) { foreach my $sec (1..20) { $flood->loggercrap(undef, undef, 10); $flood->logger(undef, undef, 1, "connection refused"); printf STDERR "write event at %s\n", scalar localtime time; $flood->loggercrap(undef, undef, 10); sleep 1; } foreach my $sec (1..40) { $flood->loggercrap(undef, undef, 10); sleep 1; } my $tac = time; printf "elapsed %d\n", $tac - $tic; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(15, 0, 5, 0, 2)); # write 4 events in 10 sec # write crap in 10 sec # repeat until a minute $tic = time; foreach my $loop (1..10) { foreach my $sec (1..3) { $flood->loggercrap(undef, undef, 10); $flood->logger(undef, undef, 1, "connection refused"); printf STDERR "write event at %s\n", scalar localtime time; sleep 1; } diag("---"); foreach my $sec (1..7) { $flood->loggercrap(undef, undef, 10); sleep 1; } diag("..."); } $tac = time; printf "4/10 sequence elapsed %d\n", $tac - $tic; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(15, 0, 5, 0, 0)); # 1 exit; $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..70) { $flood->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); $flood->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 170 C insges. / 10 # 2 $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..100) { $flood->logger(undef, undef, 1, "connection on port $port"); # 99 C 1 W } $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 30, "connection on port 80"); # 30 W $flood->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $flood->dump_protocol(); #diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 199 C 31 W # 3 # 199 = 19 * _10_ + 9, 31 = 10 * _3_ + 1 # rest 9 C 1 W $cl->reset(); $cl->run(); # logfile did not change. do nothing ok($cl->expect_result(0, 0, 0, 0, 0)); # 4 sleep 10; $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 12, "connection refused"); # 9 waren uebrig, + 12 = 21 # es ist auch noch eine warning uebrig. diese ist aber erst dann wieder relevant, wenn noch weitere neue warnings dazukommen und die schwelle ueberschreiten $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 5 ok(($flood->{newstate}->{thresholdcnt}->{CRITICAL} == 1) && ($flood->{newstate}->{thresholdcnt}->{WARNING} == 1)); # 6 $cl->reset(); $flood->logger(undef, undef, 9, "connection refused"); # 1 C uebrig, + 9 = 10 $flood->logger(undef, undef, 5, "connection on port 80"); # 1 W uebrig + 5 = 6 $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 1, 0, 2)); # 7 ok(($flood->{newstate}->{thresholdcnt}->{CRITICAL} == 0) && ($flood->{newstate}->{thresholdcnt}->{WARNING} == 0)); # 8 $cl = undef; $flood = undef; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "flood", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, options => "nosavethresholdcount", } ] }); $flood = $cl->get_search_by_tag("flood"); $cl->reset(); $flood->delete_logfile(); $flood->delete_seekfile(); diag(Data::Dumper::Dumper($flood->{options})); diag("deleted logfile and seekfile"); $flood->trace("deleted logfile and seekfile"); $flood->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ## reset run 9 $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..70) { $flood->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); $flood->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 10 $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..100) { $flood->logger(undef, undef, 1, "connection on port $port"); # 99C 1 W } $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 30, "connection on port 80"); # 30 W $flood->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $flood->dump_protocol(); diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 11 $cl->reset(); $cl->run(); ok($cl->expect_result(0, 0, 0, 0, 0)); # 12 $cl->reset(); diag("thresholdcnt must be 0"); diag(Data::Dumper::Dumper($cl->{allerrors})); diag(Data::Dumper::Dumper($flood->{threshold})); diag(Data::Dumper::Dumper($flood->{thresholdcnt})); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 12, "connection refused hihi"); # 12 C $cl->run(); diag("now it is"); diag(Data::Dumper::Dumper($flood->{matchlines})); diag(Data::Dumper::Dumper($flood->{thresholdcnt})); diag(Data::Dumper::Dumper($cl->{allerrors})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 13 $cl->reset(); $flood->logger(undef, undef, 9, "connection refused hoho"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 14 ok($flood->{thresholdcnt}->{CRITICAL} == 9); $cl->reset(); $flood->logger(undef, undef, 15, "connection refused haha"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 16 ok($flood->{thresholdcnt}->{CRITICAL} == 5); #################################################################### # now the same but with the new method # options => 'criticalthreshold=x,warningthreshold=y $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "flood", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], options => 'criticalthreshold=10,warningthreshold=3', } ] }); $flood = $cl->get_search_by_tag("flood"); $cl->reset(); $flood->delete_logfile(); $flood->delete_seekfile(); diag("deleted logfile and seekfile"); $flood->trace("deleted logfile and seekfile"); $flood->logger(undef, undef, 100, "connection refused"); # 100 C diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 1 $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..70) { $flood->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); $flood->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 170 C insges. / 10 # 2 $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..100) { $flood->logger(undef, undef, 1, "connection on port $port"); # 99 C 1 W } $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 30, "connection on port 80"); # 30 W $flood->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $flood->dump_protocol(); #diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 199 C 31 W # 3 # 199 = 19 * _10_ + 9, 31 = 10 * _3_ + 1 # rest 9 C 1 W $cl->reset(); $cl->run(); # logfile did not change. do nothing ok($cl->expect_result(0, 0, 0, 0, 0)); # 4 sleep 10; $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 12, "connection refused"); # 9 waren uebrig, + 12 = 21 # es ist auch noch eine warning uebrig. diese ist aber erst dann wieder relevant, wenn noch weitere neue warnings dazukommen und die schwelle ueberschreiten $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 5 ok(($flood->{newstate}->{thresholdcnt}->{CRITICAL} == 1) && ($flood->{newstate}->{thresholdcnt}->{WARNING} == 1)); # 6 $cl->reset(); $flood->logger(undef, undef, 9, "connection refused"); # 1 C uebrig, + 9 = 10 $flood->logger(undef, undef, 5, "connection on port 80"); # 1 W uebrig + 5 = 6 $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 1, 0, 2)); # 7 ok(($flood->{newstate}->{thresholdcnt}->{CRITICAL} == 0) && ($flood->{newstate}->{thresholdcnt}->{WARNING} == 0)); # 8 $cl = undef; $flood = undef; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "flood", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], options => 'criticalthreshold=10,warningthreshold=3,nosavethresholdcount', } ] }); $flood = $cl->get_search_by_tag("flood"); $cl->reset(); $flood->delete_logfile(); $flood->delete_seekfile(); diag(Data::Dumper::Dumper($flood->{options})); diag("deleted logfile and seekfile"); $flood->trace("deleted logfile and seekfile"); $flood->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ## reset run 9 $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..70) { $flood->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $cl->run(); #diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); $flood->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 17, 0, 2)); # 10 $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..100) { $flood->logger(undef, undef, 1, "connection on port $port"); # 99C 1 W } $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 30, "connection on port 80"); # 30 W $flood->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $flood->dump_protocol(); diag(Data::Dumper::Dumper($flood->{thresholdcnt})); #diag(Data::Dumper::Dumper($flood->{laststate})); #diag(Data::Dumper::Dumper($flood->{newstate})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 10, 19, 0, 2)); # 11 $cl->reset(); $cl->run(); ok($cl->expect_result(0, 0, 0, 0, 0)); # 12 $cl->reset(); diag("thresholdcnt must be 0"); diag(Data::Dumper::Dumper($cl->{allerrors})); diag(Data::Dumper::Dumper($flood->{threshold})); diag(Data::Dumper::Dumper($flood->{thresholdcnt})); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 12, "connection refused hihi"); # 12 C $cl->run(); diag("now it is"); diag(Data::Dumper::Dumper($flood->{matchlines})); diag(Data::Dumper::Dumper($flood->{thresholdcnt})); diag(Data::Dumper::Dumper($cl->{allerrors})); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 13 $cl->reset(); $flood->logger(undef, undef, 9, "connection refused hoho"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 14 ok($flood->{thresholdcnt}->{CRITICAL} == 9); $cl->reset(); $flood->logger(undef, undef, 15, "connection refused haha"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 16 ok($flood->{thresholdcnt}->{CRITICAL} == 5); ###### now with --criticalthreshold --warningtheshold $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "flood", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], options => 'criticalthreshold=10,warningthreshold=3,nosavethresholdcount', } ] }); $flood = $cl->get_search_by_tag("flood"); $cl->reset(); $flood->delete_logfile(); $flood->delete_seekfile(); diag(Data::Dumper::Dumper($flood->{options})); diag("deleted logfile and seekfile"); $flood->trace("deleted logfile and seekfile"); $flood->logger(undef, undef, 100, "connection refused"); diag("wrote 100 messages"); sleep 1; # dummy command my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $flood->{logfile} =~ s/\//\\/g; } my $command = sprintf $perlpath.' ../plugins-scripts/check_logfiles --tag=flood --criticalpattern="(connection refused)|(connection on port\\s+\\d+)|(session aborted)" --warningpattern="(.*total size is 0 .*)|(connection on port\\s+80[^\\d]*)" --logfile %s --warningthreshold 3 --criticalthreshold 10 --seekfilesdir "%s"', $flood->{logfile}, $flood->{seekfilesdir}; diag("now run a dummy commandline"); my $output = `$command`; diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); $cl->reset(); $flood->loggercrap(undef, undef, 100); $flood->logger(undef, undef, 100, "connection refused"); # 100 C $flood->loggercrap(undef, undef, 100); foreach my $port (1..70) { $flood->logger(undef, undef, 1, "connection on port $port"); # 70 C } sleep 1; $flood->trace("executing %s", $command); diag("now run the real commandline which expects 17 criticals"); $output = `$command`; diag($output); ok(($output =~ /CRITICAL - \(17 errors/) && (($? >> 8) == 2)); check_logfiles-4.1.1/t/016smartactionhash.t0000664000175000017500000001255414336703157015470 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/016smartactionhash.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 11; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = q! $options = "report=long"; $protocolsdir = "./var/tmp"; $seekfilesdir = "./var/tmp"; @searches = ({ tag => "smart", logfile => "./var/adm/messages", criticalpatterns => { 'pat1' => '.*connection unexpectedly closed.*', 'pat2' => '.*rsync error.*', }, warningpatterns => { 'pat1' => '.*total size is 0 .*', }, options => 'supersmartscript', script => sub { my $level = lc $ENV{CHECK_LOGFILES_SERVICESTATE}; my $output = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; my $patnum = $ENV{CHECK_LOGFILES_PATTERN_KEY}; printf "%s.%s.%s\n", $level, $patnum, $output; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; }, }); !; open CCC, ">./etc/check_actionhash.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_actionhash.cfg" }); my $action = $cl->get_search_by_tag("smart"); $cl->reset(); $action->delete_logfile(); $action->delete_seekfile(); $action->loggercrap(undef, undef, 100); $cl->run(); $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "i had a connection but the connection unexpectedly closed which is not good"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "empty. null. the total size is 0 and maybe even less"); #sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{long_exitmessage}); ok($cl->expect_result(0, 1, 5, 0, 2)); my @long = split(/\n/, $cl->{long_exitmessage}); ok($long[1] =~ /critical\.pat2\..*rsync error.*/); ok($long[2] =~ /critical\.pat2\..*rsync error.*/); ok($long[3] =~ /critical\.pat2\..*rsync error.*/); ok($long[4] =~ /critical\.pat2\..*rsync error.*/); ok($long[5] =~ /critical\.pat1\..*connection unexpectedly closed.*/); ok($long[6] =~ /warning\.pat1\..*total size is 0 .*/); # now with patternfile my $patternfilecontent =<<'EOF'; $criticalpatterns = { "pat1" => "Failed password", "pat2" => "Failed powersupply", }; $warningpatterns = { "pat1" => "Unknown user", }; $warningexceptions = { "epat1" => "Unknown user lausser", }; EOF $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", patternfiles => TESTDIR."/etc/patternfile5.pat", criticalexceptions => "Failed password for invalid user (lausser|seppl)", warningpatterns => { "pat2" => "Failed password for invalid user seppl", }, } ] }); my $ssh = $cl->get_search_by_tag("ssh"); #printf "%s\n", Data::Dumper::Dumper($ssh); #exit; $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user user1..."); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the four criticals and two warnings $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); $ssh->logger(undef, undef, 2, "Failed password for invalid user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user hiasl"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 4, 0, 2)); # now find the four criticals and one warnings $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); $ssh->logger(undef, undef, 2, "Failed password for invalid user sepp"); $ssh->logger(undef, undef, 2, "Failed password for invalid user lausser"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user lausser"); $ssh->logger(undef, undef, 1, "Unknown user hiasl"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 4, 0, 2)); # now find the two criticals and three warnings # user seppl will be critical, then revoked, then warning $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); #c $ssh->logger(undef, undef, 2, "Failed password for invalid user seppl"); #c ex, w $ssh->logger(undef, undef, 2, "Failed password for invalid user lausser"); #c ex $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user lausser"); #w ex, w $ssh->logger(undef, undef, 1, "Unknown user hiasl"); #w sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 2, 0, 2)); check_logfiles-4.1.1/t/040eventlogfilt.t0000664000175000017500000001076414336703157015000 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/040eventlog.t # # Test that all the Perl modules we require are available. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; use Data::Dumper; sub sleep_until_next_minute { my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; while ($sec < 59) { sleep 1; ($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; } sleep 2; # now it is ~ hh:00, hh:01 } if ($^O !~ /MSWin/) { diag("this is not a windows machine"); plan skip_all => 'Test only relevant on Windows'; } elsif ($^O eq "cygwin") { diag("this is a windows machine, but cygwin. this worked in former times, afte r vista you have to use native windows for the tests"); plan skip_all => 'Test only relevant on Windows'; } else { plan tests => 7; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", type => "eventlog", criticalpatterns => '.*', eventlog => { eventlog => "application", include => { EventType => 'Error', Source => 'check_logfiles', }, exclude => { EventID => '13,23', }, } } ] }); my $ssh = $cl->get_search_by_tag("ssh"); if ($^O !~ /MSWin|cygwin/) { diag("windows only"); foreach (1..7) {ok(1)}; exit 0; } $ssh->delete_seekfile(); $ssh->trace("deleted seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); sleep_until_next_minute(); $ssh->trace("initial run"); $cl->run(); # cleanup diag("1st run"); $cl->reset(); diag("cleanup"); $ssh->trace(sprintf "+----------------------- test %d ------------------", 7); $ssh->logger(undef, undef, 1, "Firewall problem1", undef, { EventType => 'Error', EventID => '0010', }); $ssh->logger(undef, undef, 1, "Firewall problem2", undef, { EventType => 'Error', EventID => '0011', }); $ssh->logger(undef, undef, 1, "DVD problem1", undef, { EventType => 'Error', EventID => '0012', Source => 'DVD', # block }); $ssh->logger(undef, undef, 1, "Firewall problem3", undef, { EventType => 'Error', EventID => '23', # block }); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); #1 # 2 now find the two criticals 1xFWproblem1 1xFWproblem2 $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep_until_next_minute(); # these events were created in the current minute and are ignored by the run() $ssh->logger(undef, undef, 1, "Fireball 2hihi"); $ssh->logger(undef, undef, 1, "Fireball 3hihi"); $ssh->logger(undef, undef, 1, "Firewall problem1"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}.'|'.$cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); #2 sleep 2; $cl->reset(); diag("now commandline"); $ssh->trace(sprintf "+----------------------- test %d ------------------", 7); $ssh->logger(undef, undef, 1, "Firewall problem1", undef, { EventType => 'Error', EventID => '0010', }); $ssh->logger(undef, undef, 1, "Firewall problem2", undef, { EventType => 'Error', EventID => '0011', }); $ssh->logger(undef, undef, 1, "DVD problem1", undef, { EventType => 'Error', EventID => '0012', Source => 'DVD', # block }); $ssh->logger(undef, undef, 1, "Firewall problem3", undef, { EventType => 'Error', EventID => '23', # block }); # run commandline my $cmd = sprintf "perl ../plugins-scripts/check_logfiles --tag %s --seekfilesdir %s --criticalpattern \".*\" --type \"eventlog:eventlog=application,include,EventType=Error,Source=check_logfiles,exclude,eventid=13,eventid=23\"", "ssh", TESTDIR."/var/tmp"; diag($cmd); my $result = `$cmd`; diag($result); ok($result =~ /OK - no errors or warnings/); ok(($? >> 8) == 0); # 2 now find the two criticals 1xFWproblem1 1xFWproblem2 $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep_until_next_minute(); $ssh->logger(undef, undef, 1, "Fireball 2hihi"); $ssh->logger(undef, undef, 1, "Fireball 3hihi"); $ssh->logger(undef, undef, 1, "Firewall problem1"); # run commandline $result = `$cmd`; diag($result); ok($result =~ /CRITICAL - \(2 errors in/); ok(($? >> 8) == 2); check_logfiles-4.1.1/t/041psloglist.t0000664000175000017500000000574014336703157014315 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/040eventlog.t # # Test that all the Perl modules we require are available. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if (($^O ne "cygwin") and ($^O !~ /MSWin/)) { diag("this is not a windows machine"); plan skip_all => 'Test only relevant on Windows'; } else { plan tests => 5; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", type => "psloglist", criticalpatterns => ["Adobe", "Firewall" ], psloglist => { eventlog => "application", } } ] }); my $ssh = $cl->get_search_by_tag("ssh"); if (! -x $ssh->{clo}->{path}.($^O =~ /MSWin/ ? ".exe" : "")) { diag(sprintf "!!! skipping tests. %s not installed!!!", $ssh->{clo}->{path}); foreach (1..5) {ok(1)}; exit 0; } $ssh->delete_seekfile(); $ssh->trace("deleted seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); sleep 2; $ssh->trace("initial run"); $cl->run(); # cleanup $cl->reset(); diag("cleanup"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep 30; $ssh->logger(undef, undef, 1, "Firewall problem"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); sleep 120; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 4); $cl->reset(); $ssh->logger(undef, undef, 1, "Firewall problem"); sleep 10; $ssh->logger(undef, undef, 1, "Firewall problem"); sleep 10; $ssh->logger(undef, undef, 1, "Firewall problem"); sleep 10; $ssh->logger(undef, undef, 1, "Firewall problem"); sleep 10; $ssh->logger(undef, undef, 1, "Firewall problem2"); $ssh->logger(undef, undef, 1, "Firewall problem"); sleep 10; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); #ok($cl->expect_result(0, 0, 6, 0, 2)); $cl->{perfdata} =~ /.*'ssh_criticals'=(\d+).*/; my $found = $1; diag(sprintf "reported %d errors so far. %d to come", $found, 6 - $found); ok($cl->{exitmessage} =~ /CRITICAL/); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 5); $cl->reset(); sleep 65; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6 - $found, 0, 2)); check_logfiles-4.1.1/t/071biggzrotation.t0000664000175000017500000000721614336703157015162 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/071biggzrotation.t # # Test the capability of finding rotated logfiles. # use strict; use Test::More tests => 3; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if ($^O =~ /MSWin/) { # in a desperate attempt... $ENV{PATH} = $ENV{PATH}.';C:\Programme\cygwin\bin;C:\cygwin\bin'; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "bigssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", } ] }); my $bigssh = $cl->get_search_by_tag("bigssh"); $bigssh->delete_logfile(); $bigssh->delete_seekfile(); $bigssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $bigssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $bigssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $bigssh->trace("==== 2 ===="); $cl->reset(); rename "./var/adm/messages", "./var/adm/messages2"; #system("mv ./var/adm/messages ./var/adm/messages2"); $bigssh->loggercrap(undef, undef, 100); $bigssh->logger(undef, undef, 2, "Failed password for invalid user2"); $bigssh->loggercrap(undef, undef, 100); diag("logging big amounts of data"); $bigssh->loggercrap(undef, undef, 100000); open CACA, ">>xyxy"; open MSG, "./var/adm/messages"; while () { print CACA $_; } close CACA; close MSG; #system("cat ./var/adm/messages >> xyxy"); my $size = (stat("./var/adm/messages"))[7]; my $errcnt = 1; $bigssh->{max_readsize} = 1024 * 1024 ; while ($size < $bigssh->{max_readsize}) { open CACA, ">>xyxy"; open MSG, "./var/adm/messages"; while () { print CACA $_; } close CACA; close MSG; #system("cat ./var/adm/messages >> xyxy"); $size = (stat("xyxy"))[7]; $errcnt++; } open CACA, ">>xyxy"; open MSG, "./var/adm/messages"; while () { print CACA $_; } close CACA; close MSG; #system("cat ./var/adm/messages >> xyxy"); $errcnt++; $size = (stat("xyxy"))[7]; open CACA, "xyxy"; open MSG, ">>./var/adm/messages2"; while () { print MSG $_; } close CACA; close MSG; #system("cat xyxy >> ./var/adm/messages2"); rename "./var/adm/messages2", "./var/adm/messages"; #system("mv ./var/adm/messages2 ./var/adm/messages"); unlink("xyxy"); diag(sprintf "i wrote the messages %d times", $errcnt); diag(sprintf "size is %u\n", $size); diag(sprintf "maxs is %u\n", $bigssh->{max_readsize}); sleep 1; diag("now position at a low offset and scan through a big file"); $cl->run(); diag("now a big offset was saved"); diag($cl->has_result()); diag($cl->{exitmessage}); diag(sprintf "i expect %d errors", 2 * $errcnt); ok($cl->expect_result(0, 0, 2 * $errcnt, 0, 2)); system("cat ./var/tmp/check_logfiles.._var_adm_messages.bigssh"); # now flood the log, rotate and find the two new criticals $bigssh->trace("==== 3 ===="); $bigssh->loggercrap(undef, undef, 100); $bigssh->rotate_compress(); # mess -> mess.0 $bigssh->loggercrap(undef, undef, 100); $bigssh->rotate_compress(); # mess.0 -> mess.1.gz $cl->reset(); $bigssh->loggercrap(undef, undef, 100); $bigssh->logger(undef, undef, 2, "Failed password for invalid user3"); $bigssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); check_logfiles-4.1.1/t/062allyoucaneat.t0000664000175000017500000001450414336703157014757 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/001simple.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 8; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "allyoucaneat", } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the beginning of file # and run $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", type => "rotating", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", type => "rotating", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "allyoucaneat", } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the beginning of file # and run $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); check_logfiles-4.1.1/t/016smartaction.t0000664000175000017500000010235114336703157014617 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/016smartaction.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 38; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < "harn" }; \@searches = ( { tag => "smart", logfile => "./var/adm/messages", criticalpatterns => [ '.*connection unexpectedly closed.*', '.*rsync error.*', '!.*FIN.*', 'Thermometer', ], warningpatterns => [ '.*total size is 0 .*', ], options => 'smartscript', script => "script.sh" }); EOCFG open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); my $action = $cl->get_search_by_tag("smart"); my $prescript = $cl->get_search_by_tag("prescript"); my $postscript = $cl->get_search_by_tag("postscript"); $cl->reset(); $action->delete_logfile(); $action->delete_seekfile(); $cl->delete_file("./bin/prescript.sh"); $cl->delete_file("./bin/postscript.sh"); $cl->delete_file("./bin/script.sh"); $cl->delete_file("./bin/prescript.bat"); $cl->delete_file("./bin/postscript.bat"); $cl->delete_file("./bin/script.bat"); diag("deleted logfile and seekfile"); $cl->trace("=========== 1 ============="); $action->trace("deleted logfile and seekfile"); $action->logger(undef, undef, 1, "Failed password for invalid user1..."); sleep 1; diag("now run"); $cl->run(); $prescript->dump_protocol(); # 1W not found #$action->dump_protocol(); # 1C Missing, 1W script not found $postscript->dump_protocol(); # 1W not found diag("============="); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 1, 0, 2)); $cl->trace("=========== 2 ============="); if ($^O =~ /MSWin/) { $cl->create_file("./bin/prescript.bat", 0755, " \@echo off echo i am the prescript echo status \"%CHECK_LOGFILES_SERVICESTATEID%\" echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" exit 0 "); $cl->create_file("./bin/postscript.bat", 0755, " \@echo off echo i am the postscript echo status \"%CHECK_LOGFILES_SERVICESTATEID%\" echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" exit 0 "); $cl->create_file("./bin/script.bat", 0755, " \@echo off echo i am the script echo status \"%CHECK_LOGFILES_SERVICESTATEID%\" echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" exit 0 "); $prescript->{script} = "prescript.bat"; $postscript->{script} = "postscript.bat"; $action->{script} = "script.bat"; } else { $cl->create_file("./bin/prescript.sh", 0755, " echo i am the prescript echo status \"\$CHECK_LOGFILES_SERVICESTATEID\" echo output \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit 0 "); $cl->create_file("./bin/postscript.sh", 0755, " echo i am the postscript echo status \"\$CHECK_LOGFILES_SERVICESTATEID\" echo output \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit 0 "); $cl->create_file("./bin/script.sh", 0755, " echo i am the script echo status \"\$CHECK_LOGFILES_SERVICESTATEID\" echo output \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit 0 "); } $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(4, 0, 4, 0, 2)); $cl->trace("=========== 3 ============="); # test 3. # 1 critical - postscript # 4 criticals - pattern # 1 critical - prescript # if ($^O =~ /MSWin/) { $cl->create_file("./bin/postscript.bat", 0755, " \@echo off echo i am critical ha ha ha exit 2 "); $cl->create_file("./bin/prescript.bat", 0755, " \@echo off echo i am the prescript echo status \"%CHECK_LOGFILES_SERVICESTATEID%\" echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" exit 2 "); } else { $cl->create_file("./bin/postscript.sh", 0755, " echo i am critical ha ha ha exit 2 "); $cl->create_file("./bin/prescript.sh", 0755, " echo i am the prescript echo status \"\$CHECK_LOGFILES_SERVICESTATEID\" echo output \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit 2 "); } $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$prescript->dump_protocol(); # 1C return $action->dump_protocol(); # 4C rsync error, 4OK script #$postscript->dump_protocol(); # 1C return diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(4, 0, 6, 0, 2)); $cl->trace("=========== 4 ============="); # test 4. # 4 criticals - pattern # 4 warnings - script # 1 warning - prescript missing # 1 unknown - postscript says unknown $cl->delete_file("./bin/prescript.sh"); $cl->delete_file("./bin/postscript.sh"); $cl->delete_file("./bin/script.sh"); $cl->delete_file("./bin/prescript.bat"); $cl->delete_file("./bin/postscript.bat"); $cl->delete_file("./bin/script.bat"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/postscript.bat", 0755, " \@echo off echo i am unknown ha ha ha exit 3 "); $cl->create_file("./bin/script.bat", 0755, " \@echo off echo i warn you exit 1 "); } else { $cl->create_file("./bin/postscript.sh", 0755, " echo i am unknown ha ha ha exit 3 "); $cl->create_file("./bin/script.sh", 0755, " echo i warn you exit 1 "); } $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$prescript->dump_protocol(); # 1W not found #$action->dump_protocol(); #$postscript->dump_protocol(); # 1W not found diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 5, 4, 1, 2)); $cl->trace("=========== 5 ============="); # test 4. # 4 criticals - pattern # 4 warnings - script # 1 warning - prescript missing # 1 critical - postscript is now supersmart #------------ # 1 critical # $cl->delete_file("./bin/prescript.sh"); $cl->delete_file("./bin/postscript.sh"); $cl->delete_file("./bin/script.sh"); $cl->delete_file("./bin/prescript.bat"); $cl->delete_file("./bin/postscript.bat"); $cl->delete_file("./bin/script.bat"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/postscript.bat", 0755, " \@echo off if %CHECK_LOGFILES_SERVICESTATEID% gtr 0 goto nagioserr echo \"%CHECK_LOGFILES_SERVICEOUTPUT%\" exit %CHECK_LOGFILES_SERVICESTATEID% :nagioserr echo this check failed with status %CHECK_LOGFILES_SERVICESTATE% exit 3 "); $cl->create_file("./bin/script.bat", 0755, " \@echo off echo i warn you exit 1 "); } else { $cl->create_file("./bin/postscript.sh", 0755, " if [ \$CHECK_LOGFILES_SERVICESTATEID -gt 0 ]; then echo this check failed with status \$CHECK_LOGFILES_SERVICESTATE exit 3 # force the while script to end with unknown else echo \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit \$CHECK_LOGFILES_SERVICESTATEID fi "); $cl->create_file("./bin/script.sh", 0755, " echo i warn you exit 1 "); } $postscript->{options}->{supersmartscript} = 1; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$prescript->dump_protocol(); # 1W not found #$action->dump_protocol(); #$postscript->dump_protocol(); # 1W not found diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); $cl->trace("=========== 6 ============="); # test 4. # 4 criticals - pattern # 4 warnings - script # 1 warning - prescript missing # 1 critical - postscript is now supersmart #------------ # 1 critical # $cl->delete_file("./bin/prescript.sh"); $cl->delete_file("./bin/postscript.sh"); $cl->delete_file("./bin/script.sh"); $cl->delete_file("./bin/prescript.bat"); $cl->delete_file("./bin/postscript.bat"); $cl->delete_file("./bin/script.bat"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/postscript.bat", 0755, " \@echo off if %CHECK_LOGFILES_SERVICESTATEID% gtr 0 goto nagioserr echo \"%CHECK_LOGFILES_SERVICEOUTPUT%\" exit %CHECK_LOGFILES_SERVICESTATEID% :nagioserr echo this check failed with status %CHECK_LOGFILES_SERVICESTATE% exit 3 "); $cl->create_file("./bin/script.bat", 0755, " \@echo off echo i warn you exit 1 "); } else { $cl->create_file("./bin/postscript.sh", 0755, " if [ \$CHECK_LOGFILES_SERVICESTATEID -gt 0 ]; then echo this check failed with status \$CHECK_LOGFILES_SERVICESTATE exit 3 # force the while script to end with unknown else echo \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit \$CHECK_LOGFILES_SERVICESTATEID fi "); $cl->create_file("./bin/script.sh", 0755, " echo i warn you exit 1; "); } $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { printf "hihihihihihihi"; return 2; }; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$prescript->dump_protocol(); # 1W not found #$action->dump_protocol(); #$postscript->dump_protocol(); # 1W not found diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} =~ /.*hihihihihihihi.*/); ok($cl->expect_result(0, 0, 1, 0, 2)); # supersmart prescript aborts the whole run $cl->trace("================== 7 =============="); $cl->delete_file("./bin/prescript.sh"); $cl->delete_file("./bin/postscript.sh"); $cl->delete_file("./bin/script.sh"); $cl->delete_file("./bin/prescript.bat"); $cl->delete_file("./bin/postscript.bat"); $cl->delete_file("./bin/script.bat"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/prescript.bat", 0755, " \@echo off echo no i will not run exit 2 fi "); } else { $cl->create_file("./bin/prescript.sh", 0755, " echo no i will not run exit 2 "); } $prescript->{options}->{supersmartscript} = 1; $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { printf "hihihihihihihi"; return 2; }; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$prescript->dump_protocol(); # 1W not found #$action->dump_protocol(); #$postscript->dump_protocol(); # 1W not found diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} =~ /CRITICAL.*i will not run.*/); ok($cl->expect_result(0, 0, 1, 0, 2)); ############################ 7 diag("supersmart prescript aborts the whole run warning"); $cl->trace("================== 8 =============="); $cl->delete_file("./bin/prescript.sh"); $cl->delete_file("./bin/postscript.sh"); $cl->delete_file("./bin/script.sh"); $cl->delete_file("./bin/prescript.bat"); $cl->delete_file("./bin/postscript.bat"); $cl->delete_file("./bin/script.bat"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/prescript.bat", 0755, " \@echo off echo no i will not run exit 1 fi "); } else { $cl->create_file("./bin/prescript.sh", 0755, " echo no i will not run exit 1 "); } $prescript->{options}->{supersmartscript} = 1; $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { printf "hihihihihihihi"; return 2; }; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$prescript->dump_protocol(); # 1W not found #$action->dump_protocol(); #$postscript->dump_protocol(); # 1W not found diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} =~ /WARNING.*i will not run.*/); ok($cl->expect_result(0, 1, 0, 0, 1)); ############################ 7 diag("supersmart prescript aborts the whole run critical"); $cl->trace("================== 9 =============="); $cl->delete_file("./bin/prescript.sh"); $cl->delete_file("./bin/postscript.sh"); $cl->delete_file("./bin/script.sh"); $cl->delete_file("./bin/prescript.bat"); $cl->delete_file("./bin/postscript.bat"); $cl->delete_file("./bin/script.bat"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/prescript.bat", 0755, " \@echo off echo no i will definitively not run exit 2 fi "); } else { $cl->create_file("./bin/prescript.sh", 0755, " echo no i will definitively not run exit 2 "); } $prescript->{options}->{supersmartscript} = 1; $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { printf "hihihihihihihi"; return 2; }; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$prescript->dump_protocol(); # 1W not found #$action->dump_protocol(); #$postscript->dump_protocol(); # 1W not found diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->{exitmessage} =~ /CRITICAL.*i will definitively not run.*/); ok($cl->expect_result(0, 0, 1, 0, 2)); diag("reset the logfiles"); $cl->trace("reset log and seek"); $action->delete_logfile(); $action->delete_seekfile(); $action->loggercrap(undef, undef, 100); $prescript->{options}->{supersmartscript} = 0; # no abort this time $cl->reset(); sleep 1; $cl->run(); $cl->trace("=========== 10 repeat the machtes ============="); diag("supersmart script repeats the match"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/script.bat", 0755, " \@echo off rem repeat the match echo \%\"\%%CHECK_LOGFILES_SERVICEOUTPUT%\%\"\% exit %CHECK_LOGFILES_SERVICESTATEID% "); $action->{script} = "script.bat"; } else { $cl->create_file("./bin/script.sh", 0755, " # repeat the match echo \"\$CHECK_LOGFILES_SERVICEOUTPUT\" exit \$CHECK_LOGFILES_SERVICESTATEID "); } $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 0; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 0; $prescript->{script} = sub { printf "OK - leck mich am arsch\n"; return 0; }; $postscript->{script} = sub { printf "OK - du mich auch\n"; return 0; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); ok($cl->{exitmessage} =~ /CRITICAL - \(4 errors.* - .*localhost check_logfiles\[\d+\] there was an rsync error.*\.\.\./); $cl->trace("=========== 11 repeat and modifies the maches ============="); diag("supersmart script repeats an mods the match"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/script.bat", 0755, " \@echo off rem repeat the match echo \%\"\%hihi %CHECK_LOGFILES_SERVICEOUTPUT%\%\"\% exit %CHECK_LOGFILES_SERVICESTATEID% "); $action->{script} = "script.bat"; } else { $cl->create_file("./bin/script.sh", 0755, " # repeat the match echo \"hihi \$CHECK_LOGFILES_SERVICEOUTPUT\" exit \$CHECK_LOGFILES_SERVICESTATEID "); } $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 0; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 0; $prescript->{script} = sub { printf "OK - leck mich am arsch\n"; return 0; }; $postscript->{script} = sub { printf "OK - du mich auch\n"; return 0; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); ok($cl->{exitmessage} =~ /CRITICAL - \(4 errors.* - .*hihi .* localhost check_logfiles\[\d+\] there was an rsync error.*\.\.\./); $cl->trace("=========== 12 heals the maches ============="); diag("supersmart script says ok to the match"); if ($^O =~ /MSWin/) { $cl->create_file("./bin/script.bat", 0755, " \@echo off rem echo \"ben zi bena bluot zi bluoda\" exit 0 "); $action->{script} = "script.bat"; } else { $cl->create_file("./bin/script.sh", 0755, " # repeat the match echo \"ben zi bena bluot zi bluoda\" exit 0 "); } $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 0; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 0; $prescript->{script} = sub { printf "OK - leck mich am arsch\n"; return 0; }; $postscript->{script} = sub { printf "OK - du mich auch\n"; return 0; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); #$action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); # 4xCritical =>supersmart=> 4xOK, dto 1xMissing diag($cl->{exitmessage}); diag("aa"); ok($cl->expect_result(5, 0, 0, 0, 0)); ############ ok 17 diag("bb"); ok($cl->{exitmessage} =~ /OK -/); # 19 $cl->trace("=========== 13 heals the matches with perl ============="); diag("supersmart script says ok to the match"); $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 0; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 0; $prescript->{script} = sub { printf "OK - leck mich am arsch\n"; return 0; }; $postscript->{script} = sub { printf "OK - du mich auch\n"; return 0; }; $action->{script} = sub { printf "so lang dads zou bis oas huit\n"; return 0; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); #$action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); # 4xCritica =>script=>4xOK, 1xMissing dto diag($cl->{exitmessage}); ok($cl->expect_result(5, 0, 0, 0, 0)); # 20 ok($cl->{exitmessage} =~ /OK - /); $cl->trace("=========== 13 mods the maches with perl ============="); diag("supersmart script mods the match"); $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 0; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 0; $prescript->{script} = sub { printf "OK - leck mich am arsch\n"; return 0; }; $postscript->{script} = sub { printf "OK - du mich auch\n"; return 0; }; $action->{script} = sub { my $params = shift; printf "%s%s%s\n", $params->[0], $params->[1], $params->[2]; return 1; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $action->{scriptparams} = ["hirn", "horn", '$CL_HARN$']; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); #$action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 5, 0, 0, 1)); ok($cl->{exitmessage} =~ /WARNING - \(5 warnings.*hirnhornharn.*/); $cl->trace("=========== 13 heals some matches with perl ============="); diag("supersmart heals some matches"); $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 0; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 0; $prescript->{script} = sub { printf "OK - leck mich am arsch\n"; return 0; }; $postscript->{script} = sub { printf "OK - du mich auch\n"; return 0; }; # if not set, we see ugly uninizialized-errors $ENV{CHECK_LOGFILES_DATE_MM} = 0; $ENV{CHECK_LOGFILES_SERVICEOUTPUT} = ""; $action->{script} = sub { my $grad = 0; printf STDERR "in month %d i receive %s\n", $ENV{CHECK_LOGFILES_DATE_MM}, $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; $ENV{CHECK_LOGFILES_SERVICEOUTPUT} =~ /: (\d+) Grad/; $grad = $1; if ($grad > 30) { if (($ENV{CHECK_LOGFILES_DATE_MM} >= 6) && ($ENV{CHECK_LOGFILES_DATE_MM} <= 8)) { printf "OK - ist ja schliesslich Sommer\n"; return 0; } elsif (($ENV{CHECK_LOGFILES_DATE_MM} >= 11) && ($ENV{CHECK_LOGFILES_DATE_MM} <= 2)) { printf "CRITICAL - es brennt!\n"; return 2; } else { printf "WARNING - bisschen warm hier drin\n"; return 1; } } else { printf "OK - unter 30 Grad\n"; return 0; } }; printf "the script\n"; printf STDERR "the script\n"; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Thermometer: 100 Grad"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); my $month = (localtime)[4] + 1; if (($month >= 6) && ($month <= 8)) { ok($cl->expect_result(1, 0, 0, 0, 0)); ok($cl->{exitmessage} =~ /OK - /); } elsif (($month >= 11) && ($month <= 2)) { ok($cl->expect_result(0, 0, 1, 0, 2)); ok($cl->{exitmessage} =~ /CRITICAL - es/); } else { ok($cl->expect_result(0, 1, 0, 0, 1)); ok($cl->{exitmessage} =~ /WARNING - bisschen/); } # another test. postscript can output its own message which overrides # the default format # OK - ois rodscher in kambodscher # CRITICAL - ois is hi $cl->trace("=========== supersmart postscript returns ok ============="); diag("supersmart postscript says ok to the match"); $prescript->{options}->{script} = 0; $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 1; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { # oberbayern prolls printf "ois rodscher in kambodscher\n"; return 0; }; $action->{script} = sub { printf "so lang dads zou bis oas huit\n"; return 0; }; $action->{options}->{supersmartscript} = 0; $action->{options}->{smartscript} = 0; $action->{options}->{script} = 0; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); #$action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); # 4xCritica =>script=>4xOK, 1xMissing dto diag($cl->{exitmessage}); # postscript resets ok($cl->expect_result(1, 0, 0, 0, 0)); # 26 ok($cl->{exitmessage} =~ /ois rodscher/); # postscript with its own crtical $cl->trace("=========== supersmart postscript returns critical ============="); diag("supersmart postscript says critical to the match"); $prescript->{options}->{script} = 0; $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 1; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { printf "ois is hi\n"; return 2; }; $action->{script} = sub { printf "so lang dads zou bis oas huit\n"; return 0; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 1; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); #$action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); # 4xCritica =>script=>4xOK, 1xMissing dto diag($cl->{exitmessage}); # postscript resets ok($cl->expect_result(0, 0, 1, 0, 2)); # 28 ok($cl->{exitmessage} =~ /ois is hi/); # postscript which copies the generated output but raises the level $cl->trace("=========== supersmart postscript returns critical ============="); diag("supersmart postscript copies results found so far"); $prescript->{options}->{script} = 0; $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 1; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { printf "%s", $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; }; $action->{script} = sub { printf "so lang dads zou bis oas huit\n"; return 0; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 0; ### do not clear the error lines $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); #$action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); # 4xCritica =>script=>4xOK, 1xMissing dto diag($cl->{exitmessage}); # postscript resets ok($cl->expect_result(0, 0, 1, 0, 2)); # 30 ok($cl->{exitmessage} =~ /CRITICAL - /); # postscript with its own crtical $cl->trace("=========== supersmart postscript returns critical ============="); diag("supersmart postscript says critical to the match"); $prescript->{options}->{script} = 0; $prescript->{options}->{smartscript} = 0; $postscript->{options}->{smartscript} = 1; $prescript->{options}->{supersmartscript} = 0; $postscript->{options}->{supersmartscript} = 1; $postscript->{script} = sub { printf STDERR "huhi: %s\n", $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; printf STDERR "hihi: %s\n", $ENV{CHECK_LOGFILES_SERVICEPERFDATA}; printf "ois is hi |%s\n", $ENV{CHECK_LOGFILES_SERVICEPERFDATA}; return 2; }; $action->{script} = sub { printf "so lang dads zou bis oas huit\n"; return 0; }; $action->{options}->{supersmartscript} = 1; $action->{options}->{smartscript} = 1; $action->{options}->{script} = 0; $cl->reset(); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 40, "the total size is 0 hihi"); #$action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); #$action->dump_protocol(); diag($cl->has_result()); # 4xCritica =>script=>4xOK, 1xMissing dto diag($cl->{exitmessage}); # postscript resets ok($cl->expect_result(0, 0, 1, 0, 2)); # 32 ok($cl->{exitmessage} =~ /ois is hi/ && $cl->{perfdata} =~ /'smart_criticals'=5 .*/); # an supersmart postscript wird der komplette serviceoutput geliefert # dieser beinhaltet insbes. die performance data # da der output des postscript als 1:1 gesamtoutput genommen wird, ist # der script-autor verantwortlich, daß performancedaten angehängt werden. # check command line my $perlpath = `which perl`; chomp $perlpath; $configfile = ""; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $configfile = < 'nagios.dierichs.de', CL_NSCA_PORT => 5555, }; \@searches = ( { tag => "action", logfile => "./var/adm/messages", criticalpatterns => [ '.*ERROR.*', ], options => 'supersmartscript', script => "send_nsca.bat", scriptparams => '-H \$CL_NSCA_HOST_ADDRESS\$ -p \$CL_NSCA_PORT\$ -to \$CL_NSCA_TO_SEC\$ -c \$CL_NSCA_CONFIG_FILE\$', scriptstdin => '\$CL_HOSTNAME\$\\t\$CL_SERVICEDESC\$\\t\$CL_SERVICESTATEID\$\\t\$CL_SERVICEOUTPUT\$\\n', }); EOCFG $cl->create_file("./bin/send_nsca.bat", 0755, " \@echo off if \"%1%2%3%4\" == \"-Hnagios.dierichs.de-p5555\" GOTO :good echo bad exit 2 :good echo good exit 0 "); } else { $configfile = < 'nagios.dierichs.de', CL_NSCA_PORT => 5555, }; \@searches = ( { tag => "action", logfile => "./var/adm/messages", criticalpatterns => [ '.*ERROR.*', ], options => 'supersmartscript', script => "send_nsca", scriptparams => '-H \$CL_NSCA_HOST_ADDRESS\$ -p \$CL_NSCA_PORT\$ -to \$CL_NSCA_TO_SEC\$ -c \$CL_NSCA_CONFIG_FILE\$', scriptstdin => '\$CL_HOSTNAME\$\\t\$CL_SERVICEDESC\$\\t\$CL_SERVICESTATEID\$\\t\$CL_SERVICEOUTPUT\$\\n', }); EOCFG $cl->create_file("./bin/send_nsca", 0755, " echo i am the script with \"\$*\" if [ \"\$1\" = \"-H\" ] && [ \"\$2\" = \"nagios.dierichs.de\" ] && [ \"\$3\" = \"-p\" ] && [ \"\$4\" = \"5555\" ]; then echo good exit 0; else echo bad exit 2 fi "); } diag ("create check_action.cfg"); open CCC, ">./etc/2check_action.cfg"; print CCC $configfile; close CCC; my $xcl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/2check_action.cfg" }); $xcl->delete_file("./var/tmp/scriptcounter"); $action = $xcl->get_search_by_tag("action"); my $output = `$perlpath ../plugins-scripts/check_logfiles -f ./etc/2check_action.cfg`; diag ("reset run: ".$output); $action->loggercrap(undef, undef, 10); $action->logger(undef, undef, 1, "building file list ... done"); $action->logger(undef, undef, 10, "a ERROR hoho"); $action->loggercrap(undef, undef, 10); # this is the important part. if the script got the expected parameters # it remedies the matches $output = `$perlpath ../plugins-scripts/check_logfiles -f ./etc/2check_action.cfg`; diag ("real run: ".$output); ok($output =~ /OK/); $configfile = < "smart", logfile => "./var/adm/messages", criticalpatterns => [ '.*connection unexpectedly closed.*', '.*rsync error.*', 'Thermometer', ], warningpatterns => [ '.*total size is 0 .*', ], }); \$postscript = sub { print "0"; return 0; }; EOCFG unlink "./etc/check_null.cfg"; open CCC, ">./etc/check_null.cfg"; print CCC $configfile; close CCC; diag("postscript returns 0"); my $ycl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_null.cfg" }); $action = $ycl->get_search_by_tag("smart"); $postscript = $ycl->get_search_by_tag("postscript"); $ycl->reset(); $action->delete_logfile(); $action->delete_seekfile(); $action->trace("deleted logfile and seekfile"); $ycl->run(); sleep 1; $ycl->reset(); $action->logger(undef, undef, 1, "rsync error"); diag("now run"); $action->trace("now postscript returns the string 0"); $ycl->run(); diag("result should be \"0\""); diag($ycl->has_result()); diag($ycl->{exitmessage}); ok($ycl->expect_result(1, 0, 0, 0, 0)); ok($ycl->{exitmessage} eq "0"); $configfile = < "smart", logfile => "./var/adm/messages2", criticalpatterns => [ '.*rsync error.*', ], }); \$postscript = sub { # return undefined message return 0; }; EOCFG open CCC, ">./etc/check_kaas.cfg"; print CCC $configfile; close CCC; diag("postscript returns nothing"); $action = undef; $postscript = undef; my $zcl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_kaas.cfg" }); $action = $zcl->get_search_by_tag("smart"); $postscript = $zcl->get_search_by_tag("postscript"); $zcl->reset(); $action->delete_logfile(); $action->delete_seekfile(); $action->trace("deleted logfile and seekfile"); $zcl->run(); sleep 1; $zcl->reset(); $action->logger(undef, undef, 1, "rsync error"); diag("now run"); $zcl->run(); diag($zcl->has_result()); diag($zcl->{exitmessage}); ok($zcl->expect_result(1, 0, 0, 0, 0)); ok($zcl->{exitmessage} eq "postscript"); check_logfiles-4.1.1/t/001simple.t0000664000175000017500000002604014336703157013556 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/001simple.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 21; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # 4 nothing happened in the meantime $ssh->trace(sprintf "+----------------------- test %d ------------------", 4); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 5 the logfile was deleted and a new one has still not been created $ssh->trace(sprintf "+----------------------- test %d ------------------", 5); $ssh->delete_logfile(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag(-f TESTDIR.'/var/adm/messages' ? "messages exists" : "messages missing"); ok($cl->expect_result(0, 0, 0, 1, 3)); # 6 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 6); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # 7 the logfile was deleted and messages have been written $ssh->trace(sprintf "+----------------------- test %d ------------------", 7); $ssh->delete_logfile(); $cl->reset(); $ssh->loggercrap(undef, undef, 1); $ssh->loggercrap(undef, undef, 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 8 the logfile is not readable $ssh->trace(sprintf "+----------------------- test %d ------------------", 8); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); diag(sprintf "locking logfile %s", $ssh->{logfile}); $ssh->restrict_logfile(); diag(`/bin/ls -l $ssh->{logfile}`); $ssh->restrict_logfile(); sleep 1; $cl->run(); $ssh->unrestrict_logfile(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 9 readable again now find the two + two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 9); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 4, 0, 2)); # 10 the logfile was truncated and no messages have been written $ssh->trace(sprintf "+----------------------- test %d ------------------", 10); $ssh->truncate_logfile(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 11 finally two criticals and two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 11); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); ######################################################## # now with nologfilenocry # $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "nologfilenocry" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->reset(); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 12 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 12); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); diag(`/bin/ls -li $ssh->{logfile}`); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 13 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 13); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 14 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 14); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # 15 nothing happened in the meantime $ssh->trace(sprintf "+----------------------- test %d ------------------", 15); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 16 the logfile was deleted and a new one has still not been created $ssh->trace(sprintf "+----------------------- test %d ------------------", 16); $ssh->delete_logfile(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 17 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 17); $cl->reset(); $ssh->logger(undef, undef, 1, "Failed password for invalid user14"); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 1, "Failed password for invalid user14"); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); # 18 the logfile was deleted and messages have been written $ssh->trace(sprintf "+----------------------- test %d ------------------", 18); $ssh->delete_logfile(); $cl->reset(); $ssh->logger(undef, undef, 1, "Failed password for invalid user15"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Failed password for invalid user15"); $ssh->loggercrap(undef, undef, 100); $ssh->loggercrap(undef, undef, 100); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 19 new messages have been written $ssh->trace(sprintf "+----------------------- test %d ------------------", 19); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user16"); $ssh->loggercrap(undef, undef, 100); $ssh->loggercrap(undef, undef, 100); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 20 delete logfile and write beyond the length of the last logfile # this is detected because of the new inode number. if the same number is used # then the firstline-compare-code must be re-implemented $ssh->trace(sprintf "+----------------------- test %d ------------------", 20); $cl->reset(); $ssh->delete_logfile(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user17"); $ssh->loggercrap(undef, undef, 1000); $ssh->loggercrap(undef, undef, 1000); $ssh->loggercrap(undef, undef, 1000); $ssh->loggercrap(undef, undef, 1000); $ssh->loggercrap(undef, undef, 1000); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 21 the logfile is not readable $ssh->trace(sprintf "+----------------------- test %d ------------------", 21); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user18"); $ssh->loggercrap(undef, undef, 100); diag(sprintf "locking logfile %s", $ssh->{logfile}); $ssh->restrict_logfile(); diag(`/bin/ls -l $ssh->{logfile}`); sleep 1; $cl->run(); $ssh->unrestrict_logfile(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); $ssh->delete_logfile(); $ssh->delete_seekfile(); check_logfiles-4.1.1/t/029prefilter.t0000664000175000017500000002553714336703157014305 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/029prefilter.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 24; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "siapp8", prefilter => '$CL_TAG$', logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }, { tag => "ipata22", prefilter => '$CL_TAG$', logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }, { tag => "simple", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }, ] }); my $siapp8 = $cl->get_search_by_tag("siapp8"); $siapp8->delete_logfile(); $siapp8->delete_seekfile(); $siapp8->trace("deleted logfile and seekfile"); my $ipata22 = $cl->get_search_by_tag("ipata22"); $ipata22->delete_logfile(); $ipata22->delete_seekfile(); $ipata22->trace("deleted logfile and seekfile"); my $simple = $cl->get_search_by_tag("simple"); $simple->delete_logfile(); $simple->delete_seekfile(); $simple->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $simple->trace(sprintf "+----------------------- test %d ------------------", 1); $simple->loggercrap(undef, undef, 100); sleep 1; $simple->trace("initial run"); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 write 4 criticals concerning host lpdbs01 $simple->trace(sprintf "+----------------------- test %d ------------------", 2); $simple->loggercrap(undef, undef, 100); $simple->logger(undef, undef, 4, "lpdbs01: Failed password for invalid user1..."); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); # 3 write 3 criticals concerning host siapp8 + 7 simples $simple->trace(sprintf "+----------------------- test %d ------------------", 3); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 1, "siapp8: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 3, "lpdbs01: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 5, 0, 2)); # 4 write 3 criticals concerning host siapp8 + 7 simples $simple->trace(sprintf "+----------------------- test %d ------------------", 4); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 1, "siapp8: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 3, "lpdbs01: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 30, "ipata22: Failed password for invalid user1..."); $cl->reset(); sleep 1; $cl->run(); diag($siapp8->{perfdata}); diag($ipata22->{perfdata}); diag($simple->{perfdata}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 65, 0, 2)); ok($cl->{perfdata} =~ /.*'simple_criticals'=34.*/); ok($cl->{perfdata} =~ /.*'siapp8_criticals'=1.*/); ok($cl->{perfdata} =~ /.*'ipata22_criticals'=30.*/); # # # repeat the tests. instead of prefilter we set the syslogclient option # $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "siapp9", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata,syslogclient=siapp9" }, { tag => "ipata23", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => 'perfdata,syslogclient=$CL_TAG$' }, { tag => "simple", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }, ] }); $siapp8 = $cl->get_search_by_tag("siapp9"); $siapp8->delete_logfile(); $siapp8->delete_seekfile(); $siapp8->trace("deleted logfile and seekfile"); $ipata22 = $cl->get_search_by_tag("ipata23"); $ipata22->delete_logfile(); $ipata22->delete_seekfile(); $ipata22->trace("deleted logfile and seekfile"); $simple = $cl->get_search_by_tag("simple"); $simple->delete_logfile(); $simple->delete_seekfile(); $simple->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $simple->trace(sprintf "+----------------------- test %d ------------------", 5); $simple->loggercrap(undef, undef, 100); sleep 1; $simple->trace("initial run"); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 write 4 criticals concerning host lpdbs01 $simple->trace(sprintf "+----------------------- test %d ------------------", 6); $simple->loggercrap(undef, undef, 100); $simple->logger(undef, undef, 4, "lpdbs01: Failed password for invalid user1..."); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); # 3 write 3 criticals concerning host siapp8 + 7 simples $simple->trace(sprintf "+----------------------- test %d ------------------", 7); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 1, "siapp9: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 3, "lpdbs01: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 5, 0, 2)); # 4 write 3 criticals concerning host siapp8 + 7 simples $simple->trace(sprintf "+----------------------- test %d ------------------", 8); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 1, "siapp9: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 3, "lpdbs01: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 30, "ipata23: Failed password for invalid user1..."); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 65, 0, 2)); ok($cl->{perfdata} =~ /.*'simple_criticals'=34.*/); ok($cl->{perfdata} =~ /.*'siapp9_criticals'=1.*/); ok($cl->{perfdata} =~ /.*'ipata23_criticals'=30.*/); ok(@{$ipata22->{preliminaryfilter}->{NEED}}[0] eq "ipata23"); diag("add case insensitivity"); # # # repeat the tests. we set the syslogclient option and mix cases # $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "siapp9", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata,syslogclient=siapp9,nocase" }, { tag => "ipata23", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => 'perfdata,syslogclient=$CL_TAG$,nocase' }, { tag => "simple", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }, ] }); $siapp8 = $cl->get_search_by_tag("siapp9"); $siapp8->delete_logfile(); $siapp8->delete_seekfile(); $siapp8->trace("deleted logfile and seekfile"); $ipata22 = $cl->get_search_by_tag("ipata23"); $ipata22->delete_logfile(); $ipata22->delete_seekfile(); $ipata22->trace("deleted logfile and seekfile"); $simple = $cl->get_search_by_tag("simple"); $simple->delete_logfile(); $simple->delete_seekfile(); $simple->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $simple->trace(sprintf "+----------------------- test %d ------------------", 5); $simple->loggercrap(undef, undef, 100); sleep 1; $simple->trace("initial run"); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); #18 # 2 write 4 criticals concerning host lpdbs01 $simple->trace(sprintf "+----------------------- test %d ------------------", 6); $simple->loggercrap(undef, undef, 100); $simple->logger(undef, undef, 4, "lpdbs01: Failed password for invalid user1..."); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); #19 # 3 write 3 criticals concerning host siapp8 + 7 simples $simple->trace(sprintf "+----------------------- test %d ------------------", 7); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 1, "SIAPP9: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 3, "lpdbs01: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 5, 0, 2)); #20 # 4 write 3 criticals concerning host siapp8 + 7 simples $simple->trace(sprintf "+----------------------- test %d ------------------", 8); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 1, "siapp9: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 3, "lpdbs01: Failed password for invalid user1..."); $simple->loggercrap(undef, undef, 2); $simple->loggercrap(undef, undef, 2); $simple->logger(undef, undef, 15, "ipata23: Failed password for invalid user1..."); $simple->logger(undef, undef, 15, "IPATA23: Failed password for invalid user1..."); $cl->reset(); sleep 1; $cl->run(); ok($siapp8->{perfdata}); diag($ipata22->{perfdata}); diag($simple->{perfdata}); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 65, 0, 2)); ok($cl->{perfdata} =~ /.*'simple_criticals'=34.*/); ok($cl->{perfdata} =~ /.*'siapp9_criticals'=1.*/); ok($cl->{perfdata} =~ /.*'ipata23_criticals'=30.*/); ok(@{$ipata22->{preliminaryfilter}->{NEED}}[0] eq "(?i)ipata23"); check_logfiles-4.1.1/t/061maxlength.t0000664000175000017500000001415714336703157014270 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/061maxlength.t # # Test the maxlength option # use strict; use Test::More tests => 5; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Bedrohung gefunden", warningpatterns => "Unknown user", options => 'maxlength=150', } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "2009-02-19 09:21:47,Erzwungene proaktive TruScan-Bedrohung gefunden,Computer-Name: r0764,Erkennungstyp: Heuristisch,Anwendungsname: Java(TM) Platform SE 6 U11,Anwendungstyp: Trojaner-Wurm,Anwendungsversion: 6.0.110.3,Hash-Typ: SHA-1,Anwendungs-Hash: a6abbadf4a7d0be5c45ec25be328b0d9eee601d9,Firmenname: Sun Microsystems\~ Inc.,Dateigröße (Byte): 144792,Empfindlichkeit: 0,Erkennungsergebnis: 0,Übertragungsempfehlung: 0,Grund für Anwendungszulassung: 0,Quelle: Heuristic Scan,Risikoname: ,Vorkommnisse2009-02-19 11:31:50,Erzwungene proaktive TruScan-Bedrohung erkannt,Computer-Name: r0764,Erkennungstyp: Heuristisch,Anwendungsname: Java(TM) Platform SE 6 U11,Anwendungstyp: Trojaner-Wurm,Anwendungsversion: 6.0.110.3,Hash-Typ: SHA-1,Anwendungs-Hash: a6abbadf4a7d0be5c45ec25be328b0d9eee601d9,Firmenname: Sun Microsystems\~ Inc.,Dateigröße (Byte): 144792,Empfindlichkeit: 0,Erkennungsergebnis: 0,Übertragungsempfehlung: 0,Grund für Anwendungszulassung: 0,Quelle: Heuristic Scan,Risikoname: ,Vorkommnisse: 1,c:/windows/system32"); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "2009-02-19 09:21:47,Erzwungene proaktive TruScan-Bedrohung gefunden,Computer-Name: r0764,Erkennungstyp: Heuristisch,Anwendungsname: Java(TM) Platform SE 6 U11,Anwendungstyp: Trojaner-Wurm,Anwendungsversion: 6.0.110.3,Hash-Typ: SHA-1,Anwendungs-Hash: a6abbadf4a7d0be5c45ec25be328b0d9eee601d9,Firmenname: Sun Microsystems\~ Inc.,Dateigröße (Byte): 144792,Empfindlichkeit: 0,Erkennungsergebnis: 0,Übertragungsempfehlung: 0,Grund für Anwendungszulassung: 0,Quelle: Heuristic Scan,Risikoname: ,Vorkommnisse2009-02-19 11:31:50,Erzwungene proaktive TruScan-Bedrohung erkannt,Computer-Name: r0764,Erkennungstyp: Heuristisch,Anwendungsname: Java(TM) Platform SE 6 U11,Anwendungstyp: Trojaner-Wurm,Anwendungsversion: 6.0.110.3,Hash-Typ: SHA-1,Anwendungs-Hash: a6abbadf4a7d0be5c45ec25be328b0d9eee601d9,Firmenname: Sun Microsystems\~ Inc.,Dateigröße (Byte): 144792,Empfindlichkeit: 0,Erkennungsergebnis: 0,Übertragungsempfehlung: 0,Grund für Anwendungszulassung: 0,Quelle: Heuristic Scan,Risikoname: ,Vorkommnisse: 1,c:/windows/system32"); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); ok(length $cl->{lastmsg}->{CRITICAL} == 150); #printf "%s\n", Data::Dumper::Dumper($cl); my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $ssh->{logfile} =~ s/\//\\/g; } my $command = sprintf $perlpath.' ../plugins-scripts/check_logfiles --tag=%s --criticalpattern="%s" --warningpattern="%s" --maxlength=120 --logfile=%s --seekfilesdir %s', $ssh->{tag}, $ssh->{patterns}->{CRITICAL}->[0], $ssh->{patterns}->{WARNING}->[0], $ssh->{logfile}, $cl->{seekfilesdir}; $ssh->trace("executing %s", $command); $ssh->trace("deleting logfile and seekfile"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 1 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); my $output = `$command`; diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); $ssh->logger(undef, undef, 2, "2009-02-19 09:21:47,Erzwungene proaktive TruScan-Bedrohung gefunden,Computer-Name: r0764,Erkennungstyp: Heuristisch,Anwendungsname: Java(TM) Platform SE 6 U11,Anwendungstyp: Trojaner-Wurm,Anwendungsversion: 6.0.110.3,Hash-Typ: SHA-1,Anwendungs-Hash: a6abbadf4a7d0be5c45ec25be328b0d9eee601d9,Firmenname: Sun Microsystems\~ Inc.,Dateigröße (Byte): 144792,Empfindlichkeit: 0,Erkennungsergebnis: 0,Übertragungsempfehlung: 0,Grund für Anwendungszulassung: 0,Quelle: Heuristic Scan,Risikoname: ,Vorkommnisse2009-02-19 11:31:50,Erzwungene proaktive TruScan-Bedrohung erkannt,Computer-Name: r0764,Erkennungstyp: Heuristisch,Anwendungsname: Java(TM) Platform SE 6 U11,Anwendungstyp: Trojaner-Wurm,Anwendungsversion: 6.0.110.3,Hash-Typ: SHA-1,Anwendungs-Hash: a6abbadf4a7d0be5c45ec25be328b0d9eee601d9,Firmenname: Sun Microsystems\~ Inc.,Dateigröße (Byte): 144792,Empfindlichkeit: 0,Erkennungsergebnis: 0,Übertragungsempfehlung: 0,Grund für Anwendungszulassung: 0,Quelle: Heuristic Scan,Risikoname: ,Vorkommnisse: 1,c:/windows/system32"); $output = `$command`; diag($output); #CRITICAL - (2 errors in check_logfiles.protocol-2009-02-19-13-46-49) - Feb 19 13:46:48 localhost check_logfiles[3751] 2009-02-19 09:21:47,Erzwungene proaktive TruScan-Bedrohung gefunden,Compu ...|ssh_lines=2 ssh_warnings=0 ssh_criticals=2 ssh_unknowns=0 $output =~ / \- ([a-zA-Z]{3}.*) \.\.\./; ok(length $1 == 120); diag($1); diag(length $1); check_logfiles-4.1.1/t/004rotationpattern.t0000664000175000017500000003070014336703157015523 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/004rotation.t # # Test the capability of finding rotated logfiles. # moving archive files # /pfad/YYYYMM/xxx-YYYYMMDDHH.log # # /archive/201005 # .... # /archive/201005/2010053100.log # /archive/201005/2010053101.log # /archive/201005/2010053100.log # ... hourly creation of a new logfile # /archive/201005/2010053123.log # /archive/201005 # ... new month, new archive # /archive/201006/2010060000.log # /archive/201006/2010060100.log # logfile => '/archive/$CL_DATE_MM$$CL_DATE_DD$/$CL_DATE_HH$00.log' # rotation => '\d{4}\.log' # archivedir => '/archive/\d{4}' # options = 'archivedirregexp=1' use strict; use Test::More tests => 6; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant DIR => "."; my $logdir; my $logfile; my $cl; my $ssh; my ($year, $mon, $day, $hour); sub log_to_file { my $logdir = shift; my $day = shift; my $hour = shift; my $errors = shift; my $message = shift; $logdir =~ /.*(\d{4})(\d{2})/; my ($year, $mon) = ($1, $2); my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => './var/tmp', seekfilesdir => './var/tmp', searches => [{ tag => "unused", logfile => sprintf("%s/%04d%02d%02d%02d.log", $logdir, $year, $mon, $day, $hour), criticalpatterns => '.*', }] }); my $dummy = $cl->get_search_by_tag("unused"); printf STDERR "i will log to %s\n", $dummy->{logfile}; $dummy->logger(undef, undef, $errors, $message); $dummy->loggercrap(undef, undef, 100); } if ($^O =~ /MSWin/) { system ('rd /S /Q .\var\rot'); system ('md var\rot'); } else { system("rm -rf ./var/rot"); mkdir "./var/rot"; } #################### 31.5. 00:00 ($year, $mon, $day, $hour) = (2010, 05, 31, 00); $logdir = sprintf "./var/rot/%04d%02d", $year, $mon; mkdir $logdir; #################### 31.5. 12:20 ($year, $mon, $day, $hour) = (2010, 05, 31, 12); log_to_file($logdir, $day, $hour, 2, "Failed password for invalid user1"); sleep 1; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => './var/tmp', seekfilesdir => './var/tmp', searches => [{ tag => "ssh", type => 'rotating::uniform', logfile => $logdir.'/dummy', archivedir => './var/rot/\d{6}', criticalpatterns => "Failed password", rotation => '\d{10}\.log', options => 'archivedirregexp=1', }] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_seekfile(); $cl->trace("is it now 31.5. 12:20"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 1 $cl->trace("that was the initial run"); #################### 31.5. 12:25 $cl->trace("is it now 31.5. 12:25"); ($year, $mon, $day, $hour) = (2010, 05, 31, 12); log_to_file($logdir, $day, $hour, 2, "Failed password for invalid user1"); sleep 1; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => './var/tmp', seekfilesdir => './var/tmp', searches => [{ tag => "ssh", type => 'rotating::uniform', logfile => $logdir.'/dummy', archivedir => './var/rot/\d{6}', criticalpatterns => "Failed password", rotation => '\d{10}\.log', options => 'archivedirregexp=1', }] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 2 #################### 31.5. 13:00 $cl->trace("is it now 31.5. 13:00"); ($year, $mon, $day, $hour) = (2010, 05, 31, 13); log_to_file($logdir, $day, $hour, 3, "Failed password for invalid user1"); sleep 1; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => './var/tmp', seekfilesdir => './var/tmp', searches => [{ tag => "ssh", type => 'rotating::uniform', logfile => $logdir.'/dummy', archivedir => './var/rot/\d{6}', criticalpatterns => "Failed password", rotation => '\d{10}\.log', options => 'archivedirregexp=1', }] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 3, 0, 2)); # 3 log_to_file($logdir, $day, $hour, 4, "Failed password for invalid user1"); sleep 1; #################### 31.5. 14:05 $cl->trace("is it now 31.5. 14:05"); ($year, $mon, $day, $hour) = (2010, 05, 31, 14); log_to_file($logdir, $day, $hour, 4, "Failed password for invalid user1"); sleep 1; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => './var/tmp', seekfilesdir => './var/tmp', searches => [{ tag => "ssh", type => 'rotating::uniform', logfile => $logdir.'/dummy', archivedir => './var/rot/\d{6}', criticalpatterns => "Failed password", rotation => '\d{10}\.log', options => 'archivedirregexp=1', }] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 8, 0, 2)); # 4 log_to_file($logdir, $day, $hour, 4, "Failed password for invalid user1"); sleep 1; #################### 31.5. 15:00 $cl->trace("is it now 31.5. 15:00"); ($year, $mon, $day, $hour) = (2010, 05, 31, 15); log_to_file($logdir, $day, $hour, 1, "Failed password for invalid user1"); sleep 1; #################### 31.5. 22:59 $cl->trace("is it now 31.5. 22:59"); ($year, $mon, $day, $hour) = (2010, 05, 31, 22); log_to_file($logdir, $day, $hour, 1, "Failed password for invalid user1"); sleep 1; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => './var/tmp', seekfilesdir => './var/tmp', searches => [{ tag => "ssh", type => 'rotating::uniform', logfile => $logdir.'/dummy', archivedir => './var/rot/\d{6}', criticalpatterns => "Failed password", rotation => '\d{10}\.log', options => 'archivedirregexp=1', }] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6, 0, 2)); # 5 #################### 31.5. 23:59 $cl->trace("is it now 31.5. 23:59"); ($year, $mon, $day, $hour) = (2010, 05, 31, 23); log_to_file($logdir, $day, $hour, 1, "Failed password for invalid user1"); sleep 1; #################### 01.06. 00:01 $cl->trace("is it now 1.6. 00:01"); ($year, $mon, $day, $hour) = (2010, 06, 1, 00); $logdir = sprintf "./var/rot/%04d%02d", $year, $mon; mkdir $logdir; log_to_file($logdir, $day, $hour, 1, "Failed password for invalid user1"); sleep 1; $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => './var/tmp', seekfilesdir => './var/tmp', searches => [{ tag => "ssh", type => 'rotating::uniform', logfile => $logdir.'/dummy', archivedir => './var/rot/\d{6}', criticalpatterns => "Failed password", rotation => '\d{10}\.log', options => 'archivedirregexp=1', }] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 5 exit; #################### 12.5. 13:00 #################### 12.5. 13:02 #################### 12.5. 13:07 #################### 12.5. 13:20 #################### 12.5. 23:00 #################### 12.5. 23:59 # now rotate and find the two new criticals $ssh->trace("==== 3 ===="); $ssh->rotate(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 4 ===="); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); # now write messages and find them $ssh->trace("==== 5 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 6 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 7 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # repeat but this time with nologfilenocry $cl->reset(); $ssh = $cl->get_search_by_tag("ssh"); $ssh->{options}->{logfilenocry} = 0; $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 8 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 9 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 10 ===="); $ssh->rotate(); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 11 ===="); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now write messages and find them $ssh->trace("==== 12 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 13 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 14 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); check_logfiles-4.1.1/t/080configdir.t0000664000175000017500000002661514336703157014250 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/080configdir.t # # like 011searches. Two configfiles with overlapping tags # use strict; use Test::More tests => 8; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; if ($^O =~ /MSWin/) { system ('rd .\etc\etc'); system ('md etc\etc'); system ('DEL /Q /S /F .\var\tmp\*'); } else { system ("mkdir -p etc/etc"); system ("rm -rf etc/etc/*"); system ("rm -rf var/tmp/*"); } my $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user8", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "test", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user9", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); \$postscript = sub { printf "uiuiuiuiuiui\\n"; return 2; }; EOCFG open CCC, ">./etc/etc/001searches.cfg"; print CCC $configfile; close CCC; $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user18", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "rulzn", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user ruhland", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); \$postscript = sub { printf "oioioioioioioi %s | %s\\n", \$ENV{CHECK_LOGFILES_SERVICEOUTPUT}, \$ENV{CHECK_LOGFILES_SERVICEPERFDATA}; return \$ENV{CHECK_LOGFILES_SERVICESTATEID}; }; EOCFG open CCC, ">./etc/etc/002searches.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => ["./etc/etc/001searches.cfg", "./etc/etc/002searches.cfg"], selectedsearches => ['ssh', 'null', 'rulzn'] }); # ssh null rulzn postscript diag("================================================================"); diag("reset run"); ok(scalar @{$cl->{searches}} == 4); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); #my $test = $cl->get_search_by_tag("test"); #$test->delete_logfile(); #$test->delete_seekfile(); #$test->trace("deleted logfile and seekfile"); my $null = $cl->get_search_by_tag("null"); $null->delete_logfile(); $null->delete_seekfile(); $null->trace("deleted logfile and seekfile"); my $rulzn = $cl->get_search_by_tag("rulzn"); $rulzn->delete_logfile(); $rulzn->delete_seekfile(); $rulzn->trace("deleted logfile and seekfile"); printf "%s\n", Data::Dumper::Dumper($cl->{allerrors}); $cl->run(); diag($cl->has_result()); printf "%s\n", Data::Dumper::Dumper($cl->{allerrors}); diag($cl->{exitmessage}); ok($cl->expect_result(1, 0, 0, 0, 0)); # 1ok kommt vom postscript $ssh->trace("==== 3-4 ===="); diag("================================================================"); diag("3 - 4"); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 2); $ssh->logger(undef, undef, 20, "Failed password for invalid user8"); $ssh->logger(undef, undef, 2, "Failed password for invalid user18"); $ssh->loggercrap(undef, undef, 2); # ssh logs instead of test $ssh->loggercrap(undef, undef, 2); $ssh->logger(undef, undef, 2, "Failed password for invalid user9"); $ssh->loggercrap(undef, undef, 2); $null->loggercrap(undef, undef, 2); $null->logger(undef, undef, 2, "Failed password is nonsense"); $null->loggercrap(undef, undef, 2); printf "calling run for 3, 4\n"; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); # 1 statt 4 wegen postscript (das resettet) ok($cl->{exitmessage} =~ /.*CRITICAL - \(4 errors.* Failed password is nonsense /); $ssh->trace("==== 5 - 6 ===="); diag("================================================================"); diag("5 - 6"); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $rulzn->logger(undef, undef, 3, "Failed password for invalid user ruhland"); $ssh->logger(undef, undef, 30, "Failed password for invalid user8"); $ssh->logger(undef, undef, 3, "Failed password for invalid user18"); $ssh->loggercrap(undef, undef, 20); # ssh logs instead of test $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 200, "Failed password for invalid user9"); $ssh->loggercrap(undef, undef, 20); $null->loggercrap(undef, undef, 20); $null->logger(undef, undef, 4, "Failed password is nonsense"); $null->loggercrap(undef, undef, 20); my $command = sprintf 'perl ../plugins-scripts/check_logfiles -F ./etc/etc --searches=ssh,null,rulzn'; $ssh->trace("executing %s", $command); my $output = `$command`; diag($output); diag("done"); diag($? >> 8); ok(($? >> 8) == 2); ok($output =~ /CRITICAL - \(10 errors .* Failed password is nonsense /); $ssh->trace("==== 7 ===="); diag("================================================================"); diag("7 - "); # ## 1 main configfile # etc/etc is a directory for many patch files # define test ssh in main # define ssh again in 001patch 002patch ## if ($^O =~ /MSWin/) { system ('rd /Q /S .\etc\etc'); system ('md etc\etc'); system ('DEL /Q /S /F etc\searches.cfg'); } else { system ("rm -rf etc/etc/*"); system ("rm -f etc/searches.cfg"); } $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user8", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, { tag => "test", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user9", warningpatterns => "Unknown user", options => "noperfdata,nologfilenocry" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => ".*nonsense.*", warningpatterns => "crap", options => "perfdata,nologfilenocry" }, ); \$postscript = sub { printf "uiuiuiuiuiui\\n"; return 2; }; EOCFG open CCC, ">./etc/searches.cfg"; print CCC $configfile; close CCC; $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user81", warningpatterns => "Unknown user", options => "perfdata,nologfilenocry" }, ); \$postscript = sub { printf "hundsglump varreckts nommol!!! %s | %s\\n", \$ENV{CHECK_LOGFILES_SERVICEOUTPUT}, \$ENV{CHECK_LOGFILES_SERVICEPERFDATA}; return \$ENV{CHECK_LOGFILES_SERVICESTATEID}; }; EOCFG open CCC, ">./etc/etc/001patch.cfg"; print CCC $configfile; close CCC; $configfile =< "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password for invalid user723", warningpatterns => "Unknown user", warningexceptions => ['Unknown user hiasl'], options => "perfdata,nologfilenocry" }, ); \$postscript = sub { printf "hundsglump varreckts!!! %s | %s\\n", \$ENV{CHECK_LOGFILES_SERVICEOUTPUT}, \$ENV{CHECK_LOGFILES_SERVICEPERFDATA}; return \$ENV{CHECK_LOGFILES_SERVICESTATEID}; }; EOCFG open CCC, ">./etc/etc/002patch.cfg"; print CCC $configfile; close CCC; sleep 10; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 30, "Failed password for invalid user8"); $ssh->logger(undef, undef, 3, "Failed password for invalid user81"); $ssh->logger(undef, undef, 3, "Unknown user oash"); $ssh->logger(undef, undef, 3, "Unknown user hiasl"); $ssh->loggercrap(undef, undef, 20); # ssh logs instead of test $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 200, "Failed password for invalid user9"); $ssh->loggercrap(undef, undef, 20); $null->loggercrap(undef, undef, 20); $null->logger(undef, undef, 4, "Failed password is nonsense"); $null->loggercrap(undef, undef, 20); # 3 warnings wg unknown user oash # criticals sind nicht betroffen user723 taucht nirgends auf. # 4 wegen null: nonsense # $command = sprintf 'perl ../plugins-scripts/check_logfiles -f ./etc/searches.cfg -F ./etc/etc --searches=ssh,null,rulzn'; $ssh->trace("executing %s", $command); $output = `$command`; diag($output); diag($? >> 8); ok(($? >> 8) == 2); ok($output =~ /CRITICAL - \(4 errors, 3 warnings .* Failed password is nonsense /); exit; sleep 1; diag("now with only a file again"); $cl->reset(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 30, "Failed password for invalid user8"); $ssh->logger(undef, undef, 3, "Failed password for invalid user81"); $ssh->logger(undef, undef, 3, "Unknown user oash"); $ssh->loggercrap(undef, undef, 20); # ssh logs instead of test $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 200, "Failed password for invalid user9"); $ssh->loggercrap(undef, undef, 20); $null->loggercrap(undef, undef, 20); #$null->logger(undef, undef, 4, "Failed password is nonsense"); $null->loggercrap(undef, undef, 20); # 30 crit wg user8 # 3 crit wg user 81 # 3 warn wgg unkn oash # criticals sind nicht betroffen # $command = sprintf 'perl ../plugins-scripts/check_logfiles -f ./etc/searches.cfg --searches=ssh,null,rulzn'; $ssh->trace("executing %s", $command); diag ("====================================="); diag ("====================================="); diag ("====================================="); $output = `$command`; diag($output); diag($? >> 8); ok(($? >> 8) == 2); ok($output =~ /CRITICAL - \(30 errors .* Failed password is nonsense /); check_logfiles-4.1.1/t/060templates.t0000664000175000017500000001667314336703157014303 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/060templates.t # # Test logfiles which will be deleted and recreated instead of rotated. # use strict; use Test::More tests => 19; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile =< "outlook", logfile => "./var/adm/messages", criticalpatterns => "mailbox corrupt", warningpatterns => "mailbox full", options => 'perfdata,syslogclient=\$CL_TAG\$' }, { template => "excel", logfile => "./var/adm/messages", criticalpatterns => "oo file found", options => 'perfdata,syslogclient=\$CL_TAG\$' }, { tag => "simple", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }); EOCFG open CCC, ">./etc/templates.cfg"; print CCC $configfile; close CCC; $configfile =< "outlook", logfile => "./var/adm/messages", criticalpatterns => "mailbox corrupt", warningpatterns => "mailbox full", options => 'perfdata,syslogclient=\$CL_TAG\$' }, { template => "excel", logfile => "./var/adm/messages", criticalpatterns => "oo file found", options => 'perfdata,syslogclient=\$CL_TAG\$' }, { tag => "simple", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }); EOCFG open CCC, ">./etc/templates2.cfg"; print CCC $configfile; close CCC; my $cl0815 = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/templates.cfg", selectedsearches => ['excel', 'outlook'], dynamictag => 'pc0815.muc' }); printf STDERR "%s\n", $Nagios::CheckLogfiles::ExitMsg; #printf STDERR "%s", Data::Dumper::Dumper($cl0815); my $cl4711 = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/templates.cfg", selectedsearches => ['excel', 'outlook'], dynamictag => 'pc4711.muc' }); my $clall = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/templates.cfg", dynamictag => 'pc4711.muc' }); ok(scalar(@{$clall->{searches}}) == 3); my $clsimple = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/templates.cfg", }); diag(sprintf "clsimple has %d searches", scalar(@{$clsimple->{searches}})); ok(scalar(@{$clsimple->{searches}}) == 1); my $outlook0815 = $cl0815->get_search_by_template("outlook"); my $excel0815 = $cl0815->get_search_by_template("excel"); my $outlook4711 = $cl4711->get_search_by_template("outlook"); my $excel4711 = $cl4711->get_search_by_template("excel"); foreach my $cl ($cl0815, $cl4711, $clall, $clsimple) { foreach my $s (@{$cl->{searches}}) { $s->delete_seekfile(); $s->delete_logfile(); } } $cl0815->run(); $cl4711->run(); $clall->run(); $clsimple->run(); # check the creation of the right seekfiles ok(-f "./var/tmp/templates.._var_adm_messages.outlook_pc0815.muc"); ok(-f "./var/tmp/templates.._var_adm_messages.outlook_pc4711.muc"); ok(-f "./var/tmp/templates.._var_adm_messages.excel_pc0815.muc"); ok(-f "./var/tmp/templates.._var_adm_messages.excel_pc4711.muc"); ok(-f "./var/tmp/templates.._var_adm_messages.simple"); foreach my $cl ($cl0815, $cl4711, $clall, $clsimple) { foreach my $s (@{$cl->{searches}}) { $s->delete_seekfile(); } } ok(! -f "./var/tmp/templates.._var_adm_messages.outlook_pc0815.muc"); ok(! -f "./var/tmp/templates.._var_adm_messages.outlook_pc4711.muc"); ok(! -f "./var/tmp/templates.._var_adm_messages.excel_pc0815.muc"); ok(! -f "./var/tmp/templates.._var_adm_messages.excel_pc4711.muc"); # reset counters $cl0815->run(); $cl4711->run(); $clall->run(); $clsimple->run(); $outlook0815->logger(undef, undef, 4, "pc0815.muc: Failed password"); $outlook0815->logger(undef, undef, 2, "pc4711.muc: Failed password"); $outlook0815->logger(undef, undef, 4, "pc0815.muc: mailbox corrupt"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc0815.muc: mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc04711.muc: ramsch"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 14, "pc4711.muc: mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc4711.muc: excel oo file found"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc4711.muc: outlook mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $cl0815->reset(); $cl0815->run(); $cl4711->reset(); $cl4711->run(); $clall->reset(); $clall->run(); $clsimple->reset(); $clsimple->run(); # 4 mailb corr, 4 mailb full diag($cl0815->has_result()); diag($cl0815->{exitmessage}); ok($cl0815->expect_result(0, 4, 4, 0, 2)); ok($cl0815->{exitmessage} =~ /CRITICAL - \(4 errors, 4 warnings.* - .* mailbox corrupt /); diag($cl4711->has_result()); diag($cl4711->{exitmessage}); ok($cl4711->expect_result(0, 18, 4, 0, 2)); ok($cl4711->{exitmessage} =~ /CRITICAL - \(4 errors, 18 warnings.* - .* oo file .* /); diag($clall->has_result()); diag($clall->{exitmessage}); $clall->reset(); $clall->run(); $outlook0815->logger(undef, undef, 4, "pc0815.muc: Failed password"); $outlook0815->logger(undef, undef, 2, "pc4711.muc: Failed password"); $outlook0815->logger(undef, undef, 4, "pc0815.muc: mailbox corrupt"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc0815.muc: mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc4711.muc: ramsch"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 14, "pc4711.muc: mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 7, "pc4711.muc: excel oo file found"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 5, "pc4711.muc: outlook mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $clall->reset(); $clall->run(); diag($clall->has_result()); diag($clall->{exitmessage}); ok($clall->expect_result(0, 19, 13, 0, 2)); ok($clall->{exitmessage} =~ /CRITICAL - \(13 errors, 19 warnings.* - .*4711.muc: Failed .* /); $clsimple->reset(); $clsimple->run(); $outlook0815->logger(undef, undef, 4, "pc0815.muc: Failed password"); $outlook0815->logger(undef, undef, 2, "pc4711.muc: Failed password"); $outlook0815->logger(undef, undef, 4, "pc0815.muc: mailbox corrupt"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc0815.muc: mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 4, "pc4711.muc: ramsch"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 14, "pc4711.muc: mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 7, "pc4711.muc: excel oo file found"); $outlook0815->loggercrap(undef, undef, 20); $outlook0815->logger(undef, undef, 5, "pc4711.muc: outlook mailbox full"); $outlook0815->loggercrap(undef, undef, 20); $clsimple->reset(); $clsimple->run(); diag($clsimple->has_result()); diag($clsimple->{exitmessage}); ok($clsimple->expect_result(0, 0, 6, 0, 2)); ok($clsimple->{exitmessage} =~ /CRITICAL - \(6 errors.* - .*4711.muc: Failed .* /); #$cl4711->run(); #$clsimple->run() check_logfiles-4.1.1/t/041wevtutilps.t0000664000175000017500000001047314336703157014522 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/040eventlog.t # # Test that all the Perl modules we require are available. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use Nagios::CheckLogfiles::Search::Eventlog; use constant TESTDIR => "."; if (($^O ne "cygwin") and ($^O !~ /MSWin/)) { diag("this is not a windows machine"); plan skip_all => 'Test only relevant on Windows'; } else { plan tests => 7; } ###################################################### # # powershell -Command "echo hihi" # leaves # "PowerShell-Konsole wird gestartet." # and # "Windows PowerShell hat einen IPC-Listeningthread für den Prozess 7204 in AppDomain DefaultAppDomain gestartet" ( this seems to be new since some win 10 creators? update # and # "PowerShell-Konsole ist für Benutzereingaben bereit." # in # Microsoft-Windows-PowerShell/Operational my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "msps", type => "wevtutil", criticalpatterns => ["Microsoft", "PowerShell.*(ready|bereit)" ], warningpatterns => ["PowerShell.*(started|gestartet)" ], warningexceptions => ["PowerShell.*DefaultAppDomain.*(started|gestartet)" ], wevtutil => { eventlog => "Microsoft-Windows-PowerShell/Operational", } } ] }); $cl->make_windows_plugin(); my $msps = $cl->get_search_by_tag("msps"); $msps->delete_seekfile(); $msps->trace("deleted seekfile"); $msps->trace("initial run"); $cl->run(); # cleanup $cl->reset(); diag("cleanup"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $msps->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep 30; system('powershell -Command "echo hihi"'); sleep 5; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); diag("---------------------------------------"); $cl->reset(); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); diag("---------------------------------------"); $cl->reset(); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 11, 11, 0, 2)); diag("---------------------------------------"); $cl->reset(); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); diag("---------------------------------------"); $cl->reset(); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 1, 0, 2)); diag("---------------------------------------"); $cl->reset(); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); system('powershell -Command "echo hihi"'); sleep int(1 + 10 * rand); system('powershell -Command "echo hihi"'); sleep 2; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 11, 11, 0, 2)); $cl->remove_windows_plugin(); check_logfiles-4.1.1/t/007thresholdexpire.t0000664000175000017500000001122314336703157015501 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/007thresholdexpire.t # # Test that all the Perl modules we require are available. # Simulate a portscan. Connections to port 80 are ok. # use strict; use Test::More tests => 21; use Cwd; use Data::Dumper; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; # # Count the hits, but reset the counter to 0 if an okpattern was found # Hit counts have a lifetime of 5s # # Case 1: nosavethresholdcount # reset # 9 criticals, 2 warnings # run: OK # sleep 2 # 19 criticals, 12 warnings # run: CRITICAL # sleep 2 # 19 criticals, ok, 9 criticals # run: OK # sleep 2 # 19 criticals, ok, 19 criticals # run: CRITICAL (19) # my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [{ tag => "nmap", logfile => TESTDIR."/var/adm/messages", criticalpatterns => [ 'connection refused', 'connection on port\s+\d+', 'session aborted' ], criticalexceptions => 'connection on port\s+80[^\d]*', criticalthreshold => 10, warningpatterns => [ '.*total size is 0 .*', 'connection on port\s+80[^\d]*', ], warningthreshold => 3, okpatterns => [ 'sshd restarted', ], options => 'criticalthreshold=10,warningthreshold=3,thresholdexpiry=5', }] }); my $nmap = $cl->get_search_by_tag("nmap"); $nmap->delete_seekfile(); $cl->reset(); $cl->run(); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); diag(Data::Dumper::Dumper($nmap->{newstate}->{thresholdtimes})); foreach my $cnt (1..3) { $cl->reset(); $nmap->logger(undef, undef, 2, "connection refused"); # skip 9 -> 0 $cl->run(); ok($cl->expect_result(0, 0, 0, 0, 0)); sleep 1; } # 2-2-2- diag("now another critical"); $cl->reset(); $nmap->logger(undef, undef, 1, "connection refused"); # skip 9 -> 0 $cl->run(); # 2-2-2-1 diag("must have 7c"); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 7) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); sleep 2; # 2-2-2-1-- diag("now expire critical"); $cl->reset(); $nmap->logger(undef, undef, 1, "connection refused"); # skip 9 -> 0 # 2-2-2-1--1 $cl->run(); diag("must have 1c"); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 8) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); diag(""); sleep 2; # 2-2-2-1--1-- $cl->reset(); $cl->run(); diag("must have 4c"); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 4) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); # x-x-2-1--1-- sleep 1; $cl->reset(); $cl->run(); diag("must have 2c"); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 2) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); sleep 3; $cl->reset(); $cl->run(); diag("must have 0c"); diag(Data::Dumper::Dumper($nmap->{thresholdcnt})); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 0) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); foreach my $cnt (1..3) { $cl->reset(); $nmap->logger(undef, undef, 5, "connection refused"); # skip 9 -> 0 $cl->run(); #ok($cl->expect_result(0, 0, 0, 0, 0)); diag("loop ".$cnt." now ".$cl->has_result()); sleep 1; # die ersten beiden 5 werden zu einem critical # 5- bleibt } diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 5) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); # 5- $cl->reset(); $cl->run(); diag("must have 5c"); ok($cl->expect_result(0, 0, 0, 0, 0)); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 5) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); sleep 4; $nmap->logger(undef, undef, 6, "connection refused"); # skip 9 -> 0 $cl->reset(); $cl->run(); diag("must have 1c"); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 1) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); ok($cl->expect_result(0, 0, 1, 0, 2)); $nmap->logger(undef, undef, 9, "connection refused"); # skip 9 -> 0 $cl->reset(); $cl->run(); sleep 6; $cl->reset(); $cl->run(); ok(($nmap->{newstate}->{thresholdcnt}->{CRITICAL} == 0) && ($nmap->{newstate}->{thresholdcnt}->{WARNING} == 0)); ok($cl->expect_result(0, 0, 0, 0, 0)); check_logfiles-4.1.1/t/025commandline.t0000664000175000017500000000724014336703157014562 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/025commandline.t # # Test the capability of finding rotated logfiles with the commandline. # # # problem: the test script is ran under cygwin, but the check_logfiles is # a native active state perl script. # once /tmp, then TEMP is used as seekfilesdir, so the seekfiles are # not deleted properly # use strict; use Test::More tests => 5; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => ($^O =~/MSWin/) ? 'C:\TEMP' : '/tmp', seekfilesdir => ($^O =~/MSWin/) ? 'C:\TEMP' : '/tmp', searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->trace("starting.............%s", $cl->{seekfilesdir}); my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $ssh->{logfile} =~ s/\//\\/g; } my $command = sprintf $perlpath.' ../plugins-scripts/check_logfiles --tag=%s --criticalpattern="%s" --warningpattern="%s" --rotation=%s --logfile=%s --seekfilesdir %s', $ssh->{tag}, $ssh->{patterns}->{CRITICAL}->[0], $ssh->{patterns}->{WARNING}->[0], $ssh->{rotation}, $ssh->{logfile}, $cl->{seekfilesdir}; diag($command); $ssh->trace("executing %s", $command); $ssh->trace("deleting logfile and seekfile"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 1 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); my $output = `$command`; diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); sleep 1; # if not, cygwin says "Log file has the same modified time" #$ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); #$ssh->loggercrap(undef, undef, 100); system("ls -l var/adm/messages"); system("cat var/adm/messages"); $output = `$command`; diag($output); ok(($output =~ /CRITICAL - \(2 errors in/) && (($? >> 8) == 2)); # now find the two criticals without a protocol $ssh->trace("==== 3 ===="); $cl->reset(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $output = `$command --noprotocol`; diag($output); ok(($output =~ /CRITICAL - \(2 errors\)/) && (($? >> 8) == 2)); # now rotate and find the two new criticals $ssh->trace("==== 4 ===="); $ssh->rotate(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); $output = `$command`; diag($output); ok(($output =~ /CRITICAL - \(2 errors in/) && (($? >> 8) == 2)); # now rotate and find the two new criticals but without perfdata $ssh->trace("==== 5 ===="); $ssh->rotate(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $output = `$command --noperfdata`; diag($output); ok(($output =~ /CRITICAL - \(2 errors in.*\.\.\./) && (($? >> 8) == 2)); $ssh->delete_logfile(); $ssh->delete_seekfile(); check_logfiles-4.1.1/t/002exceptions.t0000664000175000017500000000564714336703157014461 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/002exceptions.t # # Simple warnings and criticals and their anullation with exceptions. # use strict; use Test::More tests => 4; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", criticalexceptions => "Failed password for invalid user (lausser|seppl)", warningpatterns => ["Unknown user", "Failed password for invalid user seppl"], warningexceptions => "Unknown user lausser" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user user1..."); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the four criticals and two warnings $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); $ssh->logger(undef, undef, 2, "Failed password for invalid user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user hiasl"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 4, 0, 2)); # now find the four criticals and one warnings $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); $ssh->logger(undef, undef, 2, "Failed password for invalid user sepp"); $ssh->logger(undef, undef, 2, "Failed password for invalid user lausser"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user lausser"); $ssh->logger(undef, undef, 1, "Unknown user hiasl"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 4, 0, 2)); # now find the two criticals and three warnings # user seppl will be critical, then revoked, then warning $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); #c $ssh->logger(undef, undef, 2, "Failed password for invalid user seppl"); #c ex, w $ssh->logger(undef, undef, 2, "Failed password for invalid user lausser"); #c ex $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user lausser"); #w ex, w $ssh->logger(undef, undef, 1, "Unknown user hiasl"); #w sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 2, 0, 2)); check_logfiles-4.1.1/t/035chaosrotations.t0000664000175000017500000001517514336703157015343 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/004rotation.t # # Test the capability of finding rotated logfiles with similar names # use strict; use Test::More tests => 6; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", }, { tag => "ssh2", logfile => TESTDIR."/var/adm/messages-with-some-text", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", }, { tag => "ssh3", logfile => TESTDIR."/var/adm/moremessages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", }, { tag => "ssh4", logfile => TESTDIR."/var/adm/more-messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "loglog0log1", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); my $ssh2 = $cl->get_search_by_tag("ssh2"); $ssh2->delete_logfile(); $ssh2->delete_seekfile(); $ssh2->trace("deleted logfile and seekfile"); my $ssh3 = $cl->get_search_by_tag("ssh3"); $ssh3->delete_logfile(); $ssh3->delete_seekfile(); $ssh3->trace("deleted logfile and seekfile"); my $ssh4 = $cl->get_search_by_tag("ssh4"); $ssh4->delete_logfile(); $ssh4->delete_seekfile(); $ssh4->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); $ssh2->logger(undef, undef, 2, "Failed password for invalid user1"); $ssh3->logger(undef, undef, 2, "Failed password for invalid user1"); $ssh4->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); $ssh2->loggercrap(undef, undef, 100); $ssh2->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh2->loggercrap(undef, undef, 100); $ssh3->loggercrap(undef, undef, 100); $ssh3->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh3->loggercrap(undef, undef, 100); $ssh4->loggercrap(undef, undef, 100); $ssh4->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh4->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 8, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 3 ===="); $ssh->rotate(); $ssh2->rotate(); $ssh3->rotate(); $ssh4->rotate(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh2->loggercrap(undef, undef, 100); $ssh2->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh2->loggercrap(undef, undef, 100); $ssh3->loggercrap(undef, undef, 100); $ssh3->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh3->loggercrap(undef, undef, 100); $ssh4->loggercrap(undef, undef, 100); $ssh4->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh4->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 8, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 4 ===="); $ssh->rotate(); $ssh2->rotate(); $ssh3->rotate(); $ssh4->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 4, 3)); # now write messages and find them $ssh->trace("==== 5 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); $ssh2->loggercrap(undef, undef, 100); $ssh2->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh2->loggercrap(undef, undef, 100); $ssh3->loggercrap(undef, undef, 100); $ssh3->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh3->loggercrap(undef, undef, 100); $ssh4->loggercrap(undef, undef, 100); $ssh4->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh4->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 8, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 6 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh2->loggercrap(undef, undef, 100); $ssh2->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh2->loggercrap(undef, undef, 100); $ssh3->loggercrap(undef, undef, 100); $ssh3->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh3->loggercrap(undef, undef, 100); $ssh4->loggercrap(undef, undef, 100); $ssh4->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh4->loggercrap(undef, undef, 100); $ssh->rotate(); $ssh2->rotate(); $ssh3->rotate(); $ssh4->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh2->loggercrap(undef, undef, 100); $ssh3->loggercrap(undef, undef, 100); $ssh4->loggercrap(undef, undef, 100); $ssh->rotate(); $ssh2->rotate(); $ssh3->rotate(); $ssh4->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh2->loggercrap(undef, undef, 100); $ssh2->logger(undef, undef, 1, "Unknown user sepp"); $ssh2->loggercrap(undef, undef, 100); $ssh3->loggercrap(undef, undef, 100); $ssh3->logger(undef, undef, 1, "Unknown user sepp"); $ssh3->loggercrap(undef, undef, 100); $ssh4->loggercrap(undef, undef, 100); $ssh4->logger(undef, undef, 1, "Unknown user sepp"); $ssh4->loggercrap(undef, undef, 100); $ssh->rotate(); $ssh2->rotate(); $ssh3->rotate(); $ssh4->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 4, 8, 4, 2)); check_logfiles-4.1.1/t/036cl_warning.t0000664000175000017500000000343614336703157014424 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/036cl_warning.t # # [check_logfiles] Some macros still broken in v3.7.1.1 (#7) # use strict; use Test::More tests => 3; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < 'some_tag', logfile => 'some_log', criticalpatterns => [ 'some_string', ], options => 'supersmartscript', script => sub { foreach my \$key (sort(keys \%ENV)) { next unless \$key =~ /^CHECK/; printf "%s=%s\n", \$key, \$ENV{\$key}; } return 2; } }); EOCFG open CCC, ">./etc/check_warn.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_warn.cfg" }); my $some = $cl->get_search_by_tag("some_tag"); my $perlpath = `which perl`; chomp $perlpath; if ($^O =~ /MSWin/) { if (-f 'C:\strawberry\perl\bin\perl.exe') { $perlpath = 'C:\strawberry\perl\bin\perl'; } else { $perlpath = 'C:\Perl\bin\perl'; } $some->{logfile} =~ s/\//\\/g; } $some->delete_logfile(); $some->delete_seekfile(); $some->trace("deleted logfile and seekfile"); $some->loggercrap(undef, undef, 100); my $command = sprintf $perlpath.' ../plugins-scripts/check_logfiles --config=etc/check_warn.cfg --warning 100 '; my $output = `$command`; diag($output); ok(($output =~ /OK - no errors or warnings/) && (($? >> 8) == 0)); $some->logger(undef, undef, 1, "this is some_string"); $output = `$command`; diag($output); ok(($output =~ /CRITICAL - \(1 errors/) && (($? >> 8) == 2)); ok($output =~ /CHECK_LOGFILES_WARNING=100/); check_logfiles-4.1.1/t/020perfdata.t0000664000175000017500000001374714336703157014066 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/005norotation.t # # Test logfiles which will be deleted and recreated instead of rotated. # # fill a logfile with crap. run. must be ok # add criticals. run. must be critical # delete logfile. add crap. run. must be ok. tracefile must mention recreation # add errors. run .must be critical # delete logfile. run. must be critical # add 100 lines of crap. run. must be ok # delete logfile. add 10 lines of criticals. add 10 lines of crap. run. must be critical # delete logfile. run. must be critical # add 100 lines of crap. run. must be ok # delete logfile. add 10 lines of criticals. add 100 lines of crap. run. must be critical # delete logfile. touch logfile. run. must be ok. # the same with no_logfile_no_cry => 1 use strict; use Test::More tests => 9; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }, { tag => "test", logfile => TESTDIR."/var/adm/messages", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "noperfdata" }, { tag => "null", logfile => TESTDIR."/var/adm/messages", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "nonsense", warningpatterns => "crap", options => "perfdata" }, ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); my $test = $cl->get_search_by_tag("test"); $test->delete_logfile(); $test->delete_seekfile(); $test->trace("deleted logfile and seekfile"); my $null = $cl->get_search_by_tag("null"); $null->delete_logfile(); $null->delete_seekfile(); $null->trace("deleted logfile and seekfile"); $cl->run(); $ssh->trace("==== 1 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 4, 0, 2)); ok($ssh->{perfdata} =~ /'ssh_lines'=\d+ 'ssh_warnings'=0 'ssh_criticals'=2 'ssh_unknowns'=0/); ok($test->{perfdata} eq ""); ok($null->{perfdata} =~ /'null_lines'=\d+ 'null_warnings'=0 'null_criticals'=0 'null_unknowns'=0/); ok($cl->{perfdata} =~ /'ssh_lines'=\d+ 'ssh_warnings'=0 'ssh_criticals'=2 'ssh_unknowns'=0 'null_lines'=\d+ 'null_warnings'=0 'null_criticals'=0 'null_unknowns'=0/); ok($cl->{exitmessage} =~ /CRITICAL - \(4 errors.* - [\w: \[\]]+ Failed password for invalid user8 ...\s*$/); diag(sprintf "((%s))", $cl->{exitmessage}); my $configfile = < "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" }, { tag => "test", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "noperfdata" }, { tag => "null", logfile => "./var/adm/messages", logfile => "./var/adm/messages", criticalpatterns => "nonsense", warningpatterns => "crap", options => "perfdata" }); EOCFG open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); my $postscript = $cl->get_search_by_tag("postscript"); $postscript->{script} = sub { my $output = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; my $perfdata = $ENV{CHECK_LOGFILES_SERVICEPERFDATA}; $perfdata =~ s/ssh/xxl/g; $perfdata =~ s/null/zero/g; printf "HURTZ! - das lamm schrie | %s\n", $perfdata; return 0; }; $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $test = $cl->get_search_by_tag("test"); $test->delete_logfile(); $test->delete_seekfile(); $test->trace("deleted logfile and seekfile"); $null = $cl->get_search_by_tag("null"); $null->delete_logfile(); $null->delete_seekfile(); $null->trace("deleted logfile and seekfile"); $cl->run(); $ssh->trace("==== 1 ===="); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 20); $cl->run(); diag("modified results"); diag("perf: ".$cl->{perfdata}); diag("exit: ".$cl->{exitmessage}); ok($cl->{perfdata} =~ /'xxl_lines'=\d+ 'xxl_warnings'=0 'xxl_criticals'=2 'xxl_unknowns'=0 'zero_lines'=\d+ 'zero_warnings'=0 'zero_criticals'=0 'zero_unknowns'=0/); ok($cl->{exitmessage} =~ /^HURTZ! - das lamm schrie $/); diag(sprintf "((%s))", $cl->{exitmessage}); SKIP:{ skip 'no executable', 1 if (! -x "../plugins-scripts/check_logfiles"); $ssh->loggercrap(undef, undef, 20); $ssh->logger(undef, undef, 2, "Failed password for invalid user8"); $ssh->loggercrap(undef, undef, 20); my $output = `../plugins-scripts/check_logfiles -f ./etc/check_action.cfg`; diag($output); ok($output =~ /^HURTZ! - das lamm schrie |'xxl_lines'=\d+ 'xxl_warnings'=0 'xxl_criticals'=2 'xxl_unknowns'=0 'zero_lines'=\d+ 'zero_warnings'=0 'zero_criticals'=0 'zero_unknowns'=0/); } check_logfiles-4.1.1/t/015action.t0000664000175000017500000001755514336703157013562 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/005negative.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 14; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < 'nagios.dierichs.de', CL_NSCA_PORT => 5555, SNMP_TRAP_SINK_HOST => 'nagios.dierichs.de', SNMP_TRAP_SINK_VERSION => 'snmpv1', SNMP_TRAP_SINK_COMMUNITY => 'public', SNMP_TRAP_SINK_PORT => 162, SNMP_TRAP_ENTERPRISE_OID => '1.3.6.1.4.1.20006.1.5.1', }; \@searches = ( { tag => "action", logfile => "./var/adm/messages", criticalpatterns => [ '.*connection unexpectedly closed.*', '.*rsync error.*', 'rsync:.*', '!.*DEBUT.*', '!.*FIN.*', '!.*building file list.*', '!.*files to consider.*', '!.*sent .* bytes\\s+received .* bytes\\s+.* bytes/sec.*', '!.*total size is .* \\s+speedup is .*' , ], warningpatterns => [ '.*total size is 0 .*', '.*sent 0 bytes.*', '.*received 0 bytes.*' ], options => 'script', script => "send_snmptrap" }); \$postscript = 'send_nsca'; \$postscriptparams = '-H \$CL_NSCA_HOST_ADDRESS\$ -p \$CL_NSCA_PORT\$ -to \$CL_NSCA_TO_SEC\$ -c \$CL_NSCA_CONFIG_FILE\$'; \$postscriptstdin = '\$CL_HOSTNAME\$\\t\$CL_SERVICEDESC\$\\t\$CL_SERVICESTATEID\$\\t\$CL_SERVICEOUTPUT\$\\n'; EOCFG open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); if ($^O =~ /MSWin/) { $cl->create_file("./bin/send_snmptrap.bat", 0755, " echo off rem echo i am the script rem echo status %CHECK_LOGFILES_SERVICESTATEID% echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" >> ./var/tmp/scriptcounter exit /B 3; "); } else { $cl->create_file("./bin/send_snmptrap", 0755, " echo i am the script \$CHECK_LOGFILES_SERVICESTATEID \$CHECK_LOGFILES_SERVICEOUTPUT echo status \$CHECK_LOGFILES_SERVICESTATEID echo output \"\$CHECK_LOGFILES_SERVICEOUTPUT\" >> ./var/tmp/scriptcounter exit 3; "); }; if ($^O =~ /MSWin/) { $cl->create_file("./bin/send_nsca.bat", 0755, " echo off echo i am the postscript echo status %CHECK_LOGFILES_SERVICESTATEID% echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" echo output \"%CHECK_LOGFILES_SERVICEOUTPUT%\" >> ./var/tmp/scriptcounter exit /B 0; "); } else { $cl->create_file("./bin/send_nsca", 0755, " echo i am the postscript with \"\$*\" echo status \$CHECK_LOGFILES_SERVICESTATEID echo output \$CHECK_LOGFILES_SERVICEOUTPUT echo output \$CHECK_LOGFILES_SERVICEOUTPUT >> ./var/tmp/scriptcounter exit 0; "); } my $action = $cl->get_search_by_tag("action"); my $postscript = $cl->get_search_by_tag("postscript"); if ($^O =~ /MSWin/) { $action->{script} = "send_snmptrap.bat"; $postscript->{script} = "send_nsca.bat"; delete $postscript->{scriptstdin}; } $cl->reset(); $cl->delete_file("./var/tmp/scriptcounter"); $action->delete_logfile(); $action->delete_seekfile(); diag("deleted logfile and seekfile"); $action->trace("deleted logfile and seekfile"); $action->logger(undef, undef, 1, "Failed password for invalid user1..."); diag("wrote 1 message"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6, 0, 2)); my $x = $cl->read_file("./var/tmp/scriptcounter"); my @lines = split(/\n/, $x); diag(sprintf "script was called %d times", scalar(@lines)); ok(@lines == 7); $cl->reset(); $cl->delete_file("./var/tmp/scriptcounter"); $action->delete_logfile(); $action->delete_seekfile(); $action->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6, 0, 2)); $x = $cl->read_file("./var/tmp/scriptcounter"); @lines = split(/\n/, $x); diag(sprintf "script was called %d times", scalar(@lines)); ok(@lines == 7); $cl->reset(); $cl->delete_file("./var/tmp/scriptcounter"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 8, 0, 2)); $x = $cl->read_file("./var/tmp/scriptcounter"); @lines = split(/\n/, $x); diag(sprintf "script was called %d times", scalar(@lines)); ok(@lines == 9); # backup working perfectly $cl->reset(); $cl->delete_file("./var/tmp/scriptcounter"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "DEBUT du backup"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "building file list ... done"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "files to consider:..."); $action->logger(undef, undef, 1, "file file file"); $action->logger(undef, undef, 1, "sent 871 bytes received 26 bytes 163.09 bytes/sec"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "total size is 30053 speedup is 33.50"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "FIN du backup"); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $x = $cl->read_file("./var/tmp/scriptcounter"); @lines = split(/\n/, $x); diag(sprintf "script was called %d times", scalar(@lines)); ok(@lines == 1); # backup with warning $cl->reset(); $cl->delete_file("./var/tmp/scriptcounter"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "DEBUT du backup"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "building file list ... done"); $action->logger(undef, undef, 1, "files to consider:..."); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "file file file"); $action->logger(undef, undef, 1, "sent 0 bytes received 0 bytes 0 bytes/sec"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "total size is 0 speedup is 0"); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "FIN du backup"); $action->loggercrap(undef, undef, 100); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 0, 0, 1)); $x = $cl->read_file("./var/tmp/scriptcounter"); @lines = split(/\n/, $x); diag(sprintf "script was called %d times", scalar(@lines)); ok(@lines == 4); #backup did not run at all $cl->reset(); $cl->delete_file("./var/tmp/scriptcounter"); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 6, 0, 2)); $x = $cl->read_file("./var/tmp/scriptcounter"); @lines = split(/\n/, $x); diag(sprintf "script was called %d times", scalar(@lines)); ok(@lines == 7); #mixed critical and missing errors. script is a piece of perl now. $cl->reset(); $cl->delete_file("./var/tmp/scriptcounter"); $action->{script} = sub { printf "i am perl\n"; open OOO, ">>./var/tmp/scriptcounter"; printf OOO "%s\n", $ENV{CHECK_LOGFILES_SERVICEOUTPUT}; close OOO; return 3; }; $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 1, "Ici le DEBUT "); $action->loggercrap(undef, undef, 100); $action->logger(undef, undef, 4, "there was an rsync error"); $action->logger(undef, undef, 1, "Et le FIN de l'histoire"); sleep 1; $cl->run(); $action->dump_protocol(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 8, 0, 2)); $x = $cl->read_file("./var/tmp/scriptcounter"); @lines = split(/\n/, $x); diag(sprintf "script was called %d times", scalar(@lines)); ok(@lines == 9); check_logfiles-4.1.1/t/001patternfile.t0000664000175000017500000001146314336703157014605 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/002exceptions.t # # Simple warnings and criticals and their anullation with exceptions. # use strict; use Test::More tests => 7; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $patternfilecontent =<<'EOF'; $criticalpatterns = [ "Failed password", "Failed powersupply", ]; $warningpatterns = "Unknown user"; $warningexceptions = [ "Unknown user lausser" ]; EOF my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", patternfiles => TESTDIR."/etc/patternfile.pat", criticalexceptions => "Failed password for invalid user (lausser|seppl)", warningpatterns => ["Failed password for invalid user seppl"], } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user user1..."); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the four criticals and two warnings $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); $ssh->logger(undef, undef, 2, "Failed password for invalid user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user hiasl"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 4, 0, 2)); # now find the four criticals and one warnings $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); $ssh->logger(undef, undef, 2, "Failed password for invalid user sepp"); $ssh->logger(undef, undef, 2, "Failed password for invalid user lausser"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user lausser"); $ssh->logger(undef, undef, 1, "Unknown user hiasl"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 4, 0, 2)); # now find the two criticals and three warnings # user seppl will be critical, then revoked, then warning $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); #c $ssh->logger(undef, undef, 2, "Failed password for invalid user seppl"); #c ex, w $ssh->logger(undef, undef, 2, "Failed password for invalid user lausser"); #c ex $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user lausser"); #w ex, w $ssh->logger(undef, undef, 1, "Unknown user hiasl"); #w sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 3, 2, 0, 2)); $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", patternfiles => [ TESTDIR."/etc/patternfile.pat", TESTDIR."/etc/patternfile2.pat", ], criticalexceptions => "Failed password for invalid user (lausser|seppl)", warningpatterns => ["Failed password for invalid user seppl"], } ] }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user user1..."); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the four criticals and two warnings $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user user2"); $ssh->logger(undef, undef, 2, "Failed password for invalid user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user hiasl"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 4, 0, 2)); # now find the four criticals and one warnings # now find a critical where the pattern is defined in a secondary patternfile $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "ALAAARM"); #c sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); check_logfiles-4.1.1/t/004rotationbetagan.t0000664000175000017500000000477214336703157015461 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/004rotation.t # # Bugfix for # issue #6 # use strict; use Test::More tests => 4; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "betagan", logfile => TESTDIR."/var/adm/my.log", criticalpatterns => "ERROR", rotation => "my.log.gz", option => "randominode", } ] }); my $betagan = $cl->get_search_by_tag("betagan"); $betagan->trace("cleaning up, removing my.log and my.log.gz, creating empty my.log and initialize run check_logfiles"); diag("cleaning up, removing my.log and my.log.gz, creating empty my.log and initialize run check_logfiles"); $betagan->delete_logfile(); $betagan->delete_seekfile(); $betagan->logger(undef, undef, 1, "OK some dummy text"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $betagan->trace("append an ERROR line"); diag("append an ERROR line"); $betagan->logger(undef, undef, 1, "ERROR dummy"); sleep 1; $betagan->trace("running check_logfiles for the first time (should and does return CRITICAL)"); diag("running check_logfiles for the first time (should and does return CRITICAL)"); $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 1, 0, 2)); $betagan->trace("performing log rotation and put one OK line in the new logfile"); diag("performing log rotation and put one OK line in the new logfile"); #$betagan->rotate(); #system("gzip -c $betagan->{logfile} > $betagan->{logfile}.gz"); system("gzip $betagan->{logfile}"); system("rm $betagan->{logfile}; echo OK > $betagan->{logfile}; ls -i $betagan->{logfile}"); sleep 1; $betagan->trace("running check_logfiles for the second time (should and does return OK)"); diag("running check_logfiles for the second time (should and does return OK)"); $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $betagan->trace("append a second OK line to the logfile"); diag("append a second OK line to the logfile"); $betagan->logger(undef, undef, 1, "OK some dummy text"); sleep 1; $betagan->trace("running check_logfiles for the third time (should return OK BUT DOES RETURN CRITICAL INSTEAD!!"); $cl->reset(); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); check_logfiles-4.1.1/t/040wevtutilfilt.t0000664000175000017500000001173614336703157015040 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/040eventlog.t # # Test that all the Perl modules we require are available. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use Nagios::CheckLogfiles::Search::Eventlog; use constant TESTDIR => "."; use Data::Dumper; sub sleep_until_next_minute { my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; while ($sec < 59) { sleep 1; ($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; } sleep 2; # now it is ~ hh:00, hh:01 } if (($^O ne "cygwin") and ($^O !~ /MSWin/)) { diag("this is not a windows machine"); plan skip_all => 'Test only relevant on Windows'; } else { plan tests => 4; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", type => "wevtutil", criticalpatterns => '.*', eventlog => { eventlog => "application", include => { EventType => 'Error', Source => 'EventCreate', }, exclude => { EventID => '13,23', }, } } ] }); $cl->make_windows_plugin(); my $ssh = $cl->get_search_by_tag("ssh"); if ($^O !~ /MSWin|cygwin/) { diag("windows only"); foreach (1..7) {ok(1)}; exit 0; } $ssh->delete_seekfile(); $ssh->trace("deleted seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $cl->run(); # cleanup $ssh->delete_seekfile(); $ssh->logger(undef, undef, 1, "Event examine info", undef, { EventType => 'Information', EventID => '0001', }); $ssh->logger(undef, undef, 1, "Event examine warning", undef, { EventType => 'Warning', EventID => '0001', }); $ssh->logger(undef, undef, 1, "Event examine error", undef, { EventType => 'Error', EventID => '0001', }); $ssh->logger(undef, undef, 1, "Event examine success", undef, { EventType => 'Success', EventID => '0001', }); $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); sleep_until_next_minute(); $ssh->trace("initial run"); diag("now look at four levels"); $cl->run(); # cleanup diag("1st run"); $cl->reset(); diag("cleanup"); $ssh->trace(sprintf "+----------------------- test %d ------------------", 7); sleep_until_next_minute(); $ssh->logger(undef, undef, 1, "Firewall problem1", undef, { EventType => 'Error', EventID => '0010', }); $ssh->logger(undef, undef, 1, "Firewall problem2", undef, { EventType => 'Error', EventID => '0011', }); $ssh->logger(undef, undef, 1, "DVD problem1", undef, { EventType => 'Error', EventID => '0013', Source => 'DVD', # block }); $ssh->logger(undef, undef, 1, "Firewall problem3", undef, { EventType => 'Error', EventID => '23', # block }); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); #1 # 2 now find the two criticals 1xFWproblem1 1xFWproblem2 $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep_until_next_minute(); # these events were created in the current minute and are ignored by the run() $ssh->logger(undef, undef, 1, "Fireball 2hihi"); $ssh->logger(undef, undef, 1, "Fireball 3hihi"); $ssh->logger(undef, undef, 1, "Firewall problem1"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}.'|'.$cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); #2 sleep 2; $cl->reset(); diag("now commandline"); $ssh->trace(sprintf "+----------------------- test %d ------------------", 7); $ssh->logger(undef, undef, 1, "Firewall problem1", undef, { EventType => 'Error', EventID => '0010', }); $ssh->logger(undef, undef, 1, "Firewall problem2", undef, { EventType => 'Error', EventID => '0011', }); $ssh->logger(undef, undef, 1, "DVD problem1", undef, { EventType => 'Error', EventID => '0013', Source => 'DVD', # block }); $ssh->logger(undef, undef, 1, "Firewall problem3", undef, { EventType => 'Error', EventID => '23', # block }); # run commandline sleep 2; my $cmd = sprintf "perl ../plugins-scripts/check_logfiles --tag %s --seekfilesdir %s --criticalpattern \".*\" --type \"wevtutil:eventlog=application,include,EventType=Error,Source=EventCreate,exclude,eventid=13,eventid=23\"", "ssh", TESTDIR."/var/tmp"; diag($cmd); #my $result = `$cmd`; #diag($result); #ok($result =~ /OK - no errors or warnings/); #ok(($? >> 8) == 0); # 2 now find the two criticals 1xFWproblem1 1xFWproblem2 $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); #sleep_until_next_minute(); $ssh->logger(undef, undef, 1, "Fireball 2hihi"); $ssh->logger(undef, undef, 1, "Fireball 3hihi"); $ssh->logger(undef, undef, 1, "Firewall problem1"); # run commandline my $result = `$cmd`; diag($result); ok($result =~ /CRITICAL - \(2 errors in/); ok(($? >> 8) == 2); $cl->remove_windows_plugin(); check_logfiles-4.1.1/t/bin/0000755000175000017500000000000014336703157012503 500000000000000check_logfiles-4.1.1/t/bin/send_snmptrap.pl0000755000175000017500000000170414336703157015642 00000000000000#! /usr/bin/perl use strict; use Net::SNMP; my $hostname = $ENV{CHECK_LOGFILES_SNMP_TRAP_SINK_HOST} || 'nagios.dierichs.de'; my $version = $ENV{CHECK_LOGFILES_SNMP_TRAP_SINK_VERSION} || 'snmpv1'; my $community = $ENV{CHECK_LOGFILES_SNMP_TRAP_SINK_COMMUNITY} || 'public'; my $port = $ENV{CHECK_LOGFILES_SNMP_TRAP_SINK_PORT} || 162; my $oid = $ENV{CHECK_LOGFILES_SNMP_TRAP_ENTERPRISE_OID} || '1.3.6.1.4.1.20006.1.5.1'; my ($session, $error) = Net::SNMP->session( -hostname => $hostname, -version => $version, -community => $community, -port => $port # Need to use port 162 ); if (!defined($session)) { printf("ERROR: %s.\n", $error); exit 1; } my @varbind = ($oid, OCTET_STRING, $ENV{CHECK_LOGFILES_SERVICEOUTPUT}); my $result = $session->trap( -enterprise => $oid, -specifictrap => $ENV{CHECK_LOGFILES_SERVICESTATEID}, -varbindlist => \@varbind); $session->close; exit 0; check_logfiles-4.1.1/t/bin/samplescript0000755000175000017500000000022114336703157015052 00000000000000#!/bin/bash awk '/CRITICAL/ { printf "this is critical: %s\n", $0 } /WARNING/ { printf "this is for whimps: %s\n", $0 }' env|grep CHECK_LOGFILES check_logfiles-4.1.1/t/bin/prescript.sh0000755000175000017500000000005414336703157014774 00000000000000 echo no i will definitively not run exit 2 check_logfiles-4.1.1/t/bin/myscript0000755000175000017500000000010514336703157014217 00000000000000#!/bin/bash echo i am myscript "$*" echo and i read cat echo hahaha check_logfiles-4.1.1/t/bin/script.sh0000755000175000017500000000010114336703157014256 00000000000000 # repeat the match echo "ben zi bena bluot zi bluoda" exit 0 check_logfiles-4.1.1/t/bin/send_snmptrap.bat0000755000175000017500000000024614336703157015775 00000000000000 echo off rem echo i am the script rem echo status %CHECK_LOGFILES_SERVICESTATEID% echo output "%CHECK_LOGFILES_SERVICEOUTPUT%" >> ./var/tmp/scriptcounter exit /B 3; check_logfiles-4.1.1/t/bin/myenv0000755000175000017500000000025114336703157013505 00000000000000#! /bin/bash echo ============================ env ============================ env | grep CHECK_LOG echo ============================================================= check_logfiles-4.1.1/t/bin/send_nsca0000755000175000017500000000025614336703157014311 00000000000000 echo i am the script with "$*" if [ "$1" = "-H" ] && [ "$2" = "nagios.dierichs.de" ] && [ "$3" = "-p" ] && [ "$4" = "5555" ]; then echo good exit 0; else echo bad exit 2 fi check_logfiles-4.1.1/t/bin/send_snmptrap0000755000175000017500000000031514336703157015225 00000000000000 echo i am the script $CHECK_LOGFILES_SERVICESTATEID $CHECK_LOGFILES_SERVICEOUTPUT echo status $CHECK_LOGFILES_SERVICESTATEID echo output "$CHECK_LOGFILES_SERVICEOUTPUT" >> ./var/tmp/scriptcounter exit 3; check_logfiles-4.1.1/t/Makefile.am0000775000175000017500000000101114336703157013705 00000000000000## ## Process this file with automake to produce Makefile.in ## AUTOMAKE_OPTIONS = 1.3 no-dependencies #all: tests TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = *.t TESTDB_SW = -d EXTRA_DIST = *.t bin var etc tests: $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE))" $(TEST_FILES) # PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) clean: rm -f var/adm/this_is_random* check_logfiles-4.1.1/t/082initfromline.t0000664000175000017500000000306714336703157015001 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/082initfromline.t # # Test if an encoded configfile is correctly decoded # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; plan tests => 2; my @patterns = (); my $configfile = q{ @searches = ({ tag => "test", logfile => "/var/log/messages", rotation => "SOLARIS", criticalpatterns => [ "ERROR", "root on none", ], options => "script", script => sub { use LWP; print "hello world"; my $browser = LWP::UserAgent->new(); my $response = $browser->post( 'https://10.0.15.248/monitor/upload/upload.php', [text1 => 'blabla', text2 => 'blablubb', 'Datei' => [undef,'job_name',], ], 'Content_Type' => 'form-data', ); } }); }; open CCC, ">./etc/encodeme.cfg"; print CCC $configfile; close CCC; open (CFG,"./etc/encodeme.cfg"); my $contents = ""; while () {$contents .= $_} #print $contents."\n###\n"; $contents =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; close (CFG); my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => $contents }); printf STDERR "%s\n", $cl->{cfgfile}; ok($cl->{cfgfile} eq $configfile); our($seekfilesdir, $protocolsdir, $scriptpath, $protocolretention, $prescript, $prescriptparams ,$prescriptstdin, $prescriptdelay, $postscript, $postscriptparams, $postscriptstdin, $postscriptdelay, @searches, @logs, $tracefile, $options, $report, $timeout, $pidfile); our $MACROS = {}; eval $cl->{cfgfile}; printf STDERR "error: %s\n", $@; ok(! $@); check_logfiles-4.1.1/t/004rotation.t0000664000175000017500000001512114336703157014125 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/004rotation.t # # Test the capability of finding rotated logfiles. # use strict; use Test::More tests => 14; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", rotation => "SOLARIS", } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 2 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 3 ===="); $ssh->rotate(); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 4 ===="); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 1, 3)); # now write messages and find them $ssh->trace("==== 5 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 6 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 7 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 1, 2)); # repeat but this time with nologfilenocry $cl->reset(); $ssh = $cl->get_search_by_tag("ssh"); $ssh->{options}->{logfilenocry} = 0; $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace("==== 8 ===="); $ssh->logger(undef, undef, 2, "Failed password for invalid user1"); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $ssh->trace("==== 9 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and find the two new criticals $ssh->trace("==== 10 ===="); $ssh->rotate(); sleep 1; $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now rotate and create no new logfile $ssh->trace("==== 11 ===="); $ssh->rotate(); $cl->reset(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now write messages and find them $ssh->trace("==== 12 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now write critical messages, rotate, write harmless messages, rotate, write warning, rotate, stop # # # under cygwin rotation changes modification time!!!!!!!!!!!!! # $ssh->trace("==== 13 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user5"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); # now write critical messages, rotate, write harmless stuff, rotate, write warning $ssh->trace("==== 14 ===="); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user6"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 1, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); $ssh->rotate(); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 1, 2, 0, 2)); check_logfiles-4.1.1/t/078critfirst.t0000664000175000017500000001366214336703157014322 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/078critfirst.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 2; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = <<'EOCFG'; @searches = ({ tag => 'critfirst', logfile => 'var/tmp/eventlog', #type => 'eventlog', #eventlog => { # eventlog => 'application', # include => { # eventtype => 'error,warning', # }, #}, # 'winwarncrit' mappt windows Kritikalitaet auf Nagios: ERROR->CRITICAL, WARNING->WARNING options => 'supersmartscript,winwarncrit,noperfdata,noprotocol,preferredlevel=critical,eventlogformat="(id:%i/so:%s) - %m"', script => \&reformat_output, criticalpatterns => [ # hier stehen die Events (die im Eventlog vom Typ Warning oder Error sein koennen) # bei deren Auftauchen sofort gehandelt werden muss, die also Nagios-seitig # als CRITICAL eingestuft werden sollen. 'id:1069 so:ClusSvc .* msg:Cluster Resource .* in Ressourcengruppe .* ist fehlgeschlagen', ], # TODO: Dies ist nur ein Beispiel, wie man ein durch winwarncrit kritisches Event # wieder auf Warning zurueckstufen kann: criticalexceptions => [ 'id:.* so:.* ca:.* msg:.*Faulting application.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack.dll.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack200.exe.*', 'id:.* so:AdsmClientService ca:.* msg:.*', 'id:.* so:Perflib ca:.* msg:.*', 'id:.* so:Userenv ca:.* msg:.*', 'id:0010 so:.* ca:.* msg:.*', 'id:0020 so:OCS_INVENTORY_SERVICE ca:.* msg:.*', 'id:0033 so:SideBySide ca:.* msg:.*', 'id:0050 so:ProIsam ca:.* msg:.*', 'id:0109 so:.* ca:.* msg:.*', 'id:0215 so:.* ca:.* msg:.*', 'id:0502 so:Folder Redirection ca:.* msg:.*', 'id:1000 so:.* ca:.* msg:.*', 'id:1002 so:.* ca:.* msg:.*', 'id:1026 so:.* ca:.* msg:.*', 'id:1306 so:BCAAA ca:.* msg:.*', 'id:1308 so:BCAAA ca:.* msg:.*', 'id:1313 so:BCAAA ca:.* msg:.*', 'id:1325 so:.* ca:.* msg:.*', 'id:1529 so:Microsoft-Windows-User_Profiles_Service ca:.* msg:Roaming user profiles across forests are disabled.*', 'id:4096 so:.* ca:.* msg:.*', 'id:4187 so:mgmtagnt ca:2 msg:.*', ], warningexceptions => [ # die hier aufgeführten Events, sollen nicht weiter beachtet werden. # \ mit \\\ angeben sonst gibt es Fehlermeldungen # '.* .* .* msg:.*\\\Registry\\\User.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack.dll.*', 'id:.* so:.* ca:.* msg:.*Tivoli\\\TSM\\\baclient\\\jvm60\\\jre\\\bin\\\unpack200.exe.*', 'id:.* so:TCLINKLN ca:.* msg:.*', 'id:.* so:TCLINKSC ca:.* msg:.*', 'id:.* so:TCLINKSCT ca:.* msg:.*', 'id:0010 so:.* ca:.* msg:.*', 'id:0020 so:OCS_INVENTORY_SERVICE ca:.* msg:.*', 'id:0033 so:SideBySide ca:.* msg:', 'id:0050 so:ProIsam ca:.* msg:.*', 'id:0502 so:ERA_SERVER ca:.* msg:.*', 'id:0502 so:Folder Redirection ca:.* msg:.*', 'id:1000 so:.* ca:.* msg:.*', 'id:1002 so:.* ca:.* msg:.*', 'id:1026 so:.* ca:.* msg:.*', 'id:1030 so:Userenv ca:.* msg:.*', 'id:1055 so:Userenv ca:.* msg:.*', 'id:1058 so:Userenv ca:.* msg:.*', 'id:1109 so:Userenv ca:.* msg:.*', 'id:11312 so:FSPeripheryApplication ca:.* msg:.*', 'id:1306 so:BCAAA ca:.* msg:.*', 'id:1309 so:ASP.Net_xxx ca:.* msg:.*', 'id:1313 so:BCAAA ca:.* msg:.*', 'id:1325 so:.* ca:.* msg:.*', 'id:1516 so:Userenv ca:.* msg:.*', 'id:1517 so:Userenv ca:.* msg:.*', 'id:1524 so:Userenv ca:.* msg:.*', 'id:1529 so:Microsoft-Windows-User_Profiles_Service ca:.* msg:Roaming user profiles across forests are disabled.*', 'id:1529 so:Userenv ca:.* msg:.*', 'id:1530 so:User Profile Service ca:.* msg:.*', 'id:16022 so:TCOSS ca:.* msg:.*', 'id:2003 so:Perflib ca:.* msg:.*', 'id:4096 so:Server_Intelligence_Agent ca:.* msg:.*', 'id:4097 so:AdsmClientService ca:.* msg:.*', 'id:4099 so:AdsmClientService ca:.* msg:.*', 'id:4100 so:AdsmClientService ca:.* msg:.*', 'id:4101 so:AdsmClientService ca:.* msg:.*', 'id:4103 so:AdsmClientService ca:.* msg:.*', 'id:4187 so:mgmtagnt ca:2 msg:.*', ], # saemtliche anderen Events (auch solche, die noch niemals vorgekommen sind) # erscheinen in Nagios als WARNING. warningpatterns => [ '.*', ], },); sub reformat_output{ (my $out = $ENV{CHECK_LOGFILES_SERVICEOUTPUT}) =~ s/.*id:(.*)?so:(.*)?/ID:$1 SO:$2/; print $out; return $ENV{CHECK_LOGFILES_SERVICESTATEID}; } $options = 'report=long'; EOCFG my $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; open CCC, ">./etc/check_critfirst.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_critfirst.cfg" }); my $critfirst = $cl->get_search_by_tag("critfirst"); $critfirst->delete_logfile(); $critfirst->delete_seekfile(); $critfirst->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $critfirst->trace(sprintf "+----------------------- test %d ------------------", 1); $critfirst->logger(undef, undef, 2, "Failed password for invalid user1..."); sleep 2; $critfirst->loggercrap(undef, undef, 100); sleep 1; $critfirst->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $critfirst->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); #$critfirst->loggercrap(undef, undef, 10); $critfirst->logger(undef, undef, 2, "EE_WW_TTid:1111 so:test msg:WinWarn"); $critfirst->logger(undef, undef, 2, "EE_CC_TTid:2222 so:test msg:WinCrit"); $critfirst->logger(undef, undef, 2, "EE_CC_TTid:1069 so:ClusSvc alarm msg:Cluster Resource CL1 in Ressourcengruppe CL ist fehlgeschlagen"); $critfirst->logger(undef, undef, 2, "EE_WW_TTid:1111 so:test msg:WinWarn"); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{long_exitmessage}); ok($cl->expect_result(0, 6, 2, 0, 2)); check_logfiles-4.1.1/t/002cryornot.t0000664000175000017500000002146114336703157014147 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/002cryornot.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 16; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ options => "perfdata", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "perfdata" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $cl->reset(); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # init $ssh->trace("initial run"); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find an error $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now the logfile disappeared, resulting in UNKNOWN $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); $ssh->delete_logfile(); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 1, 3)); $cl = Nagios::CheckLogfiles::Test->new({ options => "perfdata", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "nologfilenocry,perfdata" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->reset(); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # init $ssh->trace("initial run"); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find an error $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now the logfile disappeared but we don't care $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); $ssh->delete_logfile(); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl = Nagios::CheckLogfiles::Test->new({ options => "perfdata", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "logfilemissing=warning,perfdata" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->reset(); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # init $ssh->trace("initial run"); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find an error $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now the logfile disappeared and we do care. $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); $ssh->delete_logfile(); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 1, 0, 0, 1)); $cl = Nagios::CheckLogfiles::Test->new({ options => "perfdata", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "logfilemissing=critical,perfdata" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->reset(); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # init $ssh->trace("initial run"); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find an error $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now the logfile disappeared and we do care. $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); $ssh->delete_logfile(); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 1, 0, 2)); $cl = Nagios::CheckLogfiles::Test->new({ options => "perfdata", protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "logfilemissing=ok,perfdata" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->reset(); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # init $ssh->trace("initial run"); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find an error $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); # now the logfile disappeared and we do care. $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); $ssh->delete_logfile(); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(1, 0, 0, 0, 0)); # now find another error $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); #$ssh->loggercrap(undef, undef, 100); diag(`/bin/ls -li $ssh->{logfile}`); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); diag($cl->{perfdata}); ok($cl->expect_result(0, 0, 2, 0, 2)); check_logfiles-4.1.1/t/var/0000755000175000017500000000000014336702315012516 500000000000000check_logfiles-4.1.1/t/var/adm/0000755000175000017500000000000014336703157013264 500000000000000check_logfiles-4.1.1/t/var/adm/messages0000664000175000017500000042234214336703157014747 00000000000000Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:12 localhost check_logfiles[2002522] connection refused Nov 21 15:02:13 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:13 localhost check_logfiles[2002522] connection refused Nov 21 15:02:13 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:13 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:02:13 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:02:13 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:13 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:13 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:13 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:14 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:14 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:14 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:14 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:14 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:14 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:14 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:14 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:14 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:14 localhost check_logfiles[2002522] connection refused Nov 21 15:02:14 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:14 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:14 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:14 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:14 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:14 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:14 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:15 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:15 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:15 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:15 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:15 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:15 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:15 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:15 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:15 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:15 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:15 localhost check_logfiles[2002522] connection refused Nov 21 15:02:15 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:15 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:15 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:15 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:15 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:15 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:15 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:15 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:02:15 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:02:15 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:16 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:16 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:16 localhost check_logfiles[2002522] connection refused Nov 21 15:02:16 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:16 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:17 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:17 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:17 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:02:17 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:17 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:17 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:17 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:02:17 localhost check_logfiles[2002522] connection refused Nov 21 15:02:17 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:17 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:17 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:17 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:18 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:18 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:18 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:18 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:18 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:18 localhost check_logfiles[2002522] connection refused Nov 21 15:02:18 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:18 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:18 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:19 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:19 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:19 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:19 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:19 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:19 localhost check_logfiles[2002522] connection refused Nov 21 15:02:19 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:20 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:02:20 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:20 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:20 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:20 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:20 localhost check_logfiles[2002522] connection refused Nov 21 15:02:20 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:20 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:20 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:20 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:20 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:02:20 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:20 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:21 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:21 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:21 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:21 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:21 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:21 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:21 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:21 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:21 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:21 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:21 localhost check_logfiles[2002522] connection refused Nov 21 15:02:21 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:21 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:21 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:21 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:21 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:21 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:22 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:22 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:22 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:22 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:22 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:02:22 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:22 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:22 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:22 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:02:22 localhost check_logfiles[2002522] connection refused Nov 21 15:02:22 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:02:23 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:23 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:23 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:23 localhost check_logfiles[2002522] connection refused Nov 21 15:02:23 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:02:23 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:23 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:24 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:02:24 localhost check_logfiles[2002522] connection refused Nov 21 15:02:24 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:24 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:25 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:25 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:25 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:25 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:02:25 localhost check_logfiles[2002522] connection refused Nov 21 15:02:25 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:26 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:02:26 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:26 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:26 localhost check_logfiles[2002522] connection refused Nov 21 15:02:26 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:26 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:26 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:26 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:26 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:26 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:26 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:26 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:26 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:02:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:27 localhost check_logfiles[2002522] connection refused Nov 21 15:02:27 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:28 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:02:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:28 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:02:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:28 localhost check_logfiles[2002522] connection refused Nov 21 15:02:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:28 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:02:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:28 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:02:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:28 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:28 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:29 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:29 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:29 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:29 localhost check_logfiles[2002522] connection refused Nov 21 15:02:29 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:29 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:29 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:02:29 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:29 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:29 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:29 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:30 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:30 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:30 localhost check_logfiles[2002522] connection refused Nov 21 15:02:30 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:30 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:30 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:02:30 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:30 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:30 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:30 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:31 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:31 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:31 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:31 localhost check_logfiles[2002522] connection refused Nov 21 15:02:31 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:31 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:31 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:32 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:02:32 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:32 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:32 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:32 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:32 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:32 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:32 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:02:32 localhost check_logfiles[2002522] connection refused Nov 21 15:02:32 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:32 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:32 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:33 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:33 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:33 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:33 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:33 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:34 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:34 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:34 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:35 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:35 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:35 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:35 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:36 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:37 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:02:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:38 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:38 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:38 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:38 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:38 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:38 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:38 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:38 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:38 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:39 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:39 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:39 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:39 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:40 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:40 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:40 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:40 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:40 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:40 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:40 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:40 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:40 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:41 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:41 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:41 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:41 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:41 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:41 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:42 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:42 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:42 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:42 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:42 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:42 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:42 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:43 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:02:43 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:43 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:43 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:43 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:43 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:43 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:43 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:44 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:45 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:45 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:45 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:46 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:46 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:46 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:47 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:47 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:47 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:47 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:47 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:47 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:47 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:47 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:47 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:48 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:48 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:48 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:49 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:49 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:49 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:02:49 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:02:49 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:49 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:02:50 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:02:51 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:02:52 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:52 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:52 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:02:52 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:52 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:52 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:53 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:53 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:02:53 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:02:53 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:53 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:54 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:02:54 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:54 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:54 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:54 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:55 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:02:55 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:55 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:55 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:55 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:55 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:02:55 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:55 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:55 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:56 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:56 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:56 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:56 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:57 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:57 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:02:57 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:57 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:58 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:02:58 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:02:58 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:02:58 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:02:58 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:02:58 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:02:59 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:59 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:02:59 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:02:59 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:02:59 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:00 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:00 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:00 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:00 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:00 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:01 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:01 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:01 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:01 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:01 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:02 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:02 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:02 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:03:02 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:02 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:02 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:02 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:02 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:03:02 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:02 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:03 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:03 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:03 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:03 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:03 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:04 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:04 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:04 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:04 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:04 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:04 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:04 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:04 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:04 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:03:04 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:05 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:05 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:06 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:06 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:06 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:06 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:06 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:06 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:06 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:06 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:06 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:06 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:07 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:03:08 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:08 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:08 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:09 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:09 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:03:09 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:09 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:09 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:09 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:03:09 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:10 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:10 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:10 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:11 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:11 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:11 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:11 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:11 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:11 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:11 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:11 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:12 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:12 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:12 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:12 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:12 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:13 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:13 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:03:13 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:13 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:13 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:03:13 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:13 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:13 localhost check_logfiles[2002522] connection refused Nov 21 15:03:14 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:14 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:14 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:14 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:14 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:14 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:14 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:14 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:14 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:03:14 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:03:14 localhost check_logfiles[2002522] connection refused Nov 21 15:03:15 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:15 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:15 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:15 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:15 localhost check_logfiles[2002522] connection refused Nov 21 15:03:16 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:16 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:16 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:16 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:16 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:16 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:16 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:17 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:18 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:18 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:18 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:18 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:18 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:18 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:18 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:18 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:19 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:19 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:19 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:19 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:19 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:20 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:20 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:20 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:03:20 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:20 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:21 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:22 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:22 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:22 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:03:22 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:22 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:22 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:23 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:23 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:03:23 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:23 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:23 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:23 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:23 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:23 localhost check_logfiles[2002522] connection refused Nov 21 15:03:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:24 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:03:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:24 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:03:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:24 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:24 localhost check_logfiles[2002522] connection refused Nov 21 15:03:25 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:03:25 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:25 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:25 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:03:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:25 localhost check_logfiles[2002522] connection refused Nov 21 15:03:26 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:26 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:26 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:03:26 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:26 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:26 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:03:26 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:03:26 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:26 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:03:26 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:27 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:27 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:28 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:28 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:28 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:28 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:03:29 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:29 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:29 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:30 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:30 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:30 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:03:31 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:31 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:03:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:31 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:31 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:31 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:31 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:03:32 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:32 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:33 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:33 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:33 localhost check_logfiles[2002522] connection refused Nov 21 15:03:34 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:34 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:34 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:34 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:34 localhost check_logfiles[2002522] connection refused Nov 21 15:03:35 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:35 localhost check_logfiles[2002522] connection refused Nov 21 15:03:36 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:36 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:36 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:36 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:03:36 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:37 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:37 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:03:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:37 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:03:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:38 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:38 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:38 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:03:38 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:38 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:03:38 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:38 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:39 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:39 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:39 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:39 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:39 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:39 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:39 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:39 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:39 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:40 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:40 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:40 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:40 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:03:41 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:41 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:41 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:42 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:42 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:43 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:43 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:43 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:43 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:43 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:43 localhost check_logfiles[2002522] connection refused Nov 21 15:03:44 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:44 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:44 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:44 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:44 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:44 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:44 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:44 localhost check_logfiles[2002522] connection refused Nov 21 15:03:45 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:45 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:45 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:45 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:45 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:45 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:03:45 localhost check_logfiles[2002522] connection refused Nov 21 15:03:46 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:46 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:46 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:47 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:47 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:47 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:03:47 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:47 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:47 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:03:47 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:48 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:49 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:49 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:49 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:49 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:49 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:50 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:03:50 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:03:50 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:51 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:51 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:52 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:52 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:03:52 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:52 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:52 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:52 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:52 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:52 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:52 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:52 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:53 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:53 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:53 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:53 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:03:53 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:53 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:53 localhost check_logfiles[2002522] connection refused Nov 21 15:03:54 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:54 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:54 localhost check_logfiles[2002522] connection refused Nov 21 15:03:55 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:03:55 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:55 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:55 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:03:55 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:03:55 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:55 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:03:55 localhost check_logfiles[2002522] connection refused Nov 21 15:03:56 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:56 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:03:56 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:56 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:03:56 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:56 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:57 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:03:57 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:03:57 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:03:57 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:57 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:57 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:03:58 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:03:58 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:03:58 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:03:58 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:03:58 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:03:58 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:03:59 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:03:59 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:00 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:01 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:01 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:01 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:01 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:04:01 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:04:02 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:04:02 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:02 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:02 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:03 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:04:03 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:03 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:03 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:03 localhost check_logfiles[2002522] connection refused Nov 21 15:04:04 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:04 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:04 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:04 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:04 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:04:04 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:04 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:04 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:04 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:04 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:04 localhost check_logfiles[2002522] connection refused Nov 21 15:04:05 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:05 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:05 localhost check_logfiles[2002522] connection refused Nov 21 15:04:06 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:06 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:04:06 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:07 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:07 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:07 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:07 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:07 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:08 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:08 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:08 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:08 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:08 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:08 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:08 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:08 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:08 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:08 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:09 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:10 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:11 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:11 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:04:11 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:11 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:11 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:11 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:11 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:11 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:04:11 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:11 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:12 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:12 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:12 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:12 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:12 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:12 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:12 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:13 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:13 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:13 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:13 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:04:13 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:13 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:13 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:04:13 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:13 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:13 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:13 localhost check_logfiles[2002522] connection refused Nov 21 15:04:14 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:14 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:14 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:14 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:14 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:14 localhost check_logfiles[2002522] connection refused Nov 21 15:04:15 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:04:15 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:15 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:15 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:15 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:04:15 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:04:15 localhost check_logfiles[2002522] connection refused Nov 21 15:04:16 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:16 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:16 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:04:16 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:16 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:16 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:04:16 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:16 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:16 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:16 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:17 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:17 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:18 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:18 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:04:18 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:18 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:04:18 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:18 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:18 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:18 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:18 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:18 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:19 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:19 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:19 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:04:19 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:04:19 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:19 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:19 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:19 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:19 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:04:19 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:20 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:20 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:20 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:20 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:20 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:04:21 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:21 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:21 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:21 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:22 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:22 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:04:22 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:22 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:22 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:22 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:23 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:23 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:23 localhost check_logfiles[2002522] connection refused Nov 21 15:04:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:24 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:24 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:24 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:24 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:24 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:24 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:24 localhost check_logfiles[2002522] connection refused Nov 21 15:04:25 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:04:25 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:25 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:25 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:04:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:25 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:25 localhost check_logfiles[2002522] connection refused Nov 21 15:04:26 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:26 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:27 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:27 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:27 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:28 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:28 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:28 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:29 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:04:29 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:04:29 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:29 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:29 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:29 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:04:29 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:29 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:29 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:04:30 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:31 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:31 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:32 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:32 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:32 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:33 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:04:33 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:33 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:33 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:33 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:33 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:33 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:33 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:33 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:33 localhost check_logfiles[2002522] connection refused Nov 21 15:04:34 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:34 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:34 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:34 localhost check_logfiles[2002522] connection refused Nov 21 15:04:35 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:35 localhost check_logfiles[2002522] connection refused Nov 21 15:04:36 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:37 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:37 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:37 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:04:38 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:38 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:38 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:38 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:38 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:38 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:38 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:38 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:38 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:38 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:39 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:39 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:04:39 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:39 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:39 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:39 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:39 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:39 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:04:39 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:39 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:40 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:40 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:40 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:40 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:40 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:40 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:40 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:40 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:40 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:41 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:41 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:41 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:41 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:41 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:41 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:41 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:41 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:42 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:42 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:42 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:04:42 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:42 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:42 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:43 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:43 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:43 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:43 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:04:43 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:04:43 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:43 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:43 localhost check_logfiles[2002522] connection refused Nov 21 15:04:44 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:44 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:44 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:44 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:44 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:44 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:04:44 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:44 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:44 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:44 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:44 localhost check_logfiles[2002522] connection refused Nov 21 15:04:45 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:45 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:45 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:45 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:45 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:45 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:45 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:45 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:45 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:04:45 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:45 localhost check_logfiles[2002522] connection refused Nov 21 15:04:46 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:46 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:46 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:46 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:04:46 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:46 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:46 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:46 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:04:46 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:46 localhost check_logfiles[2002522] last message repeated 1 time Nov 21 15:04:47 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:48 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:04:48 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:49 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:04:50 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:04:50 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:04:50 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:04:50 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:04:51 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:04:51 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:04:51 localhost check_logfiles[2002522] -- MARK -- Nov 21 15:04:51 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:04:51 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:04:51 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:51 localhost check_logfiles[2002522] last message repeated 100 times Nov 21 15:04:51 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:51 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:51 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:04:52 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:04:52 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:52 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:52 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:04:52 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:52 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:04:52 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:04:52 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:04:52 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 check_logfiles-4.1.1/t/var/adm/messages.00000664000175000017500000006314214336703157015104 00000000000000Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:01:37 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:01:37 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:01:37 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:01:37 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:37 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:01:37 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:37 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:37 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 15:01:37 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 15:01:37 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 15:01:37 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:37 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:37 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:37 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:37 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 15:01:38 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:38 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:38 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:38 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 15:01:38 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 15:01:38 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:38 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 15:01:38 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:38 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:38 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 15:01:38 localhost check_logfiles[2002334] last message repeated 100 times Nov 21 15:01:38 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 15:01:38 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:38 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 15:01:38 localhost check_logfiles[2002334] last message repeated 1 time Nov 21 15:01:38 localhost check_logfiles[2002334] Failed password for invalid user8 Nov 21 15:01:38 localhost check_logfiles[2002334] Failed password for invalid user8 Nov 21 15:01:38 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:38 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 15:01:39 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 15:01:39 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 15:01:39 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 15:01:39 localhost check_logfiles[2002334] -- MARK -- Nov 21 15:01:39 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument check_logfiles-4.1.1/t/var/rot/0000775000175000017500000000000014336677244013340 500000000000000check_logfiles-4.1.1/t/var/rot/201006/0000775000175000017500000000000014336703157014061 500000000000000check_logfiles-4.1.1/t/var/rot/201006/2010060100.log0000664000175000017500000000362314336703157015541 00000000000000Nov 21 14:35:32 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:32 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:32 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:32 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:32 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:32 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:32 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:32 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:32 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:32 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:32 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 14:35:32 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 14:35:32 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:32 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:32 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:32 localhost in.fingerd connect from xxx1@umbc9.umbc.edu check_logfiles-4.1.1/t/var/rot/201005/0000775000175000017500000000000014336703157014060 500000000000000check_logfiles-4.1.1/t/var/rot/201005/2010053115.log0000664000175000017500000000436614336703157015555 00000000000000Nov 21 14:35:29 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:29 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:29 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:29 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:29 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:29 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:29 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:29 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:29 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:29 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:29 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:29 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:29 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:29 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:29 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:29 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 check_logfiles-4.1.1/t/var/rot/201005/2010053122.log0000664000175000017500000002233514336703157015547 00000000000000Nov 21 14:35:30 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:30 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:30 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:30 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 14:35:30 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:30 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:30 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 14:35:30 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:30 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:30 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:30 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:30 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:30 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:30 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:30 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:30 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:30 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:30 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:30 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:30 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:30 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:30 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:30 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:30 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:30 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:30 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:30 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:30 localhost sshd Invalid user delta from 194.44.247.243 Nov 21 14:35:30 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:30 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:30 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:30 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:30 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:30 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:30 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:30 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:30 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:30 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:30 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:30 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 check_logfiles-4.1.1/t/var/rot/201005/2010053112.log0000664000175000017500000002740514336703157015551 00000000000000Nov 21 14:35:23 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:23 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:23 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:23 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:23 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:23 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:23 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:23 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:23 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:23 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:23 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:23 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:23 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 14:35:23 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:23 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 14:35:23 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:23 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:23 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:23 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:23 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:23 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:23 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:23 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:23 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:23 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 14:35:23 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:23 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:24 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:24 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:24 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:24 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:24 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:24 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:24 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 14:35:24 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:24 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 14:35:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:24 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:24 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:24 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:24 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:24 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:24 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:24 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:24 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:24 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 14:35:24 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:24 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:24 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:24 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:24 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:24 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 14:35:24 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:24 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:24 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:24 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:24 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:24 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:24 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:24 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:24 localhost in.fingerd connect from xxx1@umbc9.umbc.edu check_logfiles-4.1.1/t/var/rot/201005/2010053113.log0000664000175000017500000001464014336703157015547 00000000000000Nov 21 14:35:25 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:25 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:25 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:25 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:25 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:25 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:25 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 14:35:25 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:25 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:25 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:25 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:25 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:25 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 14:35:25 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:25 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:25 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:25 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:25 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:25 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:25 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:25 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:25 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:25 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:25 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:25 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:25 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:25 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:25 localhost sshd Invalid user tester from 194.44.247.243 Nov 21 14:35:25 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 14:35:25 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:25 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:25 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:25 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:25 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:25 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:26 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:26 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:26 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:26 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:26 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:26 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:26 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:26 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:26 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:26 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:26 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:26 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:26 localhost check_logfiles[1989120] last message repeated 100 times check_logfiles-4.1.1/t/var/rot/201005/2010053123.log0000664000175000017500000002213614336703157015547 00000000000000Nov 21 14:35:31 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:31 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:31 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:31 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:31 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:31 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:31 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:31 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:31 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:31 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 14:35:31 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 14:35:31 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:31 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:31 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:31 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:31 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:31 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:31 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:31 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:31 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:31 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:31 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:31 localhost sshd [ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2 Nov 21 14:35:31 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:31 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:31 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:31 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:31 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:31 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:31 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:31 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:31 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:31 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:31 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:31 localhost check_logfiles[1989120] last message repeated 100 times check_logfiles-4.1.1/t/var/rot/201005/2010053114.log0000664000175000017500000005113214336703157015545 00000000000000Nov 21 14:35:27 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:27 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:27 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:27 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:27 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:27 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:27 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 14:35:27 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:27 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:27 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:27 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:27 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:27 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:27 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:27 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:27 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:27 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:27 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:27 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:27 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:27 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:27 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:27 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:27 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:27 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:27 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost sshd [ID 800047 auth.info] Connection closed by 160.21.33.116 Nov 21 14:35:27 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:27 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:27 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:27 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:27 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:27 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:27 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 14:35:27 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:27 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:27 localhost sshd [ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d Nov 21 14:35:28 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:28 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:28 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:28 localhost check_logfiles[1989120] Failed password for invalid user1 Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:28 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:28 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:28 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:28 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:28 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:28 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:28 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:28 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:28 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost sam-arcopy [ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml Nov 21 14:35:28 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:28 localhost sshd Failed none for hiasl from 192.168.9.11 port 4250 ssh2 Nov 21 14:35:28 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 Nov 21 14:35:28 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost sshd [ID 800047 auth.info] subsystem request for sftp Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 100 times Nov 21 14:35:28 localhost sshd [ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2 Nov 21 14:35:28 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost sshd [ID 800047 auth.info] Generating new 768 bit RSA key. Nov 21 14:35:28 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:28 localhost inetd registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006 Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:28 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:28 localhost sshd [ID 800047 auth.info] RSA key generation complete. Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none Nov 21 14:35:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:28 localhost check_logfiles[1989120] last message repeated 1 time Nov 21 14:35:28 localhost sam-arcopy [ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19TÜ/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline Nov 21 14:35:28 localhost sam-arcopy [ID 475690 local7.info] info OS call error: open failed: sa.912518 Nov 21 14:35:28 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:28 localhost devfsadm [ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument Nov 21 14:35:28 localhost inetd shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006 Nov 21 14:35:28 localhost check_logfiles[1989120] -- MARK -- Nov 21 14:35:28 localhost scsi [ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200 Nov 21 14:35:28 localhost in.fingerd connect from xxx1@umbc9.umbc.edu Nov 21 14:35:28 localhost scsi [ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0 Nov 21 14:35:28 localhost mpxio [ID 669396 kern.info] /scsi_vhci/ssd@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci@1d,700000/SUNW,qlc@2/fp@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none Nov 21 14:35:28 localhost inetd auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006 check_logfiles-4.1.1/t/var/tmp/0000775000175000017500000000000014336703157013325 500000000000000check_logfiles-4.1.1/t/var/tmp/check_flood.._var_adm_messages.flood0000664000175000017500000000213414336703157022246 00000000000000$state = { 'tag' => 'flood', 'servicestateid' => 2, 'privatestate' => { 'runcount' => 3, 'eventhistory' => [ 1669039463, 1669039465, 1669039474, 1669039483, 1669039485 ], 'lastruntime' => 1669039393, 'logfile' => './var/adm/messages', 'matchingpattern' => 'connection refused' }, 'logfile' => './var/adm/messages', 'devino' => '2064:330717', 'runtime' => 1669039493, 'logoffset' => 140514, 'serviceoutput' => 'floot reached 1.000 at Mon Nov 21 15:02:22 2022', 'runcount' => 3, 'logtime' => 1669039492 }; 1; check_logfiles-4.1.1/t/var/tmp/check_logfiles.._var_adm_messages.rulzn0000664000175000017500000000131514336703157023016 00000000000000$state = { 'servicestateid' => 2, 'serviceoutput' => 'Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password for invalid user ruhland', 'runtime' => 1669039276, 'logoffset' => 32422, 'devino' => '2064:133667', 'runcount' => 3, 'privatestate' => { 'matchingpattern' => 'Failed password for invalid user ruhland', 'logfile' => './var/adm/messages', 'lastruntime' => 1669039275, 'runcount' => 3 }, 'tag' => 'rulzn', 'logtime' => 1669039276 }; 1; check_logfiles-4.1.1/t/var/tmp/check_logfiles.protocol-2022-11-21-15-01-350000664000175000017500000000115214336703157021700 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:01:38 localhost check_logfiles[2002334] Failed password for invalid user8 Nov 21 15:01:38 localhost check_logfiles[2002334] Failed password for invalid user8 CRITICAL Errors in messages (tag ssh) Nov 21 15:01:40 localhost check_logfiles[2002334] Failed password for invalid user8 Nov 21 15:01:40 localhost check_logfiles[2002334] Failed password for invalid user8 CRITICAL Errors in messages (tag ssh) Nov 21 15:01:42 localhost check_logfiles[2002334] Failed password for invalid user8 Nov 21 15:01:42 localhost check_logfiles[2002334] Failed password for invalid user8 check_logfiles-4.1.1/t/var/tmp/check_logfiles.protocol-2022-11-21-15-01-160000664000175000017500000000167514336703157021711 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password for invalid user18 Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password for invalid user18 Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password for invalid user18 CRITICAL Errors in messages (tag rulzn) Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password for invalid user ruhland Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password for invalid user ruhland Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password for invalid user ruhland CRITICAL Errors in messages (tag null) Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password is nonsense Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password is nonsense Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password is nonsense Nov 21 15:01:16 localhost check_logfiles[2002291] Failed password is nonsense check_logfiles-4.1.1/t/var/tmp/check_logfiles.protocol-2022-11-21-15-01-130000664000175000017500000000062314336703157021676 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:01:15 localhost check_logfiles[2002291] Failed password for invalid user18 Nov 21 15:01:15 localhost check_logfiles[2002291] Failed password for invalid user18 CRITICAL Errors in messages (tag null) Nov 21 15:01:15 localhost check_logfiles[2002291] Failed password is nonsense Nov 21 15:01:15 localhost check_logfiles[2002291] Failed password is nonsense check_logfiles-4.1.1/t/var/tmp/check_logfiles.protocol-2022-11-21-15-01-490000664000175000017500000000070314336703157021706 00000000000000CRITICAL Errors in messages (tag goasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassgoasmassschoasmassschoasmassschoasmassschoasmass) Nov 21 15:01:50 localhost check_logfiles[2002347] Failed password for invalid user2 Nov 21 15:01:50 localhost check_logfiles[2002347] Failed password for invalid user2 check_logfiles-4.1.1/t/var/tmp/check_logfiles.._var_adm_messages.null0000664000175000017500000000124314336703157022616 00000000000000$state = { 'serviceoutput' => 'Nov 21 15:01:26 localhost check_logfiles[2002291] Failed password is nonsense', 'logoffset' => 63271, 'runtime' => 1669039286, 'logtime' => 1669039286, 'runcount' => 4, 'devino' => '2064:133667', 'privatestate' => { 'matchingpattern' => '.*nonsense.*', 'lastruntime' => 1669039276, 'logfile' => './var/adm/messages', 'runcount' => 4 }, 'tag' => 'null', 'servicestateid' => 2 }; 1; check_logfiles-4.1.1/t/var/tmp/check_action.protocol-2022-11-21-15-01-420000664000175000017500000000057314336703157021355 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:01:43 localhost check_logfiles[2002340] Failed password for invalid user4 Nov 21 15:01:43 localhost check_logfiles[2002340] Failed password for invalid user4 WARNING Errors in messages (tag ssh) Nov 21 15:01:43 localhost check_logfiles[2002340] Unknown user sepp Nov 21 15:01:43 localhost check_logfiles[2002340] Unknown user sepp check_logfiles-4.1.1/t/var/tmp/check_logfiles.protocol-2022-11-21-15-01-510000664000175000017500000000032414336703157021676 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:01:55 localhost check_logfiles[2002351] Failed password for invalid user2... Nov 21 15:01:55 localhost check_logfiles[2002351] Failed password for invalid user2... check_logfiles-4.1.1/t/var/tmp/check_logfiles.protocol-2022-11-21-15-01-280000664000175000017500000000063414336703157021706 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:01:31 localhost check_logfiles[2002334] Failed password for invalid user8 Nov 21 15:01:31 localhost check_logfiles[2002334] Failed password for invalid user8 CRITICAL Errors in messages (tag ssh) Nov 21 15:01:33 localhost check_logfiles[2002334] Failed password for invalid user8 Nov 21 15:01:33 localhost check_logfiles[2002334] Failed password for invalid user8 check_logfiles-4.1.1/t/var/tmp/flatfile.protocol-2022-11-21-15-02-050000664000175000017500000000032414336703157020523 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:02:09 localhost check_logfiles[2002351] Failed password for invalid user2... Nov 21 15:02:09 localhost check_logfiles[2002351] Failed password for invalid user2... check_logfiles-4.1.1/t/var/tmp/check_logfiles.protocol-2022-11-21-15-01-260000664000175000017500000000112014336703157021673 00000000000000CRITICAL Errors in messages (tag null) Nov 21 15:01:26 localhost check_logfiles[2002291] Failed password is nonsense Nov 21 15:01:26 localhost check_logfiles[2002291] Failed password is nonsense Nov 21 15:01:26 localhost check_logfiles[2002291] Failed password is nonsense Nov 21 15:01:26 localhost check_logfiles[2002291] Failed password is nonsense WARNING Errors in messages (tag ssh) Nov 21 15:01:26 localhost check_logfiles[2002291] Unknown user oash Nov 21 15:01:26 localhost check_logfiles[2002291] Unknown user oash Nov 21 15:01:26 localhost check_logfiles[2002291] Unknown user oash check_logfiles-4.1.1/t/var/tmp/check_action.._var_adm_messages.unique0000664000175000017500000000113214336703157022620 00000000000000$state = { 'logoffset' => 63271, 'servicestateid' => 0, 'runtime' => 1669039287, 'tag' => 'unique', 'logtime' => 0, 'privatestate' => { 'runcount' => 2, 'lastruntime' => 1669039286, 'logfile' => './var/adm/messages' }, 'logfile' => './var/adm/messages', 'thresholdcnt' => {}, 'runcount' => 2, 'serviceoutput' => '', 'devino' => '2064:133667' }; 1; check_logfiles-4.1.1/t/var/tmp/check_action.._var_adm_messages.smart0000664000175000017500000000135214336703157022444 00000000000000$state = { 'serviceoutput' => '3:pat1(pat1 blub pat2kaas)pat2(pat1)pat3(pat2kaas)', 'devino' => '2064:330417', 'thresholdcnt' => {}, 'runcount' => 3, 'runtime' => 1669039309, 'servicestateid' => 2, 'privatestate' => { 'logfile' => './var/adm/messages', 'runcount' => 3, 'matchingpattern' => 'bla ((pat1) blub (pat2.*)) bla', 'lastruntime' => 1669039308 }, 'logoffset' => 10768, 'tag' => 'smart', 'logtime' => 1669039308, 'logfile' => './var/adm/messages' }; 1; check_logfiles-4.1.1/t/var/tmp/check_action.protocol-2022-11-21-15-01-580000664000175000017500000000032414336703157021356 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:02:02 localhost check_logfiles[2002351] Failed password for invalid user2... Nov 21 15:02:02 localhost check_logfiles[2002351] Failed password for invalid user2... check_logfiles-4.1.1/t/var/tmp/check_action.protocol-2022-11-21-15-01-450000664000175000017500000000057314336703157021360 00000000000000CRITICAL Errors in messages (tag ssh) Nov 21 15:01:46 localhost check_logfiles[2002340] Failed password for invalid user4 Nov 21 15:01:46 localhost check_logfiles[2002340] Failed password for invalid user4 WARNING Errors in messages (tag ssh) Nov 21 15:01:46 localhost check_logfiles[2002340] Unknown user sepp Nov 21 15:01:46 localhost check_logfiles[2002340] Unknown user sepp check_logfiles-4.1.1/t/var/tmp/check_flood.protocol-2022-11-21-15-02-110000664000175000017500000000106014336703157021170 00000000000000CRITICAL Errors in messages (tag flood) floot reached 5.000 at Mon Nov 21 15:02:18 2022 floot reached 4.000 at Mon Nov 21 15:02:19 2022 floot reached 3.000 at Mon Nov 21 15:02:20 2022 floot reached 2.000 at Mon Nov 21 15:02:21 2022 floot reached 1.000 at Mon Nov 21 15:02:22 2022 CRITICAL Errors in messages (tag flood) floot reached 5.000 at Mon Nov 21 15:02:18 2022 floot reached 4.000 at Mon Nov 21 15:02:19 2022 floot reached 3.000 at Mon Nov 21 15:02:20 2022 floot reached 2.000 at Mon Nov 21 15:02:21 2022 floot reached 1.000 at Mon Nov 21 15:02:22 2022 check_logfiles-4.1.1/t/002nologfile.t0000664000175000017500000000341014336703157014240 00000000000000#!/usr/bin/perl -w # use strict; use Test::More tests => 5; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; ######################################################## # now with nologfilenocry # my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", options => "nologfilenocry,sticky=4,allyoucaneat" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $cl->reset(); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $ssh->logger(undef, undef, 2, "bla"); $cl->trace("now run 1"); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $ssh->logger(undef, undef, 2, "Failed password"); $cl->trace("now run 2"); $cl->reset(); $cl->run(); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); diag($ssh->{seekfile}); $cl->trace("now run 3"); diag("now run 3"); $cl->reset(); $cl->run(); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); $ssh->logger(undef, undef, 2, "bla"); sleep 5; $ssh->trace("should be unsticked now"); $cl->reset(); $cl->run(); ok($cl->expect_result(0, 0, 0, 0, 0)); delete $ssh->{newstate}->{logtime}; $ssh->delete_logfile(); $cl->reset(); $cl->run(); printf STDERR "%s\n", Data::Dumper::Dumper($ssh->{newstate}); diag(`/bin/ls -li $ssh->{logfile}`); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); check_logfiles-4.1.1/t/040eventlog.t0000664000175000017500000001017714336703157014117 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/040eventlog.t # # Test that all the Perl modules we require are available. # use strict; use Test::More; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; use Data::Dumper; if ($^O !~ /MSWin/) { diag("this is not a windows machine"); plan skip_all => 'Test only relevant on Windows'; } elsif ($^O eq "cygwin") { diag("this is a windows machine, but cygwin. this worked in former times, afte r vista you have to use native windows for the tests"); plan skip_all => 'Test only relevant on Windows'; } else { plan tests => 7; } my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", type => "eventlog", criticalpatterns => ["Adobe", "Firewall" ], eventlog => { eventlog => "application", } } ] }); my $ssh = $cl->get_search_by_tag("ssh"); if ($^O !~ /MSWin|cygwin/) { diag("windows only"); foreach (1..7) {ok(1)}; exit 0; } $ssh->delete_seekfile(); $ssh->trace("deleted seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); sleep 2; $ssh->trace("initial run"); $cl->run(); # cleanup diag("1st run"); $cl->reset(); diag("cleanup"); $ssh->logger(undef, undef, 1, "Fireball 1hihi"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); #1 # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); sleep 30; $ssh->logger(undef, undef, 1, "Fireball 2hihi"); $ssh->logger(undef, undef, 1, "Fireball 3hihi"); $ssh->logger(undef, undef, 1, "Firewall problem1"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}.'|'.$cl->{perfdata}); ok($cl->expect_result(0, 0, 0, 0, 0)); #2 # 3 now find the critical (Firewall problem1) $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); sleep 120; $cl->run(); $ssh->logger(undef, undef, 2, "Fireball huhuhuhhihi"); diag($cl->has_result()); diag($cl->{exitmessage}.'|'.$cl->{perfdata}); ok($cl->expect_result(0, 0, 1, 0, 2)); #3 # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 4); $cl->reset(); $ssh->logger(undef, undef, 1, "Firewall problem2"); sleep 20; $ssh->logger(undef, undef, 1, "Firewall problem3"); $ssh->logger(undef, undef, 1, "Fireball hihi"); sleep 10; $ssh->logger(undef, undef, 1, "Firewall problem4"); $ssh->logger(undef, undef, 1, "Fireball hihi"); sleep 10; $ssh->logger(undef, undef, 1, "Firewall problem5"); $ssh->logger(undef, undef, 1, "Fireball hihi"); sleep 10; $ssh->logger(undef, undef, 1, "Firewall problem6"); $ssh->logger(undef, undef, 1, "Fireball hihi"); $ssh->logger(undef, undef, 1, "Firewall problem7"); sleep 10; $cl->run(); diag("now there should be up to 6 criticals"); diag($cl->has_result()); diag($cl->{exitmessage}.'|'.$cl->{perfdata}); #ok($cl->expect_result(0, 0, 6, 0, 2)); $cl->{exitmessage} =~ /.*problem(\d+).*/; my $problem = $1; $cl->{perfdata} =~ /.*'ssh_criticals'=(\d+).*/; my $found = $1; diag(sprintf "reported %d errors so far. %d to come", $found, 6 - $found); ok($cl->{exitmessage} =~ /CRITICAL/); #4 ok($problem == $found + 1); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 5); $cl->reset(); sleep 65; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}.'|'.$cl->{perfdata}); if ($found == 6) { ok($cl->expect_result(0, 0, 0, 0, 0)); } else { ok($cl->expect_result(0, 0, 6 - $found, 0, 2)); } $ssh->trace(sprintf "+----------------------- test %d ------------------", 6); $cl->reset(); $ssh->logger(undef, undef, 1, "Firewall problem2"); $ssh->set_option('eventlogformat', '%w id:%i so:%s ca:%c msg:%m'); sleep 20; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}.'|'.$cl->{perfdata}); ok($cl->{exitmessage} =~ /id:.*so:.*ca:.*/); #6 check_logfiles-4.1.1/t/013marine.t0000664000175000017500000000445614336703157013552 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/001simple.t # # Test that all the Perl modules we require are available. # # vielen Dank für die Info. Mein Problem wäre jetzt in diesem Fall, das sich die Logdateien jeden Tag bzw. jedes mal anders nennen. Einige Logdateien tragen den Namen LOGBUCH20060801230000{b] und andere [B]LOGFILE_200631. Also einmal mit Jahr, Monat, Tag, Stunde, Minute, Sekunde und das andere Logfile mit Jahr, Kalenderwoche. Habe das zur Zeit mit Platzhaltern gelöst. Also wenn ich in einem Skript LOGFILE_JJJJKW stehen habe, wird der Dateiname durch das aktuelle Jahr und die aktuelle Kalenderwoche ersetzt. use strict; use Test::More tests => 2; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my($sec, $min, $hour, $mday, $mon, $year) = (localtime(time -86400))[0, 1, 2, 3, 4, 5]; $year += 1900; $mon += 1; my $sauvegarde = sprintf "sauvegarde%02d-%02d-%04d.log", $mday, $mon, $year; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", macros => { VARDIR => '/var/adm', EVILUSER => 'lausser/2'}, searches => [ { tag => "ssh", logfile => TESTDIR.'$VARDIR$/'.$sauvegarde, criticalpatterns => ["Failed password", 'evil user $EVILUSER$ logged in'], warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. # # BUT!!!! these might be one-shot logfiles. they must be searched from pos 0 # $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); sleep 1; $ssh->trace(sprintf "initial run for file %s", $ssh->{logfile}); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # now find the two criticals $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->logger(undef, undef, 1, "alert! evil user lausser/2 logged in"); $ssh->loggercrap(undef, undef, 100); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 3, 0, 2)); check_logfiles-4.1.1/t/090dupdetect.t0000664000175000017500000000532414336703157014260 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/090dupdetect.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 6; use Cwd; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $configfile = < "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", }); EOCFG open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); ok($cl->{exitmessage} =~ /CRITICAL - \(2 errors, 2 warnings.* - \w{3}\s+\d+ \d{2}:\d{2}:\d{2}.*Failed.*user4/); unlink("./etc/check_action.cfg"); $configfile = < "ssh", logfile => "./var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user", }); EOCFG sleep 1; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; my $cl2 = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); $cl2->set_option("outputhitcount", 0); $ssh = $cl2->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); $cl2->reset(); $ssh->loggercrap(undef, undef, 10); $cl2->run(); diag($cl2->has_result()); diag($cl2->{exitmessage}); ok($cl2->expect_result(0, 0, 0, 0, 0)); $cl2->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user4"); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl2->run(); diag($cl2->has_result()); diag($cl2->{exitmessage}); ok($cl2->expect_result(0, 2, 2, 0, 2)); ok($cl2->{exitmessage} =~ /CRITICAL - \w{3}\s+\d+ \d{2}:\d{2}:\d{2}.*Failed.*user4/); exit; ##### nochmal mit dupdetect ohne zahlen diag($cl2->{exitmessage}); check_logfiles-4.1.1/t/094homevartmp.t0000664000175000017500000002457014336703157014471 00000000000000#!/usr/bin/perl -w # # ~/check_logfiles/test/094homevartmp.t # # Test that all the Perl modules we require are available. # use strict; use Test::More tests => 21; use Cwd; use File::Path; use lib "../plugins-scripts"; use Nagios::CheckLogfiles::Test; use constant TESTDIR => "."; my $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => TESTDIR."/var/tmp", seekfilesdir => TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); my $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; diag("seek ".$ssh->{seekfile}); ok(-f "./var/tmp/check_logfiles.._var_adm_messages.ssh"); $ENV{OMD_ROOT} = "./omd_root"; unlink "./omd_root/var/tmp/check_logfiles/check_logfiles.._var_adm_messages.ssh" if -f "./omd_root/var/tmp/check_logfiles/check_logfiles.._var_adm_messages.ssh"; # neues seekfile loeschen, damit die migration stattfindet. $cl = Nagios::CheckLogfiles::Test->new({ protocolsdir => "homevartmp:".TESTDIR."/var/tmp", seekfilesdir => "homevartmp:".TESTDIR."/var/tmp", searches => [ { tag => "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ] }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); diag("seek ".$ssh->{seekfile}); ok(! -f "./var/tmp/check_logfiles.._var_adm_messages.ssh"); ok(-f "./omd_root/var/tmp/check_logfiles/check_logfiles.._var_adm_messages.ssh"); $cl->trace("now test if the migration really worked"); # find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 12); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); diag("seek ".$ssh->{seekfile}); ok(! -f "./var/tmp/check_logfiles.._var_adm_messages.ssh"); ok(-f "./omd_root/var/tmp/check_logfiles/check_logfiles.._var_adm_messages.ssh"); rmtree("./omd_root"); diag("# with configfile ===================================================="); $cl->trace("# with configfile ===================================================="); my $configfile = < "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ); EOCFG my $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; diag("seek ".$ssh->{seekfile}); ok(-f "./var/tmp/check_action.._var_adm_messages.ssh"); $ENV{OMD_ROOT} = "./omd_root"; $configfile = < "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ); EOCFG unlink("./etc/check_action.cfg"); $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; sleep 1; $cl->trace("now create a new CheckLogfiles with homevartmp"); $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => "./etc/check_action.cfg" }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); diag("seek ".$ssh->{seekfile}); ok(! -f "./var/tmp/check_action.._var_adm_messages.ssh"); ok(-f "./omd_root/var/tmp/check_logfiles/check_action.._var_adm_messages.ssh"); rmtree("./omd_root"); diag("# now with string ============================================"); $configfile = < "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ); EOCFG $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; open (CFG,"./etc/check_action.cfg"); my $contents = ""; while () {$contents .= $_} #print $contents."\n###\n"; $contents =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; close (CFG); $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => $contents }); $ssh = $cl->get_search_by_tag("ssh"); $ssh->delete_logfile(); $ssh->delete_seekfile(); $ssh->trace("deleted logfile and seekfile"); # 1 logfile will be created. there is no seekfile. position at the end of file # and remember this as starting point for the next run. $ssh->trace(sprintf "+----------------------- test %d ------------------", 1); $ssh->logger(undef, undef, 2, "Failed password for invalid user1..."); $ssh->trace(sprintf "in 1: ctime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[10])); $ssh->trace(sprintf "in 1: mtime %s", scalar localtime ((stat TESTDIR."/var/adm/messages")[9])); sleep 2; $ssh->loggercrap(undef, undef, 100); sleep 1; $ssh->trace("initial run"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 0, 0, 0)); # 2 now find the two criticals $ssh->trace(sprintf "+----------------------- test %d ------------------", 2); $cl->reset(); $ssh->loggercrap(undef, undef, 10); $ssh->logger(undef, undef, 2, "Failed password for invalid user2..."); $ssh->loggercrap(undef, undef, 10); sleep 1; $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 0, 2, 0, 2)); # 3 now find the two criticals and the two warnings $ssh->trace(sprintf "+----------------------- test %d ------------------", 3); $cl->reset(); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Failed password for invalid user3"); $ssh->loggercrap(undef, undef, 100); $ssh->logger(undef, undef, 2, "Unknown user sepp"); $ssh->loggercrap(undef, undef, 100); sleep 1; diag("seek ".$ssh->{seekfile}); ok(-f "./var/tmp/flatfile.._var_adm_messages.ssh"); $ENV{OMD_ROOT} = "./omd_root"; $configfile = < "ssh", logfile => TESTDIR."/var/adm/messages", criticalpatterns => "Failed password", warningpatterns => "Unknown user" } ); EOCFG $testdir = TESTDIR; $configfile =~ s/TESTDIR/"$testdir"/g; open CCC, ">./etc/check_action.cfg"; print CCC $configfile; close CCC; open (CFG,"./etc/check_action.cfg"); $contents = ""; while () {$contents .= $_} #print $contents."\n###\n"; $contents =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; close (CFG); $cl = Nagios::CheckLogfiles::Test->new({ cfgfile => $contents }); $ssh = $cl->get_search_by_tag("ssh"); $cl->run(); diag($cl->has_result()); diag($cl->{exitmessage}); ok($cl->expect_result(0, 2, 2, 0, 2)); diag("seek ".$ssh->{seekfile}); ok(! -f "./var/tmp/flatfile.._var_adm_messages.ssh"); ok(-f "./omd_root/var/tmp/check_logfiles/flatfile.._var_adm_messages.ssh"); rmtree("./omd_root"); check_logfiles-4.1.1/plugins-scripts/0000775000175000017500000000000014336703157014640 500000000000000check_logfiles-4.1.1/plugins-scripts/subst.in0000755000175000017500000000343714336703157016260 00000000000000#!/usr/bin/awk function which(c,path) { cmd = "test -x " c; if (system(cmd)==0) { return c; } sub(/\/.*\//,"",c); for (dir in path) { cmd = "test -x " path[dir] "/" c; cmd = "test -x " "\"" path[dir] "/" c "\""; if (system(cmd)==0) { return path[dir] "/" c; } } return c; } # used to replace "use lib utils.pm" with "use lib @libexecdir" # function led() { led1 = "@libexecdir@"; led2 = "@exec_prefix@"; led3 = "@prefix@"; if ( match(led1, /^\$\{exec_prefix\}/ ) != 0 ) { return "\"" led3 "/libexec\" " ; } return "\"" led1 "\"" ; } BEGIN { split(ENVIRON["PATH"] ":/sbin:/usr/sbin",path,/:/); } # scripting language (first line) /^#! ?\/.*\/python/ {sub(/^#! ?\/.*\/python/,"#! @PYTHON@");} /^#! ?\/.*\/perl/ {sub(/^#! ?\/.*\/perl/,"#! @PERL@");} /^#! ?\/.*\/[a-z]{0,2}awk/ {sub(/^#! ?\/.*\/[a-z]{0,2}awk/,"#! @AWK@");} /^#! ?\/.*\/sh/ {sub(/^#! ?\/.*\/sh/,"#! @SHELL@");} # add to libexecdir to INC for perl utils.pm /^use/ { if (/lib/) { if (/utils.pm|"."/ ) {sub(/utils.pm|"."/,led() )} } } # If a script contains a reference to a fully qualified command, # subst will replace the fully qualified command with whatever is # returned from the which subroutine # ##/^[^#]/ && /(\/.*)?\/(bin|sbin|lib|libexec)\// { ## match($0,/(\/.*)?\/(bin|sbin|lib|libexec)\/[-_a-zA-Z0-9]+/); ## c=substr($0,RSTART,RLENGTH); ## newc=which(c,path); ## sub(c,newc); ##} # Replace the placeholders with the values from configure /#PERL#/ {sub(/#PERL#/,"@PERL@");} /#GZIP#/ {sub(/#GZIP#/,"@GZIP@");} /#SEEKFILES_DIR#/ {sub(/#SEEKFILES_DIR#/,"@SEEKFILES_DIR@");} /#PROTOCOLS_DIR#/ {sub(/#PROTOCOLS_DIR#/,"@PROTOCOLS_DIR@");} /#TRUSTED_PATH#/ {sub(/#TRUSTED_PATH#/,"@TRUSTED_PATH@");} /#PACKAGE_VERSION#/ {sub(/#PACKAGE_VERSION#/,"@PACKAGE_VERSION@");} { print; } check_logfiles-4.1.1/plugins-scripts/Nagios/0000775000175000017500000000000014336703157016060 500000000000000check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/0000775000175000017500000000000014336703157020562 500000000000000check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/0000775000175000017500000000000014336703157021767 500000000000000check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Wevtutil.pm0000755000175000017500000002361014336703157024073 00000000000000package Nagios::CheckLogfiles::Search::Wevtutil; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search::Eventlog); sub init { my $self = shift; my $params = shift; # can be called with type=wevtutil:eventlog= or type=wevtutil:wevtutil= %{$params->{eventlog}} = %{$params->{wevtutil}} if $params->{wevtutil}; $self->SUPER::init($params); } sub startofmin { my $self = shift; my $timestamp = shift; my($sec, $min, $hour, $mday, $mon, $year) = (gmtime $timestamp)[0, 1, 2, 3, 4, 5]; return timegm(0, $min, $hour, $mday, $mon, $year); } sub collectfiles { my $self = shift; $self->trace(sprintf "get everything %d <= event < %d", $self->{eventlog}->{lastsecond}, $self->{eventlog}->{thissecond}); if ($self->{logmodified}) { open(*FH, ">$self->{orschlorschknorsch}"); tie *FH, 'Nagios::CheckLogfiles::Search::Wevtutil::Handle', $self->{eventlog}, $self->get_option('winwarncrit'), $self->get_option('eventlogformat'), $self->get_option('logfilenocry'), $self->{tivoli}, $self->{tracefile}, ($^O =~ "MSWin") ? "C:/WINDOWS/system32/wevtutil" : "/cygdrive/c/WINDOWS/system32/wevtutil"; push(@{$self->{relevantfiles}}, { filename => "eventlog|", fh => *FH, seekable => 0, statable => 1, modtime => $self->{eventlog}->{thissecond}, fingerprint => "0:0" }); } } package Nagios::CheckLogfiles::Search::Wevtutil::Handle; use strict; use Exporter; use POSIX qw(strftime); require Tie::Handle; use IO::File; use Time::Piece; use Date::Manip; use constant EVENTLOG_INFORMATION_TYPE => 0x0000; use constant EVENTLOG_WARNING_TYPE => 0x0002; use constant EVENTLOG_ERROR_TYPE => 0x0001; use vars qw(@ISA); @ISA = qw(Nagios::CheckLogfiles::Search::Eventlog::Handle); our $AUTOLOAD; our $tracefile; our @events = (); *Nagios::CheckLogfiles::Search::Wevtutil::Handle::events = *Nagios::CheckLogfiles::Search::Eventlog::Handle::events; #*Nagios::CheckLogfiles::Search::Wevtutil::Handle::READLINE = # \&Nagios::CheckLogfiles::Search::Eventlog::Handle::READLINE; *Nagios::CheckLogfiles::Search::Wevtutil::Handle::format_message = \&Nagios::CheckLogfiles::Search::Eventlog::Handle::format_message; *Nagios::CheckLogfiles::Search::Wevtutil::Handle::included = \&Nagios::CheckLogfiles::Search::Eventlog::Handle::included; *Nagios::CheckLogfiles::Search::Wevtutil::Handle::excluded = \&Nagios::CheckLogfiles::Search::Eventlog::Handle::excluded; *Nagios::CheckLogfiles::Search::Wevtutil::Handle::trace = \&Nagios::CheckLogfiles::Search::Eventlog::Handle::trace; # Eventlog::trace erwartet tracefile im eigenen Namespace *Nagios::CheckLogfiles::Search::Wevtutil::Handle::tracefile = *Nagios::CheckLogfiles::Search::Eventlog::Handle::tracefile; sub TIEHANDLE { my $class = shift; my $eventlog = shift; my $winwarncrit = shift; my $eventlogformat = shift; my $logfilenocry = shift; my $tivoli = shift; $tracefile = shift; my $wevtutil = shift; my $self = {}; my $oldestoffset = undef; # oldest event in the eventlog my $numevents = undef; # number of events in the eventlog my $newestoffset = 0; # latest event in the eventlog my $save_newestoffset = 0; my $seekoffset = 0; # temporary pointer my $firstoffset = 0; # first event created after the last run my $event = { 'Length' => undef, 'RecordNumber' => undef, 'TimeGenerated' => undef, 'Timewritten' => undef, 'EventID' => undef, 'EventType' => undef, 'Category' => undef, 'ClosingRecordNumber' => undef, 'Source' => undef, 'Computer' => undef, 'Strings' => undef, 'Data' => undef, 'User' => undef, }; @events = (); my $offsetcache = {}; my $mustabort = 0; my $internal_error = ""; my $lasterror = 0; my $handle = undef; my $must_close_ipc = 0; if ($tivoli->{object}) { $eventlogformat = "_tecad_win_"; } # # Schritt 3 # # Oeffnen des Eventlogs # if (! $mustabort) { my $exec = sprintf "%s query-events \"%s\" \"/query:*[System[TimeCreated[\@SystemTime>='%s' and \@SystemTime<'%s']]]\" \"/format:RenderedXml\" %s", $wevtutil, $eventlog->{eventlog}, iso(365*24*3600* $eventlog->{thissecond}), iso(365*24*3600* $eventlog->{thissecond}), " 2>&1 |"; trace("checking %s", $exec); my $fh = new IO::File; if ($fh->open($exec)) { my @lines = grep { defined $_ } $fh->getline(); if (@lines) { $mustabort = 1; $internal_error = join(", ", @lines); } $fh->close(); } else { $mustabort = 1; $internal_error = sprintf "could not run wevtutil with channel %s", $eventlog->{eventlog}; } } # # Schritt 5 # # Jetzt beginnt das eigentliche Auslesen des Eventlogs # if (! $mustabort) { my $exec = sprintf "%s query-events \"%s\" \"/query:*[System[TimeCreated[\@SystemTime>='%s' and \@SystemTime<'%s']]]\" \"/format:RenderedXml\" %s", $wevtutil, $eventlog->{eventlog}, iso($eventlog->{lastsecond}), iso($eventlog->{thissecond}), ($^O eq "cygwin") ? '2>/dev/null |' : '2>NUL |'; trace("calling %s", $exec); my $fh = new IO::File; if ($fh->open($exec)) { my @complete_lines = (); my $tmp_line = ""; while (my $line = $fh->getline()) { $tmp_line .= $line; if ($tmp_line =~ /<\/Event>/) { $tmp_line =~ s/\n/___/g; push(@complete_lines, $tmp_line); $tmp_line = ""; } } $fh->close(); foreach my $line (@complete_lines) { my $event = transform($line); next if ! defined $event->{EventType}; if (included($event, $eventlog->{include}) && ! excluded($event, $eventlog->{exclude})) { my $tmp_event = {}; %{$tmp_event} = %{$event}; #Win32::EventLog::GetMessageText($tmp_event); format_message($eventlogformat, $tmp_event); if ($winwarncrit) { if ($tmp_event->{EventType} == EVENTLOG_WARNING_TYPE) { $tmp_event->{Message} = "EE_WW_TT".$tmp_event->{Message}; } elsif ($tmp_event->{EventType} == EVENTLOG_ERROR_TYPE) { $tmp_event->{Message} = "EE_EE_TT".$tmp_event->{Message}; } } push(@events, $tmp_event); } else { #printf STDERR "blocked by filter %s\n", Data::Dumper::Dumper($event); } } } else { # haette in schritt 3 gefunden werden muessen trace("cannot execute wevtutil"); } } else { my $now = time; my $tmp_event = {}; $tmp_event->{Message} = "EE_UU_TTCHECK_LOGFILES INTERNAL ERROR ".$internal_error; $tmp_event->{Message} =~ s/\0/ /g; $tmp_event->{Message} =~ s/\s*$//g; $tmp_event->{TimeGenerated} = $now; $tmp_event->{Timewritten} = $now; $tmp_event->{Source} = 'check_logfiles'; # internal usage $tmp_event->{EventType} = EVENTLOG_ERROR_TYPE; # internal usage $tmp_event->{EventID} = 0; format_message($eventlogformat, $tmp_event); push(@events, $tmp_event) if $internal_error; } bless $self, $class; return $self; } sub AUTOLOAD { # sonst mault perl wegen inherited autoload deprecated blabla #printf STDERR "wevtutil autoload %s\n", $AUTOLOAD; } sub iso { my $timestamp = shift; my $t = Time::Piece::gmtime $timestamp; return $t->datetime."Z"; } sub transform { my $xml = shift; #1400x80000000000000120492Applicationit10Firewall problem2 #1400x80000000000000138895ApplicationHULSE.consol.lanFirewall problem1Firewall problem1InformationenInfoKlassisch my $event = {}; $xml =~ /(\d+)<\/Level>/; $event->{EventType} = $1; $xml =~ /(.+?)<\/Channel>/; $event->{Category} = $1; $xml =~ //; $event->{Source} = $1; $xml =~ /(\d+)<\/EventID>/; $event->{EventID} = $1; $xml =~ /(.+)<\/Message>/; $event->{Message} = $1; $xml =~ //; $event->{User} = $1; $xml =~ //; my $t = ParseDate($1); $event->{TimeCreated} = UnixDate($t, "%s"); $event->{Timewritten} = $event->{TimeCreated}; $event->{TimeGenerated} = $event->{TimeCreated}; if (! $event->{Message}) { $xml =~ /(.+)<\/Data>/; $event->{Message} = $1; # kann aus mehreren -Bloecken bestehen. $event->{Message} =~ s//, /g; $event->{Message} =~ s/<\Data>//g; } else { $event->{Message} =~ s/___.*//; } if (! defined $event->{EventType}) { # ignore broken events return; } if ($event->{EventType} == 2) { # map wevtutil levels to win32::eventlog defines $event->{EventType} = 1; } elsif ($event->{EventType} == 3) { $event->{EventType} = 2; } return $event; } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Psloglist.pm0000755000175000017500000001077114336703157024234 00000000000000package Nagios::CheckLogfiles::Search::Psloglist; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = '/psloglist/is/cool'; $self->SUPER::init($params); $self->{clo} = { path => $params->{psloglist}->{path} ? $params->{psloglist}->{path} : ($^O =~ "MSWin") ? "C:/Programme/PsTools/psloglist" : "/cygdrive/c/Programme/PsTools/psloglist", eventlog => $params->{psloglist}->{eventlog} || "system", computer => $params->{psloglist}->{computer}, username => $params->{psloglist}->{username}, password => $params->{psloglist}->{password}, source => $params->{psloglist}->{source} }; } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; # the last minute is the end time. in-progess minutes are not # interesting yet. my($sec, $min, $hour, $mday, $mon, $year) = (localtime time)[0, 1, 2, 3, 4, 5]; $self->{eventlog}->{thisminute} = timelocal(0, $min, $hour, $mday, $mon, $year); $self->{eventlog}->{nowminutefilter} = sprintf "%02d.%02d.%4d %02d:%02d:.*", $mday, $mon + 1, $year + 1900, $hour, $min; $self->trace(sprintf "i will discard messages with %s", $self->{eventlog}->{nowminutefilter}); $self->addfilter(0, $self->{eventlog}->{nowminutefilter}); } sub loadstate { my $self = shift; $self->SUPER::loadstate(); # always scan the whole output. thst's what starttime is for. $self->{laststate}->{logoffset} = 0; # if this is the very first run, look back 5 mintes in the past. $self->{laststate}->{logtime} = $self->{laststate}->{logtime} ? $self->{laststate}->{logtime} : $self->{eventlog}->{thisminute} - 600; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } # remember the last minute scanned. $self->{newstate}->{logtime} = $self->{eventlog}->{thisminute}; $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; $self->trace("last scanned until %s", scalar localtime $self->{laststate}->{logtime}); $self->{eventlog}->{distance} = 1 + int ((time - $self->{laststate}->{logtime}) / 60); $self->trace("analyze events from the last %d minutes", $self->{eventlog}->{distance}); $self->trace(sprintf "from %s to %s", scalar localtime (time - 60 * $self->{eventlog}->{distance}), scalar localtime time); if ((time - $self->{laststate}->{logtime}) > 60) { $self->{logmodified} = 1; my($sec, $min, $hour, $mday, $mon, $year) = (localtime ($self->{laststate}->{logtime} - 60))[0, 1, 2, 3, 4, 5]; $self->{eventlog}->{thenminutefilter} = sprintf "%02d.%02d.%4d %02d:%02d:.*", $mday, $mon + 1, $year + 1900, $hour, $min; $self->addfilter(0, $self->{eventlog}->{thenminutefilter}); $self->trace(sprintf "filter %s\,", $self->{eventlog}->{nowminutefilter}); $self->trace(sprintf "filter %s\,", $self->{eventlog}->{thenminutefilter}); } else { # this happens if you call the plugin in too short intervals. $self->trace("please wait for a minute"); } } sub collectfiles { my $self = shift; my $fh = new IO::File; if ($self->{logmodified}) { my $eventlog = sprintf "%s %s %s %s -s -m %d -r %s %s %s", $self->{clo}->{path}, $self->{clo}->{computer} ? '\\\\'.$self->{clo}->{computer} : "", $self->{clo}->{username} ? '-u '.$self->{clo}->{username} : "", $self->{clo}->{password} ? '-p '.$self->{clo}->{password} : "", $self->{eventlog}->{distance}, $self->{clo}->{source} ? '-o '.$self->{clo}->{source} : "", $self->{clo}->{eventlog}, ($^O eq "cygwin") ? '2>/dev/null |' : '2>NUL |'; $self->trace("calling %s", $eventlog); if ($fh->open($eventlog)) { while (my $line = $fh->getline()) { $self->trace(sprintf "skipping header %s", $line); last if $line =~ /^\w+ log on/; } push(@{$self->{relevantfiles}}, { filename => "eventlog|", fh => $fh, seekable => 0, statable => 1, modtime => $self->{eventlog}->{nowminute}, fingerprint => "0:0" }); } else { $self->trace("cannot execute psloglist"); $self->addmatch('UNKNOWN', "cannot execute psloglist"); } } } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Esxdiag.pm0000755000175000017500000001433714336703157023642 00000000000000package Nagios::CheckLogfiles::Search::Esxdiag; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{esxdiag}->{connect} = { server => $params->{esxdiag}->{server}, # host => $params->{esxdiag}->{server} ? # wenn server = datacenter $params->{esxdiag}->{host} : undef, username => $params->{esxdiag}->{username}, password => $params->{esxdiag}->{password}, log => $params->{esxdiag}->{log} || 'hostd', }; $self->{esxdiag}->{connect}->{url} = sprintf 'https://%s/sdk/webService', $self->{esxdiag}->{connect}->{server}; $self->{logfile} = sprintf "%s/esxdiag.%s_%s_%s", $self->{seekfilesdir}, $self->{esxdiag}->{connect}->{log}, $self->{esxdiag}->{connect}->{server}, $self->{esxdiag}->{connect}->{host} ? $self->{esxdiag}->{connect}->{host} : 'host', $self->{tag}; $self->{esxdiag}->{connect}->{token} = sprintf "%s/esxtok.%s_%s", $self->{seekfilesdir}, $self->{esxdiag}->{connect}->{server}, $self->{esxdiag}->{connect}->{host} ? $self->{esxdiag}->{connect}->{host} : 'host'; # virtualcenter + host # host managed by vc # virtualcenter. default logs = vc logs # host # esx server $self->SUPER::init($params); } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; } sub loadstate { my $self = shift; $self->SUPER::loadstate(); # if this is the very first run, use an insane offet $self->{laststate}->{lineend} = $self->{laststate}->{lineend} ? ($self->{laststate}->{lineend} + 1) : 999999; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; $self->{logmodified} = 1; } sub collectfiles { my $self = shift; my $fh = new IO::File; if ($self->{logmodified}) { my $linesread = 0; eval { require VMware::VIRuntime; my %loginparams = ( service_url => $self->{esxdiag}->{connect}->{url}, user_name => $self->{esxdiag}->{connect}->{username}, password => $self->{esxdiag}->{connect}->{password}, ); my $vim = undef; eval { # das bringt's nicht. login ist genauso schnell #$vim = Vim::load_session( # service_url => $self->{esxdiag}->{connect}->{url}, # session_file => $self->{esxdiag}->{connect}->{token}); $vim = Vim::login(%loginparams) if ! $vim; #Vim::save_session( # session_file => $self->{esxdiag}->{connect}->{token}); }; if ($vim) { my $instance_type = Vim::get_service_content()->about->apiType; my $diagmgr = Vim::get_service_content()->diagnosticManager(); my $diagmgr_view = $diagmgr ? Vim::get_view(mo_ref => $diagmgr) : undef; if ($diagmgr_view) { my $host_view = undef; my $logdata = undef; if ($instance_type eq 'VirtualCenter') { my $host_views = Vim::find_entity_views( view_type => 'HostSystem', filter => {'name' => $self->{esxdiag}->{host}}, properties => ['name']); $host_view = $host_views->[0] if $host_views; } else { $host_view = Vim::find_entity_view( view_type => 'HostSystem', properties => ['name']); # increases the speed dramatically } if ($host_view) { my %browseparams = ( key => $self->{esxdiag}->{connect}->{log}, start => $self->{laststate}->{lineend}, ); $browseparams{host} = $self->{esxdiag}->{connect}->{host} if $self->{esxdiag}->{connect}->{host}; # VirtualCenter $self->trace(sprintf 'browsing view for host %s', $host_view->name); $self->trace(sprintf 'start reading at line %d', $self->{laststate}->{lineend}); $logdata = $diagmgr_view->BrowseDiagnosticLog(%browseparams); $self->trace(sprintf 'log interval is %d..%d', $logdata->lineStart, $logdata->lineEnd); if ($logdata->lineStart < $self->{laststate}->{lineend}) { # rotation, # z.b. "start reading at line 4133"-> "log interval is 0..43" $browseparams{start} = $logdata->lineStart; $logdata = $diagmgr_view->BrowseDiagnosticLog(%browseparams); $self->trace(sprintf 'rotation detected. new log interval %d..%d', $logdata->lineStart, $logdata->lineEnd); } $self->{laststate}->{lineend} = $logdata->lineEnd; if ($logdata->lineText) { if (my $fh = new IO::File($self->{logfile}, 'w')) { foreach my $line (@{$logdata->lineText}) { $fh->printf("%s\n", $line); $linesread++; } $fh->close(); } } else { $self->trace('nothing to do'); } } else { $self->trace('no host view'); } } else { $self->trace('no diag manager view'); } Vim::logout(); # auskommentieren, wenn sessions benutzt werden } else { chomp $@ if $@; $self->trace(sprintf 'unable to connect %s', $@); $self->addmatch('UNKNOWN', sprintf 'unable to connect %s', $@); } }; if ($@) { $self->trace(sprintf "vi api operation failed: %s", $@); $self->addmatch('UNKNOWN', sprintf "vi api operation failed: %s", $@); } $self->trace(sprintf "read %d lines from esx server", $linesread); if ($linesread) { if (my $fh = new IO::File($self->{logfile}, "r")) { $self->trace(sprintf "reopen logfile"); push(@{$self->{relevantfiles}}, { filename => "esxdiag", fh => $fh, seekable => 1, statable => 1, modtime => time, fingerprint => "0:0" }); } } } } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm0000755000175000017500000006621514336703157024043 00000000000000package Nagios::CheckLogfiles::Search::Eventlog; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = '/eventlog/is/cool'; $self->default_options({ winwarncrit => 0, eventlogformat => '%g %i %m' }); $self->SUPER::init($params); if ($self->get_option('lookback')) { if ($self->get_option('lookback') =~ /^(\d+)(s|m|h|d)$/) { if ($2 eq 's') { $self->set_option('lookback', $1); } elsif ($2 eq 'm') { $self->set_option('lookback', $1 * 60); } elsif ($2 eq 'h') { $self->set_option('lookback', $1 * 60 * 60); } elsif ($2 eq 'd') { $self->set_option('lookback', $1 * 60 * 60 * 24); } } else { printf STDERR "illegal time interval (must be [s|m|h|d]\n"; $self = undef; return undef; } } if ($self->get_option('winwarncrit')) { push(@{$self->{patterns}->{WARNING}}, "EE_WW_TT"); push(@{$self->{patterns}->{CRITICAL}}, "EE_EE_TT"); push(@{$self->{patternfuncs}->{WARNING}}, eval "sub { local \$_ = shift; return m/EE_WW_TT/o; }"); push(@{$self->{patternfuncs}->{CRITICAL}}, eval "sub { local \$_ = shift; return m/EE_EE_TT/o; }"); } push(@{$self->{patterns}->{UNKNOWN}}, "EE_UU_TT"); push(@{$self->{patternfuncs}->{UNKNOWN}}, eval "sub { local \$_ = shift; return m/EE_UU_TT/o; }"); $self->{eventlog} = { # system, security, application eventlog => $params->{eventlog}->{eventlog} || 'system', computer => $params->{eventlog}->{computer} || Win32::NodeName(), username => $params->{eventlog}->{username} || Win32::LoginName(), password => $params->{eventlog}->{password} || '', source => $params->{eventlog}->{source}, speedup => $params->{eventlog}->{speedup} || 1, include => $params->{eventlog}->{include} || {}, exclude => $params->{eventlog}->{exclude} || {}, }; $self->resolve_macros(\$self->{eventlog}->{eventlog}); $self->resolve_macros(\$self->{eventlog}->{computer}); $self->resolve_macros(\$self->{eventlog}->{username}) if $self->{eventlog}->{username}; $self->resolve_macros(\$self->{eventlog}->{password}) if $self->{eventlog}->{password}; # computer: I changed "\\\\MYPDC" to $dc ($dc = Win32::AdminMisc::GetDC("MYDOMAIN");) # keys fuer include/exclude: source,category,type,eventid foreach my $item (qw(Source Category EventType EventID)) { foreach (keys %{$self->{eventlog}->{include}}) { if (lc $_ eq lc $item) { $self->{eventlog}->{include}->{$item} = lc $self->{eventlog}->{include}->{$_}; delete $self->{eventlog}->{include}->{$_} if $_ ne $item; } } foreach (keys %{$self->{eventlog}->{exclude}}) { if (lc $_ eq lc $item) { $self->{eventlog}->{exclude}->{$item} = lc $self->{eventlog}->{exclude}->{$_}; delete $self->{eventlog}->{exclude}->{$_} if $_ ne $item; } } } if (! exists $self->{eventlog}->{include}->{operation} || $self->{eventlog}->{include}->{operation} ne 'or') { $self->{eventlog}->{include}->{operation} = 'and' } if (! exists $self->{eventlog}->{exclude}->{operation} || $self->{eventlog}->{exclude}->{operation} ne 'and') { $self->{eventlog}->{exclude}->{operation} = 'or' } $self->{orschlorschknorsch} = sprintf "%s/%s.temp_evtlog2file", $self->system_tempdir(), $self->{tag}; } sub prepare { my $self = shift; #$self->{options}->{nologfilenocry} = 1; $self->{eventlog}->{thissecond} = time; push(@{$self->{exceptions}->{CRITICAL}}, 'CHECK_LOGFILES INTERNAL ERROR'); push(@{$self->{exceptions}->{WARNING}}, 'CHECK_LOGFILES INTERNAL ERROR'); } sub loadstate { my $self = shift; $self->SUPER::loadstate(); # always scan the whole output. thst's what starttime is for. $self->{laststate}->{logoffset} = 0; # if this is the very first run, look back 5 mintes in the past. # with allyoucaneat set, look back 10 years $self->{laststate}->{logtime} = $self->{laststate}->{logtime} ? $self->{laststate}->{logtime} : $self->{options}->{allyoucaneat} ? $self->{eventlog}->{thissecond} - 315360000 : $self->{eventlog}->{thissecond} - 600; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->{newstate}->{logtime} = $self->{eventlog}->{thissecond}; $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; if ($self->{options}->{lookback}) { $self->{eventlog}->{lastsecond} = time - $self->{options}->{lookback}; $self->trace("looking back until %s", scalar localtime $self->{eventlog}->{lastsecond}); } else { $self->{eventlog}->{lastsecond} = $self->{laststate}->{logtime}; $self->trace("last scanned until %s", scalar localtime $self->{eventlog}->{lastsecond}); } $self->trace(sprintf "from %s to %s", scalar localtime $self->{eventlog}->{lastsecond}, scalar localtime $self->{eventlog}->{thissecond}); if ($self->{eventlog}->{lastsecond} < $self->{eventlog}->{thissecond}) { $self->{logmodified} = 1; } else { # this happens if you call the plugin in too short intervals. $self->trace("please wait for a second"); } } sub collectfiles { my $self = shift; $self->trace(sprintf "get everything %d <= event < %d", $self->{eventlog}->{lastsecond}, $self->{eventlog}->{thissecond}); if ($self->{logmodified}) { open(*FH, ">$self->{orschlorschknorsch}"); tie *FH, 'Nagios::CheckLogfiles::Search::Eventlog::Handle', $self->{eventlog}, $self->get_option('winwarncrit'), $self->get_option('eventlogformat'), $self->get_option('logfilenocry'), $self->{tivoli}, $self->{tracefile}; push(@{$self->{relevantfiles}}, { filename => "eventlog|", fh => *FH, seekable => 0, statable => 1, modtime => $self->{eventlog}->{thissecond}, fingerprint => "0:0" }); } } sub getfilefingerprint { return 1; } sub finish { my $self = shift; foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { if (scalar(@{$self->{matchlines}->{$level}})) { foreach my $match (@{$self->{matchlines}->{$level}}) { $match =~ s/EE_WW_TT//; $match =~ s/EE_EE_TT//; $match =~ s/EE_UU_TT//; } } if (exists $self->{lastmsg} && exists $self->{lastmsg}->{$level}) { $self->{lastmsg}->{$level} =~ s/EE_WW_TT//; $self->{lastmsg}->{$level} =~ s/EE_EE_TT//; $self->{lastmsg}->{$level} =~ s/EE_UU_TT//; } } if (-f $self->{orschlorschknorsch}) { unlink $self->{orschlorschknorsch}; } } sub rewind { my $self = shift; $self->loadstate(); foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->addmatch(0, "reset"); $self->{eventlog}->{thissecond} = 1; $self->savestate(); return $self; } package Nagios::CheckLogfiles::Search::Eventlog::Handle; use strict; use Exporter; use POSIX qw(strftime); require Tie::Handle; use Win32::EventLog; use Win32::TieRegistry (Delimiter => "/"); use Win32::WinError; use IO::File; use vars qw(@ISA); @ISA = qw(Tie::Handle Nagios::CheckLogfiles::Search::Eventlog); our $AUTOLOAD; our $tracefile; $Win32::EventLog::GetMessageText = 1; our @events = (); sub TIEHANDLE { my $class = shift; my $eventlog = shift; my $winwarncrit = shift; my $eventlogformat = shift; my $logfilenocry = shift; my $tivoli = shift; $tracefile = shift; my $self = {}; my $oldestoffset = undef; # oldest event in the eventlog my $numevents = undef; # number of events in the eventlog my $newestoffset = 0; # latest event in the eventlog my $save_newestoffset = 0; my $seekoffset = 0; # temporary pointer my $firstoffset = 0; # first event created after the last run my $event = { 'Length' => undef, 'RecordNumber' => undef, 'TimeGenerated' => undef, 'Timewritten' => undef, 'EventID' => undef, 'EventType' => undef, 'Category' => undef, 'ClosingRecordNumber' => undef, 'Source' => undef, 'Computer' => undef, 'Strings' => undef, 'Data' => undef, 'User' => undef, }; @events = (); my $offsetcache = {}; my $mustabort = 0; my $internal_error = ""; my $lasterror = 0; my $handle = undef; my $must_close_ipc = 0; if ($tivoli->{object}) { $eventlogformat = "_tecad_win_"; } # # Schritt 1 # # Falls es sich um einen Remote-Rechner handelt, muss erst eine # Verbindung zu dessen IPC$-Resource hergestellt werden # Bei einem Server 2008 kann dies ein lokaler Benutzer sein, # der zur Gruppe Ereignisprotokolleser gehoert # if ($eventlog->{computer} ne Win32::NodeName) { my @harmlesscodes = (1219); # 1219 Mehrfache Verbindungen zu einem Server oder .... # net use \\remote\IPC$ /USER:Administrator adminpw eval { require Win32::NetResource; }; if ($@) { $mustabort = 1; $internal_error = 'Win32::NetResource not installed'; } else { trace(sprintf "connect to %s as %s with password ***", $eventlog->{computer}, $eventlog->{username}); if (Win32::NetResource::AddConnection({ 'Scope' => 0, 'Type' => 0, 'DisplayType' => 0, # RESOURCEDISPLAYTYPE_GENERIC 'Usage' => 0, 'RemoteName' => "\\\\".$eventlog->{computer}."\\IPC\$", 'LocalName' => '', 'Comment' => "check_logfiles", #'Provider' => "Microsoft Windows Network" }, $eventlog->{password}, $eventlog->{username}, 0)) { trace("created ipc channel"); $must_close_ipc = 1; } else { Win32::NetResource::GetError($lasterror); if (scalar(grep { $lasterror == $_ } @harmlesscodes) == 0) { $mustabort = 1; $internal_error = 'IPC$ '.Win32::FormatMessage($lasterror); trace("ipc channel could not be established"); } else { trace("ipc channel already established"); } } } } # # Schritt 2 # # Oeffnen der Registry und kontrollieren, ob es das gewuenschte # Eventlog ueberhaupt gibt # if (! $mustabort) { my @haseventlogs = ("application", "system", "security"); eval { my $data = undef; if ($eventlog->{computer} ne Win32::NodeName()) { trace("looking into remote registry"); $data = $Registry->Connect( $eventlog->{computer}, 'HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/EventLog/', { Access=>Win32::TieRegistry::KEY_READ(), Delimiter => "/" } ); } else { trace("looking into registry"); $data = $Registry->Open( 'HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/EventLog/', { Access=>Win32::TieRegistry::KEY_READ(), Delimiter => "/" } ); } if ($data) { push(@haseventlogs, grep { my $var = $_; ! grep /^$var$/, @haseventlogs } map { lc $_ } $data->SubKeyNames); trace(sprintf "known eventlogs: %s", join(',', @haseventlogs)); undef $data; } else { die "no data from HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/EventLog/"; } }; if ($@) { $mustabort = 1; $internal_error = "Cannot read registry"; trace(sprintf "looking into registry failed: %s", $@); } elsif (! scalar(grep { lc $eventlog->{eventlog} eq $_ } @haseventlogs)) { $mustabort = 1; $internal_error = sprintf "Eventlog %s does not exist", $eventlog->{eventlog} if $logfilenocry; } } # # Schritt 3 # # Oeffnen des Eventlogs # if (! $mustabort) { my @harmlesscodes = (0, 997); trace(sprintf "opening handle to eventlog %s", $eventlog->{eventlog}); $handle = Win32::EventLog->new($eventlog->{eventlog}, $eventlog->{computer}); $lasterror = Win32::GetLastError(); # 0 Der Vorgang wurde erfolgreich beendet # 997 überlappender E/A-Vorgang wird verarbeitet. # 5 Zugriff verweigert # 1722 Der RPC-Server ist nicht verfügbar. # 1722 eventlog gueltig, ip gueltig, aber kein windows-rechner # 1722 eventlog gueltig, ip nicht pingbar # 5 kein secure channel zum remoterechner vorhanden if (! $handle || scalar(grep { $lasterror == $_ } @harmlesscodes) == 0) { # sinnlos, weiterzumachen $mustabort = 1; $internal_error = 'open Eventlog '.Win32::FormatMessage($lasterror); trace("opening handle to eventlog failed"); } } # # Schritt 4 # # Anzahl der Eintraege auslesen. # Dieser Schritt dient ausserdem dazu, die Berechtigung zum Lesen # zu ueberpruefen, da unter Cygwin der letzte Schritt erfolgreich # ausfaellt, auch wenn keine Leseberechtigung besteht. # if (! $mustabort) { $handle->GetOldest($oldestoffset); $handle->GetNumber($numevents); if (! defined $numevents) { # cygwin perl sagt zu allem errorcode=0, auch wenn keine berechtigung # zum zugriff vorliegt. aber ein undef ist zumindest ein indiz, dass # etwas faul ist. $mustabort = 1; $internal_error = "Eventlog permission denied"; } } # # Schritt 5 # # Jetzt beginnt das eigentliche Auslesen des Eventlogs # if (! $mustabort) { if ($numevents) { $newestoffset = $oldestoffset + $numevents - 1; trace(sprintf "eventlog has offsets %d..%d", $oldestoffset, $newestoffset); if (! $eventlog->{speedup}) { $firstoffset = $oldestoffset; } else { # new method. find the first event which lies within the range # oldestoffset <= offset <= newestoffset $save_newestoffset = $newestoffset; $handle->Read((EVENTLOG_SEEK_READ|EVENTLOG_BACKWARDS_READ), $oldestoffset, $event); $offsetcache->{$oldestoffset} = $event->{Timewritten}; if ($event->{Timewritten} >= $eventlog->{lastsecond}) { # even the oldest record was created after the last run # of check_logfiles. the log was cleared or this is the first run ever $firstoffset = $oldestoffset; trace(sprintf "i start from the beginning %d", $firstoffset); } else { $handle->Read((EVENTLOG_SEEK_READ|EVENTLOG_BACKWARDS_READ), $newestoffset, $event); $offsetcache->{$newestoffset} = $event->{Timewritten}; if ($event->{Timewritten} >= $eventlog->{lastsecond}) { # the latest event was created after the last run of check_logfiles $seekoffset = $newestoffset; trace(sprintf "start at offset %d", $seekoffset); do { # get the seekoffset's time $handle->Read((EVENTLOG_SEEK_READ|EVENTLOG_BACKWARDS_READ), $seekoffset, $event); $offsetcache->{$seekoffset} = $event->{Timewritten}; if ($event->{Timewritten} >= $eventlog->{lastsecond}) { # inside the search interval. but is it the oldest? if ((exists $offsetcache->{$seekoffset - 1}) && ($offsetcache->{$seekoffset - 1} < $eventlog->{lastsecond})) { $firstoffset = $seekoffset; trace(sprintf "found first offset %d (=)", $firstoffset); } else { $newestoffset = $seekoffset; $seekoffset = $oldestoffset + int (($seekoffset - $oldestoffset) / 2); trace(sprintf "try offset %d (<)", $seekoffset); } } else { # too old. but maybe the next offset? if ((exists $offsetcache->{$seekoffset + 1}) && ($offsetcache->{$seekoffset + 1} >= $eventlog->{lastsecond})) { $firstoffset = $seekoffset + 1; trace(sprintf "found first offset %d (+)", $firstoffset); } else { $oldestoffset = $seekoffset; $seekoffset = $seekoffset + int (($newestoffset - $seekoffset) / 2); trace(sprintf "try offset %d (>)", $seekoffset); } } } while (! $firstoffset); # now position at the first element in question $handle->Read((EVENTLOG_SEEK_READ|EVENTLOG_BACKWARDS_READ), $firstoffset, $event); # adjust the number of elements to scan $newestoffset = $save_newestoffset; } else { # there are no new events # fake firstoffset to avoid entering the while loop $firstoffset = $newestoffset + 1; trace(sprintf "no new events fake %d", $firstoffset); } } } while ($firstoffset <= $newestoffset) { # sequential_reads are not reliable, so better use direct access $handle->Read((EVENTLOG_SEEK_READ|EVENTLOG_FORWARDS_READ), $firstoffset, $event); if (($event->{Timewritten} >= $eventlog->{lastsecond}) && ($event->{Timewritten} < $eventlog->{thissecond})) { if (included($event, $eventlog->{include}) && ! excluded($event, $eventlog->{exclude})) { #printf STDERR "passed filter %s\n", Data::Dumper::Dumper($event); my $tmp_event = {}; %{$tmp_event} = %{$event}; Win32::EventLog::GetMessageText($tmp_event); format_message($eventlogformat, $tmp_event); if ($winwarncrit) { if ($tmp_event->{EventType} == EVENTLOG_WARNING_TYPE) { $tmp_event->{Message} = "EE_WW_TT".$tmp_event->{Message}; } elsif ($tmp_event->{EventType} == EVENTLOG_ERROR_TYPE) { $tmp_event->{Message} = "EE_EE_TT".$tmp_event->{Message}; } } push(@events, $tmp_event); } else { #printf STDERR "blocked by filter %s\n", Data::Dumper::Dumper($event); } } $firstoffset++; } } else { #printf STDERR "0 events\n"; } } else { my $now = time; my $tmp_event = {}; $tmp_event->{Message} = "EE_UU_TTCHECK_LOGFILES INTERNAL ERROR ".$internal_error; $tmp_event->{Message} =~ s/\0/ /g; $tmp_event->{Message} =~ s/\s*$//g; $tmp_event->{TimeGenerated} = $now; $tmp_event->{Timewritten} = $now; $tmp_event->{Source} = 'check_logfiles'; # internal usage $tmp_event->{EventType} = EVENTLOG_ERROR_TYPE; # internal usage $tmp_event->{EventID} = 0; format_message($eventlogformat, $tmp_event); push(@events, $tmp_event) if $internal_error; } # # Aufraeumen # $handle->Close() if $handle; if ($must_close_ipc) { if (Win32::NetResource::CancelConnection( "\\\\".$eventlog->{computer}."\\IPC\$", 0, 0)) { trace("closed the ipc connection"); } else { trace("could not close the ipc connection"); if (Win32::NetResource::CancelConnection( "\\\\".$eventlog->{computer}."\\IPC\$", 0, 1)) { trace("closed the ipc connection by force"); } else { trace("could not close the ipc connection even by force"); } } } bless $self, $class; return $self; } sub SEEK { } sub STAT { } sub OPEN { } sub CLOSE { } sub GETC { } sub READ { } sub READLINE { if (my $event = shift @events) { return $event->{Message}; } else { return undef; } } sub format_message { my $eventlogformat = shift; my $event = shift; # formatstring: # %t EventType # %c Category # %s Source # %i EventID # %m Message # %w Timewritten # %g Timegenerated # %d Date/Time # %u User # not documented @ cpan if ($eventlogformat eq "_tecad_win_") { $eventlogformat = "%__TiVoLi__g %C %t N/A %s %__TiVoLi__i %m"; } if (! $event->{Message}) { $event->{Message} = $event->{Strings}; $event->{Message} =~ s/\0/ /g; $event->{Message} =~ s/\s*$//g; } $event->{Message} = 'unknown message' if ! $event->{Message}; $event->{Message} =~ tr/\r\n/ /d; my $tz = ''; my $format = {}; $format->{'%t'} = ($event->{EventType} == -1) ? 'Internal' : ($event->{EventType} == EVENTLOG_WARNING_TYPE) ? 'Warning' : ($event->{EventType} == EVENTLOG_ERROR_TYPE) ? 'Error' : ($event->{EventType} == EVENTLOG_INFORMATION_TYPE) ? 'Information' : ($event->{EventType} == EVENTLOG_AUDIT_SUCCESS) ? 'AuditSuccess' : ($event->{EventType} == EVENTLOG_AUDIT_FAILURE) ? 'AuditFailure' : ($event->{EventType} == EVENTLOG_SUCCESS) ? 'Success' : 'UnknType'; $format->{'%c'} = ! $event->{Category} ? 'None' : join('_', split(" ", $event->{Category})); $format->{'%C'} = ! $event->{Category} ? 'None' : $event->{Category}; $format->{'%s'} = join('_', split(" ", $event->{Source})); $format->{'%i'} = sprintf '%04d', $event->{EventID} & 0xffff; $format->{'%__TiVoLi__i'} = sprintf '%s', $event->{EventID} & 0xffff; $format->{'%m'} = $event->{Message}; $format->{'%w'} = strftime("%Y-%m-%dT%H:%M:%S", localtime($event->{Timewritten})).$tz; $format->{'%g'} = strftime("%Y-%m-%dT%H:%M:%S", localtime($event->{TimeGenerated})).$tz; $format->{'%W'} = $event->{Timewritten}; $format->{'%G'} = $event->{TimeGenerated}; $format->{'%u'} = $event->{User} || 'undef'; $format->{'%__TiVoLi__g'} = join(" ", (split(/\s+/, scalar localtime $event->{TimeGenerated}))[1,2,3,4]); # month day time and year => %t %s my $message = $eventlogformat; foreach (keys %{$format}) { $message =~ s/$_/$format->{$_}/g; } while ($message =~ /%(\d+)m/) { my $search = "%".$1."m"; my $replace = sprintf "%.".$1."s", $event->{Message}; $message =~ s/$search/$replace/g; } $event->{Message} = $message; } sub included { my $event = shift; my $filter = shift; my $filters = 0; my $matches = {}; # EventCategory ist ein INTEGER!!! # und ausserdem ist pro Source ein eigener Satz von Kategorien moeglich # man muesste deren Bezeichnungen aus der Registry lesen. # in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application # stehen die Sources, die eigene Kategorien definiert haben. # Im Key CategoryMessageFile ist die Datei hinterlegt, der die Kategorien # entnommen werden koennen. In CategoryCount steht die Anzahl der # selbstdefinierten Kategorien. foreach my $attr (qw(Source Category)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; if (lc $item eq lc $event->{$attr}) { #printf "-> %s eq %s\n", lc $item, lc $event->{$attr}; $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; $matches->{$attr}++; } } foreach my $attr (qw(EventID)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; #if (lc $item eq lc ($event->{$attr} & 0xffff)) { if ($item == ($event->{$attr} & 0xffff)) { #printf "-> %s eq %s\n", lc $item, lc ($event->{$attr} & 0xffff); $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; $matches->{$attr}++; } } foreach my $attr (qw(EventType)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { #printf "succ %s\n", EVENTLOG_SUCCESS; #printf "warn %s\n", EVENTLOG_WARNING_TYPE; #printf "err %s\n", EVENTLOG_ERROR_TYPE; #printf "info %s\n", EVENTLOG_INFORMATION_TYPE; #printf "audit %s\n", EVENTLOG_AUDIT_SUCCESS; #printf "fail %s\n", EVENTLOG_AUDIT_FAILURE; foreach my $item (split(',', $filter->{$attr})) { if ((lc $item =~ /^succ/ && $event->{$attr} == EVENTLOG_SUCCESS) || (lc $item =~ /warn/ && $event->{$attr} == EVENTLOG_WARNING_TYPE) || (lc $item =~ /err/ && $event->{$attr} == EVENTLOG_ERROR_TYPE) || (lc $item =~ /info/ && $event->{$attr} == EVENTLOG_INFORMATION_TYPE) || (lc $item =~ /audit.*succ/ && $event->{$attr} == EVENTLOG_AUDIT_SUCCESS) || (lc $item =~ /fail/ && $event->{$attr} == EVENTLOG_AUDIT_FAILURE)) { $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; $matches->{$attr}++; } } if ($filter->{operation} eq 'and') { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 4) ? 1 : 0; } else { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 0) ? 0 : 1; } } sub excluded { my $event = shift; my $filter = shift; my $filters = 0; my $matches = {}; # EventCategory ist ein INTEGER!!! foreach my $attr (qw(Source Category)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; if (lc $item eq lc $event->{$attr}) { #printf "-> %s eq %s\n", lc $item, lc $event->{$attr}; $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; #$matches->{$attr}++; } } foreach my $attr (qw(EventID)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; #if (lc $item eq lc ($event->{$attr} & 0xffff)) { if ($item == ($event->{$attr} & 0xffff)) { #printf "-> %s eq %s\n", lc $item, lc ($event->{$attr} & 0xffff); $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; #$matches->{$attr}++; } } foreach my $attr (qw(EventType)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { if ((lc $item =~ /^succ/ && $event->{$attr} == EVENTLOG_SUCCESS) || (lc $item =~ /warn/ && $event->{$attr} == EVENTLOG_WARNING_TYPE) || (lc $item =~ /err/ && $event->{$attr} == EVENTLOG_ERROR_TYPE) || (lc $item =~ /info/ && $event->{$attr} == EVENTLOG_INFORMATION_TYPE) || (lc $item =~ /audit.*succ/ && $event->{$attr} == EVENTLOG_AUDIT_SUCCESS) || (lc $item =~ /fail/ && $event->{$attr} == EVENTLOG_AUDIT_FAILURE)) { #printf "type %s matched\n", $item; $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; #$matches->{$attr}++; } } #printf "%s\n", Data::Dumper::Dumper($matches); if ($filter->{operation} eq 'and') { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 4) ? 1 : 0; } else { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 0) ? 0 : 1; } } sub trace { my $format = shift; if (-f $tracefile) { my $logfh = new IO::File; $logfh->autoflush(1); if ($logfh->open($tracefile, "a")) { $logfh->printf("%s: ", scalar localtime); $logfh->printf($format, @_); $logfh->printf("\n"); $logfh->close(); } } } sub AUTOLOAD { #printf "uarghh %s\n", $AUTOLOAD; } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Journald.pm0000755000175000017500000000504514336703157024030 00000000000000package Nagios::CheckLogfiles::Search::Journald; use strict; use Exporter; use File::Basename; use vars qw(@ISA); use POSIX qw(strftime); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = "/usr/bin/journalctl"; $self->{journaldunit} = $params->{journald}->{unit}; if ($self->{journaldunit} and $self->{tag} eq "default") { $self->{tag} = $self->{journaldunit}; } $self->default_options({ exeargs => "", }); $self->SUPER::init($params); } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; } sub analyze_situation { my $self = shift; $self->{logmodified} = 1; } sub collectfiles { my $self = shift; my @rotatedfiles = (); my $fh = new IO::File; if ($self->getfileisexecutable($self->{logfile})) { my $cmdline = $self->{logfile}; if ($self->{journaldunit}) { $cmdline = $cmdline." --unit '".$self->{journaldunit}."'"; } $cmdline = $cmdline." --since '".strftime("%Y-%m-%d %H:%M:%S", localtime($self->{journald}->{since}))."'|"; if ($fh->open($cmdline)) { push(@{$self->{relevantfiles}}, { filename => $self->{logfile}, fh => $fh, seekable => 0, statable => 1, modtime => time, fingerprint => "0:0" }); } else { $self->trace("cannot execute ".$cmdline); $self->addmatch('UNKNOWN', "cannot execute ".$cmdline); } } else { if (-e $self->{logfile}) { # permission problem $self->trace("could not open %s", $self->{logfile}); $self->addmatch('CRITICAL', sprintf "could not open %s", $self->{logfile}); } else { if ($self->get_option('logfilenocry')) { $self->trace("could not find %s", $self->{logfile}); $self->addmatch($self->get_option('logfilemissing'), sprintf "could not find %s", $self->{logfile}); } else { # dont care. $self->trace("could not find %s, but that's ok", $self->{logfile}); } } } } sub loadstate { my $self = shift; $self->SUPER::loadstate(); $self->{journald}->{since} = $self->{laststate}->{runtime} ? $self->{laststate}->{runtime} : time(); $self->{laststate}->{logoffset} = 0; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->SUPER::savestate(); } check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Dumpel.pm0000755000175000017500000004612414336703157023503 00000000000000package Nagios::CheckLogfiles::Search::Dumpel; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = '/dumpel/is/cool'; $self->default_options({ winwarncrit => 0, eventlogformat => '%g %i %m', language => 'en', randominode => 1 }); $self->SUPER::init($params); if ($self->get_option('lookback')) { if ($self->get_option('lookback') =~ /^(\d+)(s|m|h|d)$/) { if ($2 eq 's') { $self->set_option('lookback', $1); } elsif ($2 eq 'm') { $self->set_option('lookback', $1 * 60); } elsif ($2 eq 'h') { $self->set_option('lookback', $1 * 60 * 60); } elsif ($2 eq 'd') { $self->set_option('lookback', $1 * 60 * 60 * 24); } } else { printf STDERR "illegal time interval (must be [s|m|h|d]\n"; $self = undef; return undef; } } if ($self->get_option('winwarncrit')) { push(@{$self->{patterns}->{WARNING}}, "EE_WW_TT"); push(@{$self->{patterns}->{CRITICAL}}, "EE_EE_TT"); push(@{$self->{patternfuncs}->{WARNING}}, eval "sub { local \$_ = shift; return m/EE_WW_TT/o; }"); push(@{$self->{patternfuncs}->{CRITICAL}}, eval "sub { local \$_ = shift; return m/EE_EE_TT/o; }"); } push(@{$self->{patterns}->{UNKNOWN}}, "EE_UU_TT"); push(@{$self->{patternfuncs}->{UNKNOWN}}, eval "sub { local \$_ = shift; return m/EE_UU_TT/o; }"); if (-f 'C:\Programme') { $self->set_option('language', 'de'); } $self->{eventlog} = { path => $params->{dumpel}->{path} ? $params->{dumpel}->{path} : ( -f "C:/Programme" ? "C:/Programme/Resource Kit/dumpel" : "C:/Program Files/Resource Kit/dumpel" ), eventlog => $params->{dumpel}->{eventlog} || "system", computer => $params->{dumpel}->{computer}, username => $params->{dumpel}->{username}, password => $params->{dumpel}->{password}, source => $params->{dumpel}->{source}, days => $params->{dumpel}->{days}, include => $params->{eventlog}->{include} || {}, exclude => $params->{eventlog}->{exclude} || {}, }; $self->resolve_macros(\$self->{eventlog}->{eventlog}); $self->resolve_macros(\$self->{eventlog}->{computer}) if $self->{eventlog}->{computer}; $self->resolve_macros(\$self->{eventlog}->{username}) if $self->{eventlog}->{username}; $self->resolve_macros(\$self->{eventlog}->{password}) if $self->{eventlog}->{password}; # keys fuer include/exclude: source,category,type,eventid foreach my $item (qw(Source Category EventType EventID)) { foreach (keys %{$self->{eventlog}->{include}}) { if (lc $_ eq lc $item) { $self->{eventlog}->{include}->{$item} = lc $self->{eventlog}->{include}->{$_}; delete $self->{eventlog}->{include}->{$_} if $_ ne $item; } } foreach (keys %{$self->{eventlog}->{exclude}}) { if (lc $_ eq lc $item) { $self->{eventlog}->{exclude}->{$item} = lc $self->{eventlog}->{exclude}->{$_}; delete $self->{eventlog}->{exclude}->{$_} if $_ ne $item; } } } if (! exists $self->{eventlog}->{include}->{operation} || $self->{eventlog}->{include}->{operation} ne 'or') { $self->{eventlog}->{include}->{operation} = 'and' } if (! exists $self->{eventlog}->{exclude}->{operation} || $self->{eventlog}->{exclude}->{operation} ne 'and') { $self->{eventlog}->{exclude}->{operation} = 'or' } } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; # the last minute is the end time. in-progess minutes are not # interesting yet. my($sec, $min, $hour, $mday, $mon, $year) = (localtime time)[0, 1, 2, 3, 4, 5]; $self->{eventlog}->{thisminute} = timelocal(0, $min, $hour, $mday, $mon, $year); $self->trace(sprintf "i will discard messages newer or equal than %s", scalar localtime $self->{eventlog}->{thisminute}); } sub loadstate { my $self = shift; $self->SUPER::loadstate(); # always scan the whole output. thst's what starttime is for. $self->{laststate}->{logoffset} = 0; # if this is the very first run, look back 5 mintes in the past. $self->{laststate}->{logtime} = $self->{laststate}->{logtime} ? $self->{laststate}->{logtime} : $self->{eventlog}->{thisminute} - 600; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } # remember the last minute scanned. $self->{newstate}->{logtime} = $self->{eventlog}->{thisminute}; $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; $self->trace("last scanned until %s", scalar localtime $self->{laststate}->{logtime}); $self->{eventlog}->{distance} = 1 + int ((time - $self->{laststate}->{logtime}) / 60); $self->trace("analyze events from the last %d minutes", $self->{eventlog}->{distance}); $self->trace(sprintf "from %s to %s", scalar localtime (time - 60 * $self->{eventlog}->{distance}), scalar localtime time); if ((time - $self->{laststate}->{logtime}) > 60) { $self->{logmodified} = 1; $self->{eventlog}->{thenminute} = $self->{laststate}->{logtime}; $self->trace(sprintf "i will discard messages older than %s", scalar localtime $self->{eventlog}->{thenminute}); } else { # this happens if you call the plugin in too short intervals. $self->trace("please wait for a minute"); } } sub collectfiles { my $self = shift; my $fh = new IO::File; if ($self->{logmodified}) { my $command = sprintf "%s -c -d %d -l %s %s %s", $self->{eventlog}->{path}, $self->{eventlog}->{days} ? $self->{eventlog}->{days} : 1, $self->{eventlog}->{eventlog}, $self->{eventlog}->{computer} ? '\\\\'.$self->{eventlog}->{computer} : "", ($^O eq "cygwin") ? '2>/dev/null |' : '2>NUL |'; $self->trace("calling %s", $command); tie *{$fh}, 'Nagios::CheckLogfiles::Search::Dumpel::Handle', $command, $self->{eventlog}, $self->{options}, $self->{tivoli}, $self->{tracefile}; if ($fh->open($command)) { push(@{$self->{relevantfiles}}, { filename => "eventlog|", fh => $fh, seekable => 0, statable => 0, modtime => $self->{eventlog}->{nowminute}, fingerprint => "0:0" }); } else { $self->trace("cannot execute dumpel"); $self->addmatch('UNKNOWN', "cannot execute dumpel"); } } } sub getfilefingerprint { return 1; } sub finish { my $self = shift; foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { if (scalar(@{$self->{matchlines}->{$level}})) { foreach my $match (@{$self->{matchlines}->{$level}}) { $match =~ s/EE_WW_TT//; $match =~ s/EE_EE_TT//; $match =~ s/EE_UU_TT//; } } if (exists $self->{lastmsg} && exists $self->{lastmsg}->{$level}) { $self->{lastmsg}->{$level} =~ s/EE_WW_TT//; $self->{lastmsg}->{$level} =~ s/EE_EE_TT//; $self->{lastmsg}->{$level} =~ s/EE_UU_TT//; } } } sub rewind { my $self = shift; $self->loadstate(); foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->addmatch(0, "reset"); # 1 geht nicht weil NT sonst eine Minute vor 1970 landet beim loadstate $self->{eventlog}->{thisminute} = time - 3600 * 24 * 10; $self->savestate(); return $self; } package Nagios::CheckLogfiles::Search::Dumpel::Handle; use strict; use Exporter; use Time::Local; use POSIX qw(strftime); require Tie::Handle; use Carp; use IO::File; use vars qw(@ISA); @ISA = qw(Tie::Handle Nagios::CheckLogfiles::Search::Dumpel); our $AUTOLOAD; our $tracefile; our $eventlog = {}; our $options = {}; use constant EVENTLOG_SUCCESS => 0x0000; use constant EVENTLOG_ERROR_TYPE => 0x0001; use constant EVENTLOG_INFORMATION_TYPE => 0x0004; use constant EVENTLOG_WARNING_TYPE => 0x0002; use constant EVENTLOG_AUDIT_FAILURE => 0x0010; use constant EVENTLOG_AUDIT_SUCCESS => 0x0008; sub TIEHANDLE { my $class = shift; my $command = shift; $eventlog = shift; $options = shift; my $tivoli = shift; $tracefile = shift; my $self = {}; my $event = { 'Length' => undef, 'RecordNumber' => undef, 'TimeGenerated' => undef, 'Timewritten' => undef, 'EventID' => undef, 'EventType' => undef, 'Category' => undef, 'ClosingRecordNumber' => undef, 'Source' => undef, 'Computer' => undef, 'Strings' => undef, 'Data' => undef, 'User' => undef, }; $self = new IO::File; if (open $self, $command) { return bless $self, $class; # $self is a glob ref } else { return undef; } } sub SEEK { printf STDERR "i am SEEK\n"; } sub FETCH { printf STDERR "i am FETCH\n"; } sub STAT { printf STDERR "i am STAT\n"; my $self = shift; return (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } sub OPEN { my $self = shift; my $filename = shift; $self->CLOSE; open($self, $filename) or croak "can't reopen $filename: $!"; return 1; } sub CLOSE { my $self = shift; return close $self; } sub GETC { printf STDERR "i am GETC\n"; } sub READ { printf STDERR "i am READ\n"; } sub DESTROY { } sub EOF { my $self = shift; return eof $self; } sub READLINE { # default output dtTCISucs # t - time # d - date # T - event type # C - event category # I event ID # S event source # u - user # c - computer # s - strings # 04.01.12,15:37:21,4,0,11707,MsiInstaller,N/A,LAUSSER6,Product: ActivePerl 5.14.2 Build 1402 -- Installation operation completed successfully. my $self = shift; while (! eof($self)) { my $line = <$self>; if (! defined $line) { return undef; } $line =~ s/\015?\012?$//; $line =~ s/\s+$//; my($edate, $etime, $etype, $ecategory, $eid, $esource, $euser, $ecomputer, $estring) = split(/,/, $line, 9); my $timestamp = time; my $datetime = $edate.'#'.$etime; #if ($self->get_option('language') eq 'de') { if ($edate =~ /\d+\/\d+\/\d+/) { # 12/14/2005,10:08:41 AM,4,..... $datetime =~ /(\d+)\/(\d+)\/(\d+)#(\d+):(\d+):(\d+) (\w+)/; my ($month, $day, $year, $hour, $minute, $second, $pm) = ($1, $2, $3, $4, $5, $6, $7); $year += 2000 if $year < 100; $timestamp = timelocal($second, $minute, $hour, $day, $month - 1, $year); if ($pm eq 'PM') { $timestamp += 12 * 3600; } } else { # 04.01.12,15:30:11,1,0,.... $datetime =~ /(\d+)\.(\d+)\.(\d+)#(\d+):(\d+):(\d+)/; my ($day, $month, $year, $hour, $minute, $second) = ($1, $2, $3, $4, $5, $6); $year += 2000 if $year < 100; $timestamp = timelocal($second, $minute, $hour, $day, $month - 1, $year); } my $tmp_event = { 'Length' => 0, 'RecordNumber' => 0, 'TimeGenerated' => $timestamp, 'Timewritten' => $timestamp, 'EventID' => $eid, 'EventType' => $etype, 'Category' => $ecategory, 'ClosingRecordNumber' => 0, 'Source' => $esource, 'Computer' => $ecomputer, 'Strings' => $estring, 'Data' => "", 'User' => $euser, }; if ($tmp_event->{TimeGenerated} >= $eventlog->{thenminute} && $tmp_event->{TimeGenerated} < $eventlog->{thisminute}) { if (included($tmp_event, $eventlog->{include}) && ! excluded($tmp_event, $eventlog->{exclude})) { #printf STDERR "passed filter %s\n", Data::Dumper::Dumper($tmp_event); if (! $tmp_event->{Message}) { $tmp_event->{Message} = $tmp_event->{Strings}; $tmp_event->{Message} =~ s/\0/ /g; $tmp_event->{Message} =~ s/\s*$//g; } $tmp_event->{Message} = 'unknown message' if ! $tmp_event->{Message}; $tmp_event->{Message} =~ tr/\r\n/ /d; if ($options->{winwarncrit}) { if ($tmp_event->{EventType} == EVENTLOG_WARNING_TYPE) { $tmp_event->{Message} = "EE_WW_TT".$tmp_event->{Message}; } elsif ($tmp_event->{EventType} == EVENTLOG_ERROR_TYPE) { $tmp_event->{Message} = "EE_EE_TT".$tmp_event->{Message}; } } return format_message($options->{eventlogformat}, $tmp_event); } } # no return yet = all lines missed time/include/exclude filter # continue whth the while-loop and read the next line } # no more lines return undef; } sub AUTOLOAD { printf "uarghh %s\n", $AUTOLOAD; } sub format_message { my $eventlogformat = shift; my $event = shift; # formatstring: # %t EventType # %c Category # %s Source # %i EventID # %m Message # %w Timewritten # %g Timegenerated # %d Date/Time # %u User # not documented @ cpan my $tz = ''; my $format = {}; $format->{'%t'} = ($event->{EventType} == -1) ? 'Internal' : ($event->{EventType} == EVENTLOG_WARNING_TYPE) ? 'Warning' : ($event->{EventType} == EVENTLOG_ERROR_TYPE) ? 'Error' : ($event->{EventType} == EVENTLOG_INFORMATION_TYPE) ? 'Information' : ($event->{EventType} == EVENTLOG_AUDIT_SUCCESS) ? 'AuditSuccess' : ($event->{EventType} == EVENTLOG_AUDIT_FAILURE) ? 'AuditFailure' : ($event->{EventType} == EVENTLOG_SUCCESS) ? 'Success' : 'UnknType'; $format->{'%c'} = ! $event->{Category} ? 'None' : join('_', split(" ", $event->{Category})); $format->{'%s'} = join('_', split(" ", $event->{Source})); $format->{'%i'} = sprintf '%04d', $event->{EventID} & 0xffff; $format->{'%m'} = $event->{Message}; $format->{'%w'} = strftime("%Y-%m-%dT%H:%M:%S", localtime($event->{Timewritten})).$tz; $format->{'%g'} = strftime("%Y-%m-%dT%H:%M:%S", localtime($event->{TimeGenerated})).$tz; $format->{'%W'} = $event->{Timewritten}; $format->{'%G'} = $event->{TimeGenerated}; $format->{'%u'} = $event->{User} || 'undef'; my $message = $eventlogformat; foreach (keys %{$format}) { $message =~ s/$_/$format->{$_}/g; } $event->{Message} = $message; } sub included { my $event = shift; my $filter = shift; my $filters = 0; my $matches = {}; # EventCategory ist ein INTEGER!!! # und ausserdem ist pro Source ein eigener Satz von Kategorien moeglich # man muesste deren Bezeichnungen aus der Registry lesen. # in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application # stehen die Sources, die eigene Kategorien definiert haben. # Im Key CategoryMessageFile ist die Datei hinterlegt, der die Kategorien # entnommen werden koennen. In CategoryCount steht die Anzahl der # selbstdefinierten Kategorien. foreach my $attr (qw(Source Category)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; if (lc $item eq lc $event->{$attr}) { #printf "-> %s eq %s\n", lc $item, lc $event->{$attr}; $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; $matches->{$attr}++; } } foreach my $attr (qw(EventID)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; #if (lc $item eq lc ($event->{$attr} & 0xffff)) { if ($item == ($event->{$attr} & 0xffff)) { #printf "-> %s eq %s\n", lc $item, lc ($event->{$attr} & 0xffff); $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; $matches->{$attr}++; } } foreach my $attr (qw(EventType)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { if ((lc $item =~ /^succ/ && $event->{$attr} == EVENTLOG_SUCCESS) || (lc $item =~ /warn/ && $event->{$attr} == EVENTLOG_WARNING_TYPE) || (lc $item =~ /err/ && $event->{$attr} == EVENTLOG_ERROR_TYPE) || (lc $item =~ /info/ && $event->{$attr} == EVENTLOG_INFORMATION_TYPE) || (lc $item =~ /audit.*succ/ && $event->{$attr} == EVENTLOG_AUDIT_SUCCESS) || (lc $item =~ /fail/ && $event->{$attr} == EVENTLOG_AUDIT_FAILURE)) { #printf "type %s matched\n", $item; $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; $matches->{$attr}++; } } if ($filter->{operation} eq 'and') { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 4) ? 1 : 0; } else { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 0) ? 0 : 1; } } sub excluded { my $event = shift; my $filter = shift; my $filters = 0; my $matches = {}; # EventCategory ist ein INTEGER!!! foreach my $attr (qw(Source Category)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; if (lc $item eq lc $event->{$attr}) { #printf "-> %s eq %s\n", lc $item, lc $event->{$attr}; $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; #$matches->{$attr}++; } } foreach my $attr (qw(EventID)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { #printf "items: %s ? %s\n", $item, $event->{$attr}; #if (lc $item eq lc ($event->{$attr} & 0xffff)) { if ($item == ($event->{$attr} & 0xffff)) { #printf "-> %s eq %s\n", lc $item, lc ($event->{$attr} & 0xffff); $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; #$matches->{$attr}++; } } foreach my $attr (qw(EventType)) { $matches->{$attr} = 0; if (exists $filter->{$attr}) { foreach my $item (split(',', $filter->{$attr})) { if ((lc $item =~ /^succ/ && $event->{$attr} == EVENTLOG_SUCCESS) || (lc $item =~ /warn/ && $event->{$attr} == EVENTLOG_WARNING_TYPE) || (lc $item =~ /err/ && $event->{$attr} == EVENTLOG_ERROR_TYPE) || (lc $item =~ /info/ && $event->{$attr} == EVENTLOG_INFORMATION_TYPE) || (lc $item =~ /audit.*succ/ && $event->{$attr} == EVENTLOG_AUDIT_SUCCESS) || (lc $item =~ /fail/ && $event->{$attr} == EVENTLOG_AUDIT_FAILURE)) { #printf "type %s matched\n", $item; $matches->{$attr}++; } } } else { #printf "no filter for %s\n", $attr; #$matches->{$attr}++; } } #printf "%s\n", Data::Dumper::Dumper($matches); if ($filter->{operation} eq 'and') { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 4) ? 1 : 0; } else { return (scalar(grep { $matches->{$_} } keys %{$matches}) == 0) ? 0 : 1; } } sub trace { my $format = shift; if (-f $tracefile) { my $logfh = new IO::File; $logfh->autoflush(1); if ($logfh->open($tracefile, "a")) { $logfh->printf("%s: ", scalar localtime); $logfh->printf($format, @_); $logfh->printf("\n"); $logfh->close(); } } } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Dummy.pm0000755000175000017500000000145714336703157023350 00000000000000package Nagios::CheckLogfiles::Search::Dummy; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = sprintf "%s/dummy.%s", $self->{seekfilesdir}, $self->{tag}; $self->SUPER::init($params); } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; } sub loadstate { my $self = shift; $self->SUPER::loadstate(); } sub savestate { my $self = shift; } sub analyze_situation { my $self = shift; } sub collectfiles { my $self = shift; } check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Errpt.pm0000755000175000017500000000765414336703157023356 00000000000000package Nagios::CheckLogfiles::Search::Errpt; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = sprintf "%s/errpt.%s", $self->{seekfilesdir}, $self->{tag}; $self->SUPER::init($params); $self->{clo} = { path => $params->{errpt}->{path} ? $params->{errpt}->{path} : "/usr/bin/errpt", errortype => $params->{errpt}->{errortype}, errorclass => $params->{errpt}->{errorclass}, errorlabel => $params->{errpt}->{errorlabel}, errorresource => $params->{errpt}->{errorresource}, }; $self->addfilter(0, 'IDENTIFIER TIMESTAMP'); } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; # the last minute is the end time. in-progess minutes are not # interesting yet. my($sec, $min, $hour, $mday, $mon, $year) = #(localtime $self->{macros}->{CL_DATE_TIMESTAMP})[0, 1, 2, 3, 4, 5]; # macro is not suitable for testing because it is not updated (localtime time)[0, 1, 2, 3, 4, 5]; $self->{errpt}->{endtime} = timelocal(0, $min, $hour, $mday, $mon, $year) - 60; } sub loadstate { my $self = shift; $self->SUPER::loadstate(); # always scan the whole output. thst's what starttime is for. $self->{laststate}->{logoffset} = 0; # if this is the very first run, look back 5 mintes in the past. $self->{errpt}->{starttime} = $self->{laststate}->{logtime} ? $self->{laststate}->{logtime} + 60 : $self->{errpt}->{endtime} - 300; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } # remember the last minute scanned. $self->{newstate}->{logtime} = $self->{errpt}->{endtime}; $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; if ($self->{errpt}->{starttime} <= $self->{errpt}->{endtime}) { $self->{logmodified} = 1; } else { # this happens if you call the plugin in too short intervals. $self->trace("%s not before %s", scalar localtime $self->{errpt}->{starttime}, scalar localtime $self->{errpt}->{endtime}); } } sub collectfiles { my $self = shift; my $fh = new IO::File; if ($self->{logmodified}) { my($sec, $min, $hour, $mday, $mon, $year) = (localtime $self->{errpt}->{starttime})[0, 1, 2, 3, 4, 5]; $self->{errpt}->{ibmstarttime} = sprintf "%02d%02d%02d%02d%02d", $mon + 1, $mday, $hour, $min, substr($year + 1900, 2, 2); ($sec, $min, $hour, $mday, $mon, $year) = (localtime $self->{errpt}->{endtime})[0, 1, 2, 3, 4, 5]; $self->{errpt}->{ibmendtime} = sprintf "%02d%02d%02d%02d%02d", $mon + 1, $mday, $hour, $min, substr($year + 1900, 2, 2); my $errpt = sprintf "%s -s %s -e %s %s %s %s %s|", $self->{clo}->{path}, $self->{errpt}->{ibmstarttime}, $self->{errpt}->{ibmendtime}, $self->{clo}->{errortype} ? '-T '.$self->{clo}->{errortype} : "", $self->{clo}->{errorclass} ? '-d '.$self->{clo}->{errorclass} : "", $self->{clo}->{errorlabel} ? '-J '.$self->{clo}->{errorlabel} : "", $self->{clo}->{errorresource} ? '-N '.$self->{clo}->{errorresource} : ""; $self->trace("calling %s", $errpt); $self->trace("calling errpt -s (%s) -e (%s)", scalar localtime $self->{errpt}->{starttime}, scalar localtime $self->{errpt}->{endtime}); if ($fh->open($errpt)) { push(@{$self->{relevantfiles}}, { filename => "errpt|", fh => $fh, seekable => 0, statable => 1, modtime => $self->{errpt}->{endtime}, fingerprint => "0:0" }); } else { $self->trace("cannot execute errpt"); $self->addmatch('UNKNOWN', "cannot execute errpt"); } } } check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Dmesg.pm0000755000175000017500000002446014336703157023313 00000000000000package Nagios::CheckLogfiles::Search::Dmesg; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = '/dmesg/is/cool'; $self->default_options({ warncrit => 0, randominode => 1, dmesgformat => "%w %c: %m" }); $self->SUPER::init($params); if ($self->get_option('warncrit')) { push(@{$self->{patterns}->{WARNING}}, "EE_WW_TT"); push(@{$self->{patterns}->{CRITICAL}}, "EE_EE_TT"); push(@{$self->{patternfuncs}->{WARNING}}, eval "sub { local \$_ = shift; return m/EE_WW_TT/o; }"); push(@{$self->{patternfuncs}->{CRITICAL}}, eval "sub { local \$_ = shift; return m/EE_EE_TT/o; }"); } push(@{$self->{patterns}->{UNKNOWN}}, "EE_UU_TT"); push(@{$self->{patternfuncs}->{UNKNOWN}}, eval "sub { local \$_ = shift; return m/EE_UU_TT/o; }"); $self->{dmesg} = { path => $params->{dmesg}->{path} ? $params->{dmesg}->{path} : "/bin/dmesg", currentsecond => time, }; } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; $self->trace(sprintf "i will discard messages newer or equal than %s", scalar localtime $self->{dmesg}->{currentsecond}); } sub loadstate { my $self = shift; $self->SUPER::loadstate(); # always scan the whole output. thst's what starttime is for. $self->{laststate}->{logoffset} = 0; # if this is the very first run, look back 5 mintes in the past. $self->{laststate}->{logtime} = $self->{laststate}->{logtime} ? $self->{laststate}->{logtime} : $self->{dmesg}->{currentsecond} - 600; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } # remember the second when we started (events with a timestamp >= this are ignored) $self->{newstate}->{logtime} = $self->{dmesg}->{currentsecond}; $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; if ($self->{dmesg}->{currentsecond} == $self->{laststate}->{logtime}) { # this happens if you call the plugin in too short intervals. $self->trace("please wait for a second"); } else { # >= $self->{laststate}->{logtime} and < $self->{dmesg}->{currentsecond} $self->trace("last scanned until (not including) %s", scalar localtime $self->{laststate}->{logtime}); $self->{dmesg}->{distance} = int(($self->{dmesg}->{currentsecond} - $self->{laststate}->{logtime}) / 60); $self->trace("analyze events from the last %d minutes", $self->{dmesg}->{distance}); $self->trace(sprintf ">= %s < %s", scalar localtime $self->{laststate}->{logtime}, scalar localtime $self->{dmesg}->{currentsecond}); $self->{logmodified} = 1; # eingeschlossen $self->{dmesg}->{fromsecond} = $self->{laststate}->{logtime}; # ausgeschlossen $self->{dmesg}->{tosecond} = $self->{dmesg}->{currentsecond}; } } sub collectfiles { my $self = shift; my $fh = new IO::File; if ($self->{logmodified}) { my $command = sprintf "%s -x 2>/dev/null |", $self->{dmesg}->{path}; $self->trace("calling %s", $command); tie *{$fh}, 'Nagios::CheckLogfiles::Search::Dmesg::Handle', $command, $self->{dmesg}, $self->{options}, $self->{tracefile}; if ($fh->open($command)) { push(@{$self->{relevantfiles}}, { filename => "dmesg|", fh => $fh, seekable => 0, statable => 0, modtime => $self->{dmesg}->{nowminute}, fingerprint => "0:0" }); } else { $self->trace("cannot execute dmesg"); $self->addmatch('UNKNOWN', "cannot execute dmesg"); } } } sub getfilefingerprint { return 1; } sub finish { my $self = shift; foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { if (scalar(@{$self->{matchlines}->{$level}})) { foreach my $match (@{$self->{matchlines}->{$level}}) { $match->[1] =~ s/EE_WW_TT//; $match->[1] =~ s/EE_EE_TT//; $match->[1] =~ s/EE_UU_TT//; } } if (exists $self->{lastmsg} && exists $self->{lastmsg}->{$level}) { $self->{lastmsg}->{$level} =~ s/EE_WW_TT//; $self->{lastmsg}->{$level} =~ s/EE_EE_TT//; $self->{lastmsg}->{$level} =~ s/EE_UU_TT//; } } } sub rewind { my $self = shift; $self->{dmesg}->{currentsecond} = 1; $self->SUPER::rewind(); return $self; } package Nagios::CheckLogfiles::Search::Dmesg::Handle; use strict; use Exporter; use Time::Local; use POSIX qw(strftime); require Tie::Handle; use Carp; use IO::File; use vars qw(@ISA); @ISA = qw(Tie::Handle Nagios::CheckLogfiles::Search::Dmesg); our $AUTOLOAD; our $tracefile; our $dmesg = {}; our $options = {}; our $uptime = undef; our $boottime = undef; sub TIEHANDLE { my $class = shift; my $command = shift; $dmesg = shift; $options = shift; $tracefile = shift; ($uptime) = do { local @ARGV="/proc/uptime";<>}; ($uptime) = ($uptime =~ /^([\d\.]+)/); # zumindest unter wsl2 springt die boottime in der gegend rum. # update, auch auf servern mit enterprise-linuxen kann es vorkommen, # dass der folgende boottime-wert schwankt. das hat zur folge, dass # events unerkannt durchrutschen koennen. es liegt nicht in meiner macht, # das zu aendern. beschwert euch beim torvalds oder bei dem distributor, # dem ihr jedem monat ein vermoegen in den rachen schmeisst. # aber schon klar, ihr werdet das nicht machen, sondern stattdessen # mir mit eurem gewinsel auf den sack gehen. $boottime = time - $uptime; my $self = {}; $self = new IO::File; if (open $self, $command) { return bless $self, $class; # $self is a glob ref } else { return undef; } } sub SEEK { printf STDERR "i am SEEK\n"; } sub FETCH { printf STDERR "i am FETCH\n"; } sub STAT { printf STDERR "i am STAT\n"; my $self = shift; return (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } sub OPEN { my $self = shift; my $filename = shift; $self->CLOSE; open($self, $filename) or croak "can't reopen $filename: $!"; return 1; } sub CLOSE { my $self = shift; return close $self; } sub GETC { printf STDERR "i am GETC\n"; } sub READ { printf STDERR "i am READ\n"; } sub DESTROY { } sub EOF { my $self = shift; return eof $self; } sub READLINE { my $self = shift; while (! eof($self)) { my $line = <$self>; if (! defined $line) { return undef; } # kern :warn : [ 2.939748] OTG VER PARAM: 0, OTG VER FLAG: 0 # kern :warn : [ 2.942712] Dedicated Tx FIFOs mode # # kern :warn : [ 2.946352] WARN::dwc_otg_hcd_init:1074: FIQ DMA bounce buffers: virt = b7504000 dma = 0xf7504000 len=9024 # kern :warn : [ 2.955065] FIQ FSM acceleration enabled for : # Non-periodic Split Transactions # Periodic Split Transactions # High-Speed Isochronous Endpoints # Interrupt/Control Split Transaction hack enabled # kern :debug : [ 2.969719] dwc_otg: Microframe scheduler enabled # # kern :warn : [ 2.969791] WARN::hcd_init_fiq:457: FIQ on core 1 # # kern :warn : [ 2.975200] WARN::hcd_init_fiq:458: FIQ ASM at 807cb8b8 length 36 # # kern :warn : [ 2.980487] WARN::hcd_init_fiq:497: MPHI regs_base at bb810000 # kern :info : [ 2.985907] dwc_otg 3f980000.usb: DWC OTG Controller if (! $line) { next; } if ($line !~ /^\w+\s*:\w+\s*: \[/) { next; } my($origin, $level, $message) = split(/:/, $line, 3); ( $origin =~ /^\s+/ ) && ( substr( $origin, 0, $+[ 0 ] ) = "" ); ( $origin =~ /\s+$/ ) && ( substr( $origin, $-[ 0 ] ) = "" ); ( $level =~ /^\s+/ ) && ( substr( $level, 0, $+[ 0 ] ) = "" ); ( $level =~ /\s+$/ ) && ( substr( $level, $-[ 0 ] ) = "" ); $message =~ /^\s*\[\s*(([\d]+)\.\d+)\]\s*(.*)$/; my $timegenerated = $boottime + $1; my $finetime = $boottime + $2; my $tmp_event = { 'Category' => $origin, 'Level' => $level, 'TimeGenerated' => $timegenerated, 'FineTimeGenerated' => $finetime, 'Message' => $3, }; if ($tmp_event->{TimeGenerated} >= $dmesg->{fromsecond} && $tmp_event->{TimeGenerated} < $dmesg->{tosecond}) { $tmp_event->{Message} =~ tr/\r\n/ /d; if ($options->{warncrit}) { if ($tmp_event->{Level} eq "warn") { $tmp_event->{Message} = "EE_WW_TT".$tmp_event->{Message}; } elsif ($tmp_event->{Level} =~ /^(err|crit|alert|emerg)/) { $tmp_event->{Message} = "EE_EE_TT".$tmp_event->{Message}; } } return format_message($options->{dmesgformat}, $tmp_event); } # no return yet = all lines missed time/include/exclude filter # continue whth the while-loop and read the next line } # no more lines return undef; } sub format_message { my $dmesgformat = shift; my $event = shift; # formatstring: # %t Level # %s Source (kern, daemon, syslog...) # %c Category (the program, systemd, blk_update_request,..) # %m Message # %w Timewritten #$event->{Message} =~ tr/\r\n/ /d; my $tz = ''; my $format = {}; $format->{'%t'} = $event->{Level}; $format->{'%c'} = ! $event->{Category} ? 'None' : join('_', split(" ", $event->{Category})); $format->{'%C'} = ! $event->{Category} ? 'None' : $event->{Category}; $format->{'%m'} = $event->{Message}; $format->{'%w'} = strftime("%Y-%m-%dT%H:%M:%S", localtime($event->{TimeGenerated})).$tz; $format->{'%W'} = $event->{TimeGenerated}; my $message = $dmesgformat; foreach (keys %{$format}) { $message =~ s/$_/$format->{$_}/g; } while ($message =~ /%(\d+)m/) { my $search = "%".$1."m"; my $replace = sprintf "%.".$1."s", $event->{Message}; $message =~ s/$search/$replace/g; } $event->{Message} = $message; } sub AUTOLOAD { printf "uarghh %s\n", $AUTOLOAD; } sub trace { my $format = shift; if (-f $tracefile) { my $logfh = new IO::File; $logfh->autoflush(1); if ($logfh->open($tracefile, "a")) { $logfh->printf("%s: ", scalar localtime); $logfh->printf($format, @_); $logfh->printf("\n"); $logfh->close(); } } } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Ipmitool.pm0000755000175000017500000001144514336703157024047 00000000000000package Nagios::CheckLogfiles::Search::Ipmitool; # http://download.intel.com/design/servers/ipmi/IPMIv2_0rev1_0.pdf # # SEL Entries have a unique `Record ID' field. This field is used for # retrieving log entries from the SEL. SEL reading can be done in # a `random access' manner. That is, SEL Entries can be read in any # order assuming that the Record ID is known. # SEL Record IDs 0000h and FFFFh are reserved for functional use # and are not legal ID values. Record IDs are handles. They are not # required to be sequential or consecutive. Applications should not # assume that SEL Record IDs will follow any particular numeric ordering. # # Man beachte die letzten beiden Saetze. Sollte der dafuer Verantwortliche # diese Zeilen lesen: Ich finde dich, du Schwein! use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); require Digest::MD5; # qw(md5_base64); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search::Simple); sub new { my $self = bless { eventids => [], eventbuffer => [], }, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{logfile} = sprintf "%s/ipmitool.%s", $self->{seekfilesdir}, $self->{tag}; $self->SUPER::init($params); $self->{clo} = { path => $params->{ipmitool}->{path} ? $params->{ipmitool}->{path} : "/usr/bin/ipmitool", ## cache => exists $params->{ipmitool}->{cache} ? 1 : 0, ## using a local cache makes no sense here ## maybe checking remote sdr will be a feature in the future extraparams => exists $params->{ipmitool}->{extraparams} ? $params->{ipmitool}->{extraparams} : "", listcmd => exists $params->{ipmitool}->{elist} ? "elist" : "list", }; } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; $self->{logfile} = sprintf "%s/ipmitool.sel.dump.%s", $self->system_tempdir(), $self->{tag}; $self->{sdrcache} = sprintf "%s/ipmitool.sdr.cache", $self->system_tempdir(); #$self->trace("cache param %s %s", $self->{clo}->{cache}, $self->{sdrcache}); #$self->trace("list cmd %s", $self->{clo}->{listcmd}); #$self->trace("time - foo %s", (time - (stat($self->{sdrcache}))[9])); #$self->trace("system comand: %s %s", $self->{clo}->{path}, $self->{sdrcache}); if ($self->{clo}->{cache} && (! -f $self->{sdrcache} || ((time - (stat($self->{sdrcache}))[9]) > 86400))) { ## $self->trace("creating/refreshing sdr cache %s", $self->{sdrcache}); ## system($self->{clo}->{path}.' sdr dump '.$self->{sdrcache}.' >/dev/null 2>&1'); } unlink $self->{logfile}; my $ipmitool_sel_list = sprintf "%s %s %s sel %s 2>&1 |", $self->{clo}->{path}, $self->{clo}->{extraparams}, $self->{clo}->{cache} ? "-S $self->{sdrcache}" : "", $self->{clo}->{listcmd}; my $ipmitool_fh = new IO::File; my $spool_fh = new IO::File; $self->trace("executing %s", $ipmitool_sel_list); # 8 | 08/10/2007 | 15:09:00 | Power Unit #0x01 | Power off/down # 9 | Pre-Init Time-stamp | Chassis #0xa9 | State Asserted if ($ipmitool_fh->open($ipmitool_sel_list)) { while (my $event = $ipmitool_fh->getline()) { chomp $event; next if $event =~ /SEL has no entries/; push(@{$self->{eventlog}->{eventbuffer}}, $event); } $ipmitool_fh->close(); } $self->trace("wrote spoolfile %s", $self->{logfile}); } sub loadstate { my $self = shift; $self->SUPER::loadstate(); $self->{eventlog}->{last_eventids} = $self->{laststate}->{eventids} || []; $self->{laststate}->{logoffset} = 0; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->{newstate}->{eventids} = $self->{eventlog}->{eventids}; $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; my $spool_fh = new IO::File; if ($spool_fh->open('>'.$self->{logfile})) { foreach my $event (@{$self->{eventlog}->{eventbuffer}}) { if ($event =~ /^\s*(\w+)\s*\|/) { my $eventid = $1; push(@{$self->{eventlog}->{eventids}}, $eventid); if (! grep { $eventid eq $_ } @{$self->{eventlog}->{last_eventids}}) { $self->trace("found new eventid %s", $eventid); $event =~ s/\|/;/g; $spool_fh->printf("%s\n", $event); $self->{logmodified} = 1; $self->{logrotated} = 1; } } else { $self->trace("no match eventid %s", $event); } } $spool_fh->close(); } } sub rewind { my $self = shift; $self->loadstate(); foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->addmatch(0, "reset"); $self->{newstate}->{eventids} = []; $self->savestate(); return $self; } check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Executable.pm0000755000175000017500000000404514336703157024332 00000000000000package Nagios::CheckLogfiles::Search::Executable; use strict; use Exporter; use File::Basename; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->default_options({ exeargs => "", }); $self->SUPER::init($params); } sub analyze_situation { my $self = shift; $self->{logmodified} = 1; } sub collectfiles { my $self = shift; my @rotatedfiles = (); my $fh = new IO::File; #if ($self->getfileisreadable($self->{logfile})) { if ($self->getfileisexecutable($self->{logfile})) { my $cmdline = $self->{logfile}. ($self->get_option('exeargs') ? " ".$self->get_option('exeargs') : ""). " 2>&1|"; $fh->open($cmdline); $self->trace("opened command %s", $cmdline); push(@{$self->{relevantfiles}}, { filename => $self->{logfile}, fh => $fh, seekable => 0, statable => 1, modtime => time, fingerprint => "0:0" }); } else { if (-e $self->{logfile}) { # permission problem $self->trace("could not open logfile %s", $self->{logfile}); $self->addmatch('CRITICAL', sprintf "could not open logfile %s", $self->{logfile}); } else { if ($self->get_option('logfilenocry')) { $self->trace("could not find scriptfile %s", $self->{logfile}); $self->addmatch($self->get_option('logfilemissing'), sprintf "could not find scriptfile %s", $self->{logfile}); } else { # dont care. $self->trace("could not find scriptfile %s, but that's ok", $self->{logfile}); } } } } sub loadstate { my $self = shift; $self->SUPER::loadstate(); $self->{laststate}->{logoffset} = 0; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->SUPER::savestate(); } check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Search/Oraclealertlog.pm0000755000175000017500000001104414336703157025205 00000000000000package Nagios::CheckLogfiles::Search::Oraclealertlog; use strict; use Exporter; use File::Basename; use Time::Local; use IO::File; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{oraalert}->{tns} = { connect => $params->{oraclealertlog}->{connect} || $params->{oraclealertlog}->{sid}, username => $params->{oraclealertlog}->{username}, password => $params->{oraclealertlog}->{password}, }; $self->{logfile} = sprintf "%s/alertlog.%s.%s", $self->{seekfilesdir}, $self->{tag}, $self->{oraalert}->{tns}->{connect}; $self->SUPER::init($params); $self->resolve_macros(\$self->{oraalert}->{tns}->{connect}); $self->resolve_macros(\$self->{oraalert}->{tns}->{username}); $self->resolve_macros(\$self->{oraalert}->{tns}->{password}); return $self; } sub prepare { my $self = shift; $self->{options}->{nologfilenocry} = 1; # the last second is the end time. in-progess seconds are not # interesting yet. $self->{oraalert}->{highestfound} = 0; } sub loadstate { my $self = shift; $self->SUPER::loadstate(); # always scan the whole output. thst's what starttime is for. $self->{laststate}->{logoffset} = 0; # if this is the very first run, look back 5 mintes in the past. # hopefully the clocks are synchronized $self->{laststate}->{logtime} = $self->{laststate}->{logtime} ? $self->{laststate}->{logtime} : time - 300; } sub savestate { my $self = shift; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } # remember the last second scanned. $self->{newstate}->{logtime} = $self->{oraalert}->{highestfound} ? $self->{oraalert}->{highestfound} : $self->{laststate}->{logtime}; $self->SUPER::savestate(); } sub analyze_situation { my $self = shift; $self->trace("last scanned until %s", scalar localtime $self->{laststate}->{logtime}); $self->{logmodified} = 1; } sub collectfiles { my $self = shift; my $fh = new IO::File; if ($self->{logmodified}) { # open database connection and select rows created # since $self->{laststate}->{logtime} and now (db now, not plugin now) my $linesread = 0; eval { require DBI; if (my $dbh = DBI->connect( sprintf("DBI:Oracle:%s", $self->{oraalert}->{tns}->{connect}), $self->{oraalert}->{tns}->{username}, $self->{oraalert}->{tns}->{password}, { RaiseError => 1, PrintError => 0 })) { $dbh->do(q{ ALTER SESSION SET NLS_NUMERIC_CHARACTERS=".," }); # suchen bis zur letzten abgeschlossenen sekunde (inklusive) my $sql = q{ SELECT alert_timestamp, alert_text FROM alert_log WHERE ROUND(alert_timestamp) > ? AND alert_date <= SYSDATE - 1/86400 ORDER BY alert_timestamp }; if (my $sth = $dbh->prepare($sql)) { $self->trace(sprintf "select events between %d and now (%s and sysdate())", $self->{laststate}->{logtime}, scalar localtime $self->{laststate}->{logtime}); $sth->execute($self->{laststate}->{logtime}); if (my $fh = new IO::File($self->{logfile}, "w")) { while(my($alert_timestamp, $alert_text) = $sth->fetchrow_array()) { next if ! $alert_text; # es gibt auch leere Zeilen # bei ora-perl-conversion gibts manchmal 1234567890.999999999 $alert_timestamp = int(0.5 + $alert_timestamp); $fh->printf("%s %s\n", scalar localtime $alert_timestamp, $alert_text); $self->{oraalert}->{highestfound} = $alert_timestamp; $linesread++; } $fh->close(); } $sth->finish(); } $dbh->disconnect(); } }; if ($@) { $self->trace(sprintf "database operation failed: %s", $@); $self->addmatch('UNKNOWN', sprintf "database operation failed: %s", $@); } $self->trace(sprintf "read %d lines from database", $linesread); if ($linesread) { if (my $fh = new IO::File($self->{logfile}, "r")) { $self->trace(sprintf "reopen logfile"); push(@{$self->{relevantfiles}}, { filename => "eventlog|", fh => $fh, seekable => 0, statable => 1, modtime => time, # not relevant because already analyzed fingerprint => "0:0" }); } } } } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles/Test.pm0000755000175000017500000004745514336703157021777 00000000000000package Nagios::CheckLogfiles::Test; use strict; use Exporter; use Nagios::CheckLogfiles; use File::Basename; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles); sub new { my $class = shift; my $params = shift; my $self = $class->SUPER::new($params); foreach my $search (@{$self->{searches}}) { # adds access to the test methods no strict 'refs'; my $isa = ref($search).'::ISA'; push(@{$isa}, "Nagios::CheckLogfiles::Search::Test"); } return bless $self, $class; } sub remove_windows_plugin { my $self = shift; system("mv ../plugins-scripts/check_logfiles.unix ../plugins-scripts/check_logfiles"); } sub make_windows_plugin { my $self = shift; system("mv ../plugins-scripts/check_logfiles ../plugins-scripts/check_logfiles.unix"); system("cd ..; perl winconfig.pl"); } sub reset { my $self = shift; $self->{allerrors} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; foreach my $level (qw(OK CRITICAL WARNING UNKNOWN)) { $self->{lastmsg}->{$level} = ""; } foreach my $search (@{$self->{searches}}) { $search->reset(); } } sub reset_run { my $self = shift; $self->reset(); $self->run(); } sub get_search_by_tag { my $self = shift; my $tag = shift; foreach (@{$self->{searches}}) { if ($_->{tag} eq $tag) { return $_; } } return undef; } sub get_search_by_template { my $self = shift; my $tag = shift; foreach (@{$self->{searches}}) { if ($_->{template} eq $tag) { return $_; } } return undef; } sub expect_result { my $self = shift; my $expect = { OK => shift, WARNING => shift, CRITICAL => shift, UNKNOWN => shift }; my $exp_exit = shift; my $as_expected = 1; foreach (keys %{$expect}) { if (defined $expect->{$_}) { if ($expect->{$_} != $self->{allerrors}->{$_}) { $as_expected = 0; } } } if ($self->{exitcode} != $exp_exit) { $as_expected = 0; } return $as_expected; } sub has_result { my $self = shift; return join(", ", (map { $self->{allerrors}->{$_} } qw(OK WARNING CRITICAL UNKNOWN)), $self->{exitcode}); } sub create_file { my $self = shift; my $file = shift; my $perms = shift; my $contents = shift; open CCC, ">$file"; print CCC $contents; close CCC; chmod $perms, $file; } sub delete_file { my $self = shift; my $file = shift; unlink $file; } sub read_file { my $self = shift; my $file = shift; if (-r $file) { local( $/, *FFF ) ; open FFF, "<$file"; my $content = ; close FFF; return $content; } else { return ""; } } package Nagios::CheckLogfiles::Search::Test; use strict; use Exporter; use File::Basename; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $class = shift; my $params = shift; my $self = $class->SUPER::new($params); printf STDERR "i %s new prefilter %s\n", $self->{tag}, $self->{prefilter}; return bless $self, $class; } sub reset { my $self = shift; #printf STDERR "i %s renew prefilter %s with tag %s\n", $self->{tag}, $self->{prefilter}, $self->{macros}->{CL_TAG}; $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{lastmsg} = { OK => "", WARNING => "", CRITICAL => "", UNKNOWN => "" }; $self->{negpatterncnt} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{thresholdcnt} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; #$self->{preliminaryfilter} = { SKIP => [], NEED => [] }; $self->{perfdata} = ""; foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { foreach my $pat (@{$self->{negpatterns}->{$level}}) { push(@{$self->{negpatterncnt}->{$level}}, 0); } } if (exists $self->{template} && exists $self->{dynamictag}) { $self->{macros}->{CL_TAG} = $self->{dynamictag}; $self->{macros}->{CL_TEMPLATE} = $self->{template}; } else { #$self->resolve_macros(\$self->{tag}); $self->{macros}->{CL_TAG} = $self->{tag}; } delete $self->{lastlogoffset}; delete $self->{lastlogtime}; delete $self->{lastlogoffset}; delete $self->{lastlogfile}; delete $self->{newlogoffset}; delete $self->{newlogtime}; delete $self->{newdevino}; delete $self->{newlogfile}; delete $self->{tracebuffer}; delete $self->{laststate}; delete $self->{matchlines}; $self->{relevantfiles} = []; $self->{logrotated} = 0; $self->{logmodified} = 0; $self->{linesread} = 0; $self->{relevantfiles} = []; if (exists $self->{options}->{sticky}) { $self->{options}->{sticky} = 1 if ($self->{options}->{sticky} > 1); } return $self; } sub dump_trace { my $self = shift; foreach (@{$self->{tracebuffer}}) { printf STDERR "%s\n", $_; } } sub delete_logfile { my $self = shift; my $rndfile; $self->{oldrandomfile} = $self->{randomfile}; if (-e $self->{logfile}) { $self->trace(sprintf "D1 logfile %s %d", $self->{logfile}, (stat $self->{logfile})[1]); unlink $self->{logfile}; # reuse the inode immediately $self->{randomfile} = sprintf "%s/this_is_random.%d", dirname($self->{logfile}), int(rand 1000); $rndfile = IO::File->new(); $rndfile->open(">$self->{randomfile}"); $rndfile->printf("\n"); $rndfile->close(); sleep 1; #system("touch $self->{randomfile}"); $self->trace(sprintf "D2 rndfile %d", (stat $self->{randomfile})[1]); if ($self->{oldrandomfile} && -f $self->{oldrandomfile}) { $self->trace(sprintf "D3 rndfile %d", (stat $self->{oldrandomfile})[1]); unlink $self->{oldrandomfile}; } delete $self->{oldrandomfile}; } if ($self->{rotation}) { $self->delete_archives(); } } sub delete_seekfile { my $self = shift; if (-e $self->{seekfile}) { $self->trace(sprintf "D1 seekfile %s %d", $self->{seekfile}, (stat $self->{seekfile})[1]); unlink $self->{seekfile}; } else { $self->trace(sprintf "D2 seekfile %s", $self->{seekfile}); } } sub delete_archives { my $self = shift; foreach my $archive (glob $self->{archivedir}.'/*') { if ($archive ne $self->{logfile}) { unlink $archive; } } } sub touch_logfile { my $self = shift; my $logfh = IO::File->new(); $logfh->autoflush(1); $logfh->open($self->{logfile}, "a"); $logfh->close(); } sub truncate_logfile { my $self = shift; truncate($self->{logfile}, 0); } sub restrict_logfile { my $self = shift; if ($^O =~ /MSWin/) { my $winlogfile = $self->{logfile}; $winlogfile =~ s/\//\\/g; my $cmd = sprintf "CACLS %s /D %s /E", $winlogfile, $self->{macros}->{CL_USERNAME}; $self->trace("%s", $cmd); system($cmd); } else { chmod 0000, $self->{logfile}; } } sub unrestrict_logfile { my $self = shift; if ($^O =~ /MSWin/) { my $winlogfile = $self->{logfile}; $winlogfile =~ s/\//\\/g; my $cmd = sprintf "CACLS %s /G %s:F /E", $winlogfile, $self->{macros}->{CL_USERNAME}; $self->trace("%s", $cmd); system($cmd); } else { chmod 0644, $self->{logfile}; } } sub dump_seekfile { my $self = shift; my $seekfh = IO::File->new(); if ($seekfh->open($self->{seekfile}, "r")) { while (my $line = $seekfh->getline()) { printf "%s", $line; } $seekfh->close(); } } sub rotate { my $self = shift; my $method = shift || $self->{rotation}; if ($method eq "SOLARIS") { my $oldest = 0; foreach my $archive (glob $self->{archivedir}.'/messages.*') { if ($archive =~ /messages.(\d+)/) { if ($1 > $oldest) { $oldest = $1; } } } foreach (reverse (0 .. $oldest)) { if (-f $self->{archivedir}.'/messages.'.$_) { rename $self->{archivedir}.'/messages.'.$_, $self->{archivedir}.'/messages.'.($_ + 1); $self->trace(sprintf "i move %s to %s", $self->{archivedir}.'/messages.'.$_, $self->{archivedir}.'/messages.'.($_ + 1)); } else { $self->trace(sprintf "i cannot find %s", $self->{archivedir}.'/messages.'.$_); } } $self->trace(sprintf "i move %s to %s", $self->{logfile}, $self->{archivedir}.'/messages.0'); rename $self->{logfile}, $self->{archivedir}.'/messages.0'; } elsif ($method eq "loglog0log1") { my $oldest = 0; my $globfiles = $self->{archivedir}.'/'.$self->{logbasename}.'.*'; if ($globfiles =~ /[^\\][ ]/) { # because Core::glob splits the argument on whitespace $globfiles =~ s/( )/\\$1/g; } foreach my $archive (glob "$globfiles") { $archive = basename($archive); if ($archive !~ /^$self->{logbasename}\.(\d+)$/) { next; } else { if ($1 > $oldest) { $oldest = $1; } } } foreach (reverse (0 .. $oldest)) { if (-f $self->{archivedir}.'/'.$self->{logbasename}.'.'.$_) { rename $self->{archivedir}.'/'.$self->{logbasename}.'.'.$_, $self->{archivedir}.'/'.$self->{logbasename}.'.'.($_ + 1); $self->trace(sprintf "i move %s to %s", $self->{archivedir}.'/'.$self->{logbasename}.'.'.$_, $self->{archivedir}.'/'.$self->{logbasename}.'.'.($_ + 1)); } else { $self->trace(sprintf "i cannot find %s", $self->{archivedir}.'/'.$self->{logbasename}.'.'.$_); } } $self->trace(sprintf "i move %s to %s", $self->{logfile}, $self->{archivedir}.'/'.$self->{logbasename}.'.0'); rename $self->{logfile}, $self->{archivedir}.'/'.$self->{logbasename}.'.0'; } sleep 2; } sub rotate_compress { my $self = shift; my $method = shift || $self->{rotation}; if ($method eq "SOLARIS") { my $oldest = 0; $self->trace(sprintf "compressing and rotation like solaris"); foreach my $archive (glob $self->{archivedir}.'/messages.*') { if ($archive =~ /messages.(\d+)/) { if ($1 > $oldest) { $oldest = $1; } } } $self->trace(sprintf "oldest archive is messages.%d", $oldest); foreach (reverse (0 .. $oldest)) { if (-f $self->{archivedir}.'/messages.'.$_) { $self->trace(sprintf "i found %s", $self->{archivedir}.'/messages.'.$_); rename $self->{archivedir}.'/messages.'.$_, $self->{archivedir}.'/messages.'.($_ + 1); $self->trace(sprintf "i move %s to %s modified %d, accessed %d, inode %d", $self->{archivedir}.'/messages.'.$_, $self->{archivedir}.'/messages.'.($_ + 1), (stat $self->{archivedir}.'/messages.'.($_ + 1))[9], (stat $self->{archivedir}.'/messages.'.($_ + 1))[8], (stat $self->{archivedir}.'/messages.'.($_ + 1))[10]); system("gzip", "-f", $self->{archivedir}.'/messages.'.($_ + 1)); sleep 2; $self->trace(sprintf "i compress %s modified %d, accessed %d, inode %d", $self->{archivedir}.'/messages.'.($_ + 1), (stat $self->{archivedir}.'/messages.'.($_ + 1).'.gz')[9], (stat $self->{archivedir}.'/messages.'.($_ + 1).'.gz')[8], (stat $self->{archivedir}.'/messages.'.($_ + 1).'.gz')[10]); } elsif (-f $self->{archivedir}.'/messages.'.$_.'.gz') { $self->trace(sprintf "i found %s", $self->{archivedir}.'/messages.'.$_.'.gz'); rename $self->{archivedir}.'/messages.'.$_.'.gz', $self->{archivedir}.'/messages.'.($_ + 1).'.gz'; $self->trace(sprintf "i move %s to %s modified %d, accessed %d, inode %d", $self->{archivedir}.'/messages.'.$_.'.gz', $self->{archivedir}.'/messages.'.($_ + 1).'.gz', (stat $self->{archivedir}.'/messages.'.($_ + 1).'.gz')[9], (stat $self->{archivedir}.'/messages.'.($_ + 1).'.gz')[8], (stat $self->{archivedir}.'/messages.'.($_ + 1).'.gz')[10]); sleep 2; } else { $self->trace(sprintf "i cannot find %s", $self->{archivedir}.'/messages.'.$_); } } rename $self->{logfile}, $self->{archivedir}.'/messages.0'; $self->trace(sprintf "i move %s to %s modified %d, accessed %d, inode %d", $self->{logfile}, $self->{archivedir}.'/messages.0', (stat $self->{archivedir}.'/messages.0')[9], (stat $self->{archivedir}.'/messages.0')[8], (stat $self->{archivedir}.'/messages.0')[10]); $self->trace(sprintf "done compressing and rotation like solaris"); } sleep 2; } sub dump_protocol { my $self = shift; foreach my $level (qw (OK WARNING CRITICAL UNKNOWN)) { if ($self->getmatches($level)) { printf STDERR "%s errors in %s\n", $level, $self->{logbasename}; foreach ($self->getmatchmessages($level)) { printf STDERR "%s\n", $_; } } } } ##### eventcreate sub logger { my $self = shift; my $hostname = shift; my $process = shift; my $count = shift || 1; my $message = shift; my $raw = shift || 0; my $details = shift || {}; $| = 1; if (($self->{type} eq "psloglist") || ($self->{type} eq "eventlog") || ($self->{type} eq "wevtutil")) { my $cmd; my $type = exists $details->{EventType} ? uc $details->{EventType} : "INFORMATION"; my $source = exists $details->{Source} ? $details->{Source} : "check_logfiles"; my $id = exists $details->{EventID} ? $details->{EventID} : 1; while ($count--) { if ($^O =~ /cygwin/) { #$cmd = sprintf '/cygdrive/c/WINDOWS/system32/eventcreate /L Application /SO %s /T %s /ID %s /D "%s" >/dev/null 2>&1', $cmd = sprintf '/cygdrive/c/WINDOWS/system32/eventcreate /L Application /T %s /ID %s /D "%s" >/dev/null 2>&1', $type, $id, $message; } else { # MSWin or other native windows perls $cmd = sprintf 'C:\WINDOWS\system32\eventcreate /L Application /SO %s /T %s /ID %s /D "%s" 1>NUL 2>&1', $source, $type, $id, $message; } printf "exec %s\n", $cmd; system($cmd); } } else { $hostname ||= "localhost"; $process ||= "check_logfiles"; my $logfh = IO::File->new(); $logfh->autoflush(1); if ($logfh->open($self->{logfile}, "a")) { while ($count--) { if (! $raw) { my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; my $timestamp = sprintf "%3s %2d %02d:%02d:%02d", ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")[$mon], $mday, $hour, $min, $sec; if ($process ne 'check_logfiles') { # z.b. $tivtest->logger('dellsrv', 'Server Administrator:', 1, "Storage Service EventID: 1004 on PE 1850"); # Jun 19 10:57:58 dellsrv Server Administrator: Storage Service EventID: 1004 on PE 1850 $logfh->printf("%s %s %s %s\n", $timestamp, $hostname, $process, $message); } else { $logfh->printf("%s %s %s[%d] %s\n", $timestamp, $hostname, $process, $$, $message); } } else { $logfh->printf("%s\n", $message); } } } $logfh->close(); } } sub loggercrap { my $self = shift; my $hostname = shift || "localhost"; my $process = shift || "check_logfiles"; my $count = shift || 1; my $maxmsg = rand($count) + 1; my $messages = [ ["", "-- MARK --", "last message repeated 1 time", "last message repeated 100 times"], ["in.fingerd", "connect from xxx1\@umbc9.umbc.edu"], ["inetd", "registrar/tcp: Connection from hpcae30 (160.21.33.43) at Wed Nov 29 11:10:17 2006", "shell/tcp: Connection from svxbs28 (160.21.33.209) at Wed Nov 29 11:15:01 2006", "auth/tcp: Connection from lldsm43 (160.21.33.146) at Wed Nov 29 10:24:55 2006"], ["sam-arcopy", "[ID 287109 local7.info] info OS call error: open(/net/spams/fs02/share/PAK/aw_06/1000/E61/R-V515229N47D20OL6HP19T\334/08.06.2006_18.35_3_LB_3_A/DATA/MeasSetup/ChanPos): File is offline", "[ID 475690 local7.info] info OS call error: open failed: sa.912518", "[ID 821104 local7.info] info OS call error: open(/net/spams/fs02/share/EWE-ARCH/aw_30/E60/_Datenkorb/_G01_E060-07-03-450/_41_FV_2_iO/CCA060/FV_CCA060_CHIKOR-HO_E89x-07-03-450_E89x-07-06-400/SB_041028_DF_CCA060_E89x-07-03-450_E89x-07-06-400__E060_E070-07-09-350_E060-07-09-350.xml" ], ["devfsadm", "[ID 518500 daemon.error] readlink failed for /dev/vx/dsk/rootdg: Invalid argument" ], ["sshd", "Invalid user delta from 194.44.247.243 ", "Invalid user tester from 194.44.247.243 ", "Failed none for hiasl from 192.168.9.11 port 4250 ssh2", "[ID 800047 auth.info] Connection closed by 160.21.33.116", "[ID 800047 auth.info] Found matching RSA key: 46:8f:0b:18:a6:ed:2a:89:b0:f7:79:9e:e5:5f:65:8d", "[ID 800047 auth.info] Accepted publickey for qqdda from 160.21.33.116 port 44436 ssh2", "[ID 800047 auth.info] Failed none for qqdda from 160.21.33.116 port 44398 ssh2", "[ID 800047 auth.info] subsystem request for sftp", "[ID 800047 auth.info] Generating new 768 bit RSA key.", "[ID 800047 auth.info] RSA key generation complete."], ["scsi", "[ID 799468 kern.info] ssd112 at scsi_vhci0: name g600c0ff000000000007c026394436200, bus address g600c0ff000000000007c026394436200", "[ID 243001 kern.info] Target 0x2305ef: Device type not supported: Device type=0x3 Peripheral qual=0x0"], ["mpxio", "[ID 669396 kern.info] /scsi_vhci/ssd\@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: failed, path /pci\@1d,700000/SUNW,qlc\@2/fp\@0,0 (fp4) to target address: 226000c0ffa07c02,3 is offline. Load balancing: none", "[ID 669396 kern.info] /scsi_vhci/ssd\@g600c0ff000000000007c02288cc3ff00 (ssd114) multipath status: degraded, path /pci\@1d,700000/SUNW,qlc\@2/fp\@0,0 (fp4) to target address: 226000c0ffa07c02,3 is online. Load balancing: none"] ]; for (1..$maxmsg) { my $procnum = int rand(scalar(@{$messages})); my $msgnum = int rand(scalar(@{$messages->[$procnum]}) - 1) + 1; $self->logger(undef, $messages->[$procnum]->[0], 1, $messages->[$procnum]->[$msgnum]); } $self->trace(sprintf "%s logs %d random messages to %s", $self->{tag}, $maxmsg, $self->{logfile}); return $maxmsg; } sub revert_seekfile { my $self = shift; my $tmp = {}; our $state = {}; if (-f $self->{seekfile}) { $self->trace(sprintf "seekfile to revert %s found", $self->{seekfile}); eval { do $self->{seekfile}; }; if ($@) { # found a seekfile with the old syntax $self->trace(sprintf "seekfile to revert has old format %s", $@); my $seekfh = new IO::File; $seekfh->open($self->{seekfile}, "r"); $tmp->{lastlogoffset} = $seekfh->getline() || 0; $tmp->{lastlogtime} = $seekfh->getline() || 0; $tmp->{lastdevino} = $seekfh->getline(); chomp $tmp->{lastlogoffset}; chomp $tmp->{lastlogtime}; chomp $tmp->{lastdevino}; $seekfh->close(); if (! $self->{lastdevino}) { # upgrade vom < 1.4 on the fly $self->{lastdevino} = (-e $self->{logfile}) ? sprintf ("%d:%d", (stat $self->{logfile})[0], (stat $self->{logfile})[1]) : "0:0"; } $self->{lastlogfile} = $self->{logfile}; } else { $self->trace(sprintf "seekfile to revert has new format %s", $@); $tmp->{lastlogoffset} = $state->{logoffset}; $tmp->{lastlogtime} = $state->{logtime}; $tmp->{lastdevino} = $state->{devino}; $tmp->{lastlogfile} = $state->{logfile}; } my $seekfh = new IO::File; if ($seekfh->open($self->{pre2seekfile}, "w")) { $self->trace(sprintf "writing seekfile %s in old format as %s", $self->{seekfile}, $self->{pre2seekfile}); $seekfh->printf("%d\n", $tmp->{lastlogoffset}); $seekfh->printf("%d\n", $tmp->{lastlogtime}); $seekfh->printf("%s\n", $tmp->{lastdevino}); $seekfh->close(); unlink $self->{seekfile}; } } } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/Tivoli/0000775000175000017500000000000014336703157017326 500000000000000check_logfiles-4.1.1/plugins-scripts/Nagios/Tivoli/Config/0000775000175000017500000000000014336703157020533 500000000000000check_logfiles-4.1.1/plugins-scripts/Nagios/Tivoli/Config/Logfile.pm0000755000175000017500000004003314336703157022373 00000000000000# # Logfile::Config::Tivoli.pm - Tivoli Config Module # # Purpose: Provide a convenient way for loading # tivoli config files and # return it as hash structure # package Nagios::Tivoli::Config::Logfile; use strict; sub new { my($this, $param ) = @_; my $class = ref($this) || $this; my $self = { formatfile => '', # format file with tivoli format definitions, # can be an array of files formatstring => '', # format file content as string severity_mappings => {}, max_continuation_lines => 0, # in case there are %n in among the patterns line_buffer => [], # for continuation lines line_buffer_size => 0, }; bless $self, $class; $self->set_severity_mapping('fatal', 2); $self->set_severity_mapping('critical', 2); $self->set_severity_mapping('severe', 2); $self->set_severity_mapping('warning', 1); $self->set_severity_mapping('minor', 1); $self->set_severity_mapping('harmless', 0); $self->set_severity_mapping('unknown', 0); # parse parameter if (ref($param) eq "HASH") { for my $key (keys %{$param}) { if (!defined $self->{lc $key}) { printf STDERR "unrecognized parameter: %s\n", $key; return undef; } else { if (ref($param->{$key}) eq 'HASH') { $self->merge_hash($self->{$key}, $param->{$key}); } else { $self->{lc $key} = $param->{$key}; } } } } elsif (ref($param) eq "") { $self->{formatfile} = $param; } else { printf STDERR "formatfile is a required parameter\n"; } if ((!defined $self->{formatfile} || $self->{formatfile} eq '') && (!defined $self->{formatstring} || $self->{formatstring} eq '')) { printf STDERR "please either specify formatfile or formatstring\n"; return undef; } if (defined $self->{formatstring} and $self->{formatstring} ne '') { $self->{_formatstring} = $self->{formatstring}; } else { $self->{_formatstring} = $self->_read($self->{formatfile}); } if (! $self->{_formatstring}) { return undef; } foreach (keys %{$self->{tivolimapping}}) { $self->set_severity_mapping($_, $self->{tivolimapping}->{$_}); } if ($self->_parse) { #Data::Dumper::Dumper($self->{formats}); return $self; } else { printf STDERR ("parsing failed, see previous messages..."); return undef; } } sub _read { my $self = shift; my $filename = shift; my $content; if (ref($filename) eq 'ARRAY') { for my $file (@{$filename}) { $content .= $self->_read($file); } } else { if (open FMT, $filename) { while() { $content .= $_; } close FMT; } else { printf STDERR "unable to read file %s: %s\n", $filename, $!; return undef; } } return($content); } sub _parse { my $self = shift; my $format; my $lineno = 0; for my $line (split /\n/, $self->{_formatstring}) { $lineno++; chomp $line; $line = $1 if $line =~ /^\s*(.*?)\s*$/; next if $line =~ m/^\/\//; next if $line eq ""; if ($line =~ m/^FORMAT/) { my($name, $follows, $followname) = $line =~ m/^FORMAT\s+(.*?)\s*(|FOLLOWS\s+(.*?))$/; $format= Nagios::Tivoli::Config::Logfile::Format->new({ name => $name, lineno => $lineno, severity_mappings => $self->{severity_mappings}, }); if (defined $followname) { my @follows = split /\s*,\s*/, $followname; for my $follow (@follows) { if (my $follow_format = $self->get_format_by_name($follow)) { $format->inherit($follow_format); } } $format->{follows} = \@follows; } } elsif ($line =~ m/^END/) { if (!defined $format) { printf STDERR "found format end without beginning\n"; return 0; } if (!defined $format->{pattern}) { if (!exists $format->{follows}) { printf STDERR "found format without pattern\n"; return 0; } } $self->add_format($format); } elsif (defined $format) { if (!defined $format->{pattern}) { # %s Specifies a variable string. # %t Specifies a variable date of the form 'MMM DD hh:mm:ss' # %s+ Specifies one or more variable strings that # are separated by spaces. # %s* Specifies zero or more strings separated by white space. # %n Specifies a new line (CR). # This applies only to the following adapters: # tecad_logfile_aix4-r1, tecad_logfile_hpux10, # tecad_logfile_linux_ix86, tecad_logfile_linux-ppc, # tecad_logfile_linux-s390, tecad_logfile_solaris2, # and tecad_win. $format->{tiv_pattern} = $line; $format->{patternlines} = 0; if ($line =~ /%n/) { $format->{patternlines}++ while $line =~ /%n/g; $format->{pattern} = [map { $self->translate_pattern($_) } split /%n/, $line]; $self->{max_continuation_lines} = $format->{patternlines} unless $format->{patternlines} <= $self->{max_continuation_lines}; } else { $format->{pattern} = $self->translate_pattern($line); } } elsif ($line =~ m/^-(.*?)\s+(.*)$/i) { $format->add_variable($1, $2); } elsif ($line =~ m/^(.*?)\s+"*(.*?)"*\s*$/) { $format->add_slot($1, $2); } } else { printf STDERR "%s is outside of a format definition\n", $line; return 0; } } return 1; } sub translate_pattern { my $self = shift; my $tiv_pattern = shift; $tiv_pattern =~ s/\\/\\\\/g; # quote \ $tiv_pattern =~ s/\(/\\(/g; # quote ( $tiv_pattern =~ s/\)/\\)/g; # quote ) $tiv_pattern =~ s/%\[\d+\]s/%s/g; # replace %[2]s with just %s $tiv_pattern =~ s/\[/\\[/g; # quote [ $tiv_pattern =~ s/\]/\\]/g; # quote ] $tiv_pattern =~ s/\?/\\?/g; # quote ? $tiv_pattern =~ s/\|/\\|/g; # quote | $tiv_pattern =~ s/\-/\\-/g; # quote - #$tiv_pattern =~ s/%s\+/\(.+?\)/g; # %s+ becomes .+? #$tiv_pattern =~ s/%s\*/\(.*?\)/g; # %s* becomes .*? #$tiv_pattern =~ s/%s/\(\[^\\s\]+?\)/g; # %s becomes [^\s]+? $tiv_pattern =~ s/%s\+/\([^\\s]*?.+[^\\s]*?\)/g; # %s+ becomes [^\s]*?.+[^\s]*? $tiv_pattern =~ s/%s\*\s*$/\(.*\)/g; # last %s* becomes .* eats the rest $tiv_pattern =~ s/%s\*/\(.*?\)/g; # %s* becomes .*? eats as much as necessary $tiv_pattern =~ s/%s/\(\[^\\s\]+\)/g; # %s becomes [^\s]+? #$tiv_pattern =~ s/%n/\\n/g; # %n becomes \n $tiv_pattern =~ s/[ ]+/\\s\+/g; # blanks become \s+ $tiv_pattern =~ s/%n//g; # %n becomes \n $tiv_pattern =~ s/%t/\(\\w\{3\}\\s+\\d\{1,2\}\\s+\\d\{1,2\}\:\\d\{1,2\}\:\\d\{1,2\}\)/g; return $tiv_pattern; } sub match { my $self = shift; my $line = shift; if ($self->{line_buffer_size} < $self->{max_continuation_lines} + 1) { push(@{$self->{line_buffer}}, $line); $self->{line_buffer_size}++; } else { shift @{$self->{line_buffer}}; push(@{$self->{line_buffer}}, $line); } #printf STDERR "try: %s\n", $line; foreach my $format (reverse @{$self->{'formats'}}) { next if ! $format->{can_match}; #if (($format->{name} ne '*DISCARD*') && # (! $format->has_slots() || ! $format->get_slot('severity'))) { # next; # ungueltiges format #} my @matches = (); #printf STDERR "format %s\n", $format->{name}; #printf STDERR "match /%s/\n", $format->{pattern}; if (my @matches = $self->match_pattern($line, $format)) { my $hit = Nagios::Tivoli::Config::Logfile::Hit->new({ format => $format, logline => $line, matches => \@matches, format_mappings => $self->{format_mappings}, severity_mappings => $self->{severity_mappings}, }); #printf STDERR "hit: %s\n", $line; if ($format->{name} eq '*DISCARD*') { #printf STDERR "discard: %s %s\n", $line, Data::Dumper::Dumper($hit); last; } else { #printf STDERR "hit2: %s // %s\n", $hit->{subject}, $format->{name}; return({ exit_code => $hit->get_nagios_severity(), severity => $hit->{severity}, format_name => $hit->{format_name}, subject => $hit->{subject}, logline => $line, slots => $hit->{slots}, }); } } } #printf STDERR "mis: %s\n", $line; return({ exit_code => $self->get_severity_mapping('HARMLESS'), severity => 'HARMLESS', format_name => 'NO MATCHING RULE', subject => 'NO MATCHING RULE', logline => $line, slots => { }, }); } sub match_pattern { my $self = shift; my $line = shift; my $format = shift; my $pattern = $format->{pattern}; if (ref($pattern) eq 'ARRAY') { my @all_matches = (); # my $patterns = scalar(@{$pattern}); if ($patterns > $self->{line_buffer_size}) { # zu wenig zeilen vorhanden return (); } else { my $startidx = $self->{line_buffer_size} - $patterns; my $idx = 0; while ($idx < $patterns) { # pattern[$idx] matched ${$self->{line_buffer}}[$startidx + $idx] ? if (my @matches = ${$self->{line_buffer}}[$startidx + $idx] =~ /$pattern->[$idx]/) { $idx++; push(@all_matches, @matches); } else { last; } } if ($idx == $patterns) { return @all_matches; } else { return (); } } } else { #my @matches = $line =~ /$pattern/; my @matches = $format->{matchfunc}($line); return @matches; } } # inherit # # copy variable and slot definitions of a followed format to the current format # sub inherit { my $self = shift; my $ancestor = shift; $self->merge_hash($self->{variables}, $ancestor->{variables}); $self->merge_hash($self->{slots}, $ancestor->{slots}); } # get_severity_mapping # # get the numerical nagios level for a tivoli level # sub get_severity_mapping { my $self = shift; my $tivoli_severity = lc shift; return $self->{severity_mappings}->{$tivoli_severity}; } # set_severity_mapping # # set the numerical nagios level for a tivoli level # sub set_severity_mapping { my $self = shift; my $tivoli_severity = lc shift; my $nagios_severity = shift; $self->{severity_mappings}->{$tivoli_severity} = $nagios_severity; } # set_format_mappings # # set runtime values for LABEL, DEFAULT,... # sub set_format_mappings { my $self = shift; my %mappings = @_; foreach (keys %mappings) { $self->{format_mappings}->{$_} = $mappings{$_}; } } sub add_format { my $self = shift; my $format = shift; if (($format->{name} ne '*DISCARD*') && (! $format->has_slots() || ! $format->get_slot('severity'))) { #printf STDERR "FORMAT %s skipped\n", $format->{name}; $format->{can_match} = 0; } else { $format->{can_match} = 1; } push(@{$self->{formats}}, $format); } sub get_format_by_name { my $self = shift; my $name = shift; foreach (@{$self->{formats}}) { return $_ if $_->{name} eq $name; } return undef; } sub merge_hash { my $self = shift; my $hash1 = shift; my $hash2 = shift; for my $key (keys %{$hash2}) { $hash1->{$key} = $hash2->{$key}; } return($hash1); } package Nagios::Tivoli::Config::Logfile::Format; use strict; use warnings; use Carp; use vars qw(@ISA); @ISA = qw(Nagios::Tivoli::Config::Logfile); sub new { my($this, $param ) = @_; my $class = ref($this) || $this; my $self = { name => '', lineno => 0, slots => {}, variables => {}, severity_mappings => {}, }; bless $self, $class; if (ref($param) eq "HASH") { for my $key (keys %{$param}) { if (!defined $self->{lc $key}) { carp("unrecognized parameter: $key"); } else { if (ref($param->{$key}) eq 'HASH') { $self->merge_hash($self->{$key}, $param->{$key}); } else { $self->{lc $key} = $param->{$key}; } } } } if (!defined $self->{name}) { die "please either specify formatfile or formatstring"; } $self->add_match_closure(); return $self; } sub add_slot { my $self = shift; my $slot = shift; my $value = shift; $self->{slots}->{$slot} = $value; } sub get_slot { my $self = shift; my $slot = shift; return $self->{slots}->{$slot}; } sub has_slots { my $self = shift; return scalar (keys %{$self->{slots}}); } sub add_variable { my $self = shift; my $variable = shift; my $value = shift; $self->{variables}->{$variable} = $value; } sub get_variable { my $self = shift; my $variable = shift; return $self->{variables}->{$variable}; } sub has_variables { my $self = shift; return scalar (keys %{$self->{variables}}); } sub add_match_closure { my $self = shift; # creates a function which keeps the compiled version of self->pattern $self->{matchfunc} = eval "sub { local \$_ = shift; return m/\$self->{pattern}/o; }"; } package Nagios::Tivoli::Config::Logfile::Hit; use strict; use warnings; use Carp; use vars qw(@ISA); @ISA = qw(Nagios::Tivoli::Config::Logfile::Format); sub new { my($this, $param ) = @_; my $class = ref($this) || $this; my $self = { format => $param->{format}, logline => $param->{logline}, format_mappings => $param->{format_mappings}, severity_mappings => $param->{severity_mappings}, matches => {}, variables => {}, slots => {}, }; bless $self, $class; my $matchcnt = 1; map { $self->{matches}->{$matchcnt++} = $_; } @{$param->{matches}}; $self->init(); return $self; } sub init { my $self = shift; $self->{severity} = $self->{format}->{slots}->{severity}; $self->{format_name} = $self->{format}->{name}; $self->merge_hash($self->{variables}, $self->{format}->{variables}); $self->merge_hash($self->{slots}, $self->{format}->{slots}); # resolve pattern groups in internal variables foreach my $var (keys %{$self->{variables}}) { if ($self->{variables}->{$var} =~ /^\$(\d+)/) { if (defined $self->{matches}->{$1}) { $self->{variables}->{$var} = $self->{matches}->{$1}; } else { printf STDERR "cannot replace \$%d in var %s\n", $1, $var; } } } # resolve pattern groups and format reserved words in slots foreach my $slot (keys %{$self->{slots}}) { if ($self->{slots}->{$slot} =~ /^\$(\d+)/) { if (defined $self->{matches}->{$1}) { $self->{slots}->{$slot} = $self->{matches}->{$1}; } else { printf STDERR "cannot replace \$%d in slot %s\n", $1, $slot; } } elsif ($self->{slots}->{$slot} eq 'DEFAULT') { if ($slot eq 'hostname') { $self->{slots}->{$slot} = $self->{format_mappings}->{hostname}; } elsif ($slot eq 'fqhostname') { $self->{slots}->{$slot} = $self->{format_mappings}->{fqhostname}; } elsif ($slot eq 'origin') { $self->{slots}->{$slot} = $self->{format_mappings}->{origin}; } else { $self->{slots}->{$slot} = 'check_logfiles'; } } elsif ($self->{slots}->{$slot} eq 'LABEL') { $self->{slots}->{$slot} = $self->{format_mappings}->{LABEL}; } elsif ($self->{slots}->{$slot} eq 'FILENAME') { $self->{slots}->{$slot} = $self->{format_mappings}->{FILENAME}; } else { } } foreach my $slot (keys %{$self->{slots}}) { if ($self->{slots}->{$slot} =~ /PRINTF/i) { $self->{slots}->{$slot} = $self->printf($self->{slots}->{$slot}); } } $self->{subject} = $self->{slots}->{msg} || $self->{logline}; #delete $self->{slots}->{msg}; } sub printf { my $self = shift; my $text = shift; my @printf = $text =~ m/printf\("(.*?)"\s*,\s*(.*)\)/i; my $result = $text; my @replacements; for my $key (split /\s*,\s*/, $printf[1]) { if (defined $self->{variables}->{$key}) { push @replacements, $self->{variables}->{$key}; } elsif (defined $self->{slots}->{$key}) { push @replacements, $self->{slots}->{$key}; } else { print STDERR "$key not found\n"; push @replacements, ''; } } eval { $result = sprintf($printf[0], @replacements); }; return($result); } sub get_nagios_severity { my $self = shift; return $self->get_severity_mapping($self->{slots}->{severity}); } 1; check_logfiles-4.1.1/plugins-scripts/Nagios/CheckLogfiles.pm0000755000175000017500000046456314336703157021063 00000000000000package Nagios::CheckLogfiles; use strict; use IO::File; use File::Basename; use File::Spec; use File::Find; use File::Path; use Cwd; use Data::Dumper; #use Net::Domain qw(hostname hostdomain hostfqdn); use Socket; use POSIX qw(strftime); use Sys::Hostname qw(hostname); use IPC::Open2; use Errno; use constant GZIP => '#GZIP#'; my $ERROR_OK = 0; my $ERROR_WARNING = 1; my $ERROR_CRITICAL = 2; my $ERROR_UNKNOWN = 3; our $ExitCode = $ERROR_OK; our $ExitMsg = "OK"; my(%ERRORS, $TIMEOUT); %ERRORS = ( OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 ); $TIMEOUT = 60; $| = 1; eval "require Win32;"; #eval "require Net::Domain qw(hostname hostdomain hostfqdn);"; eval "require Net::Domain;"; { local $^W = 0; # shut up! eval "require 'syscall.ph'"; eval "require 'sys/resource.ph'"; } sub new { my $class = shift; my $params = shift; my $self = bless {} , $class; return $self->init($params); } # # Read a hash with parameters # sub init { my $self = shift; my $params = shift; my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; $year += 1900; $mon += 1; $self->{tracefile} = $self->system_tempdir().'/check_logfiles.trace'; $self->{trace} = -e $self->{tracefile} ? 1 : 0; $self->{verbose} = $params->{verbose} || 0; $self->{htmlencode} = $params->{htmlencode} || 0; $self->{seekfilesdir} = $params->{seekfilesdir} || '#SEEKFILES_DIR#'; $self->{protocolsdir} = $params->{protocolsdir} || '#PROTOCOLS_DIR#'; $self->{scriptpath} = $params->{scriptpath} || '#TRUSTED_PATH#'; $self->{protocolretention} = ($params->{protocolretention} || 7) * 24 * 3600; $self->{macros} = $params->{macros}; $self->{timeout} = $params->{timeout} || 360000; $self->{pidfile} = $params->{pidfile}; $self->{perfdata} = ""; $self->{searches} = []; $self->{selectedsearches} = $params->{selectedsearches} || []; $self->{dynamictag} = $params->{dynamictag} || ""; $self->{cmdlinemacros} = $params->{cmdlinemacros} || {}; $self->{reset} = $params->{reset} || 0; $self->{unstick} = $params->{unstick} || 0; $self->{warning} = $params->{warning} || 0; $self->{critical} = $params->{critical} || 0; $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->init_macros; $self->default_options({ prescript => 1, smartprescript => 0, supersmartprescript => 0, postscript => 1, smartpostscript => 0, supersmartpostscript => 0, report => 'short', maxlength => 4096, seekfileerror => 'critical', logfileerror => 'critical', protocolfileerror => 'ok', maxmemsize => 0, rotatewait => 0, htmlencode => 0, outputhitcount => 1, rununique => 0, preview => 1, }); if ($params->{cfgfile}) { if (ref($params->{cfgfile}) eq "ARRAY") { # multiple cfgfiles found in a config dir my @tmp_searches = (); $self->{cfgbase} = $params->{cfgbase} || "check_logfiles"; $self->late_init_macros; foreach my $cfgfile (@{$params->{cfgfile}}) { $self->{cfgfile} = $cfgfile; if (! $self->init_from_file()) { return undef; } push(@tmp_searches, @{$self->{searches}}); $self->{searches} = []; } my %seen = (); # newer searches replace searches with the same tag @tmp_searches = reverse map { if (! exists $seen{$_->{tag}}) { $seen{$_->{tag}}++; $_; } else { (); } } reverse @tmp_searches; $self->{searches} = \@tmp_searches; my $uniqueseekfile = undef; my $uniqueprotocolfile = undef; foreach (@{$self->{searches}}) { $_->{cfgbase} = "check_logfiles"; next if $_->{tag} eq "prescript"; next if $_->{tag} eq "postscript"; $_->construct_seekfile(); } #$self->{cfgbase} = (split /\./, basename($params->{cfgfile}->[0]))[0]; $self->{cfgbase} = "check_logfiles"; } elsif ($params->{cfgfile} =~ /%0A/) { # this must be an encoded flat file $self->{cfgfile} = $params->{cfgfile}; $self->{cfgbase} = "flatfile"; $self->late_init_macros; if (! $self->init_from_file()) { return undef; } } else { $self->{cfgfile} = $params->{cfgfile}; $self->{cfgbase} = (split /\./, basename($self->{cfgfile}))[0]; $self->late_init_macros; if (! $self->init_from_file()) { return undef; } } # if there is a dynamictag parameter then replace template names with # template_dynamictagtag if (scalar(@{$self->{selectedsearches}})) { @{$self->{searches}} = map { my $srch = $_; if (grep { $srch->{tag} eq $_ } @{$self->{selectedsearches}}) { # gilt sowohl fuer normale searches $srch; } elsif ($srch->{template} && grep { $srch->{template} eq $_ } @{$self->{selectedsearches}}) { # als auch fuer template (tag ist hier bereits template."_".tag, # wobei tag auf der kommandozeile uebergeben wurde) $srch; } elsif (grep { $_ =~ /[*?]/ && $srch->{tag} =~ /$_/ } @{$self->{selectedsearches}}) { # --selectedsearches "regexp,regexp" $srch; } elsif ($srch->{tag} eq "prescript") { $srch; } elsif ($srch->{tag} eq "postscript") { $srch; } else { $self->trace("skipping non-selected search %s", $srch->{tag}); (); } } @{$self->{searches}}; } } else { $self->{cfgbase} = $params->{cfgbase} || "check_logfiles"; $self->late_init_macros; # first the global options (from the commandline in this case) $self->refresh_options($params->{options}); $self->{seekfilesdir} = $self->relocate_dir("seekfilesdir", $self->{seekfilesdir}); $self->resolve_macros(\$self->{seekfilesdir}); foreach (@{$params->{searches}}) { $_->{seekfilesdir} = $self->{seekfilesdir}; $_->{relocate_seekfilesdir} = $self->{relocate_seekfilesdir}; $_->{scriptpath} = $self->{scriptpath}; %{$_->{macros}} = %{$self->{macros}}; $_->{tracefile} = $self->{tracefile}; $_->{cfgbase} = $self->{cfgbase}; if (my $search = Nagios::CheckLogfiles::Search->new($_)) { # maybe override default search options with global ones (ex. report) $search->refresh_default_options($self->get_options('report,seekfileerror,logfileerror,protocolfileerror')); push(@{$self->{searches}}, $search); } else { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "cannot create %s search %s", $_->{type}, $_->{tag}; return undef; } } } if (defined(&Win32::GetShortPathName) && ($^O =~ /Win/)) { # if this is true windows (not cygwin) and if the path exists # then transform it to a short form. undef if path does not exist. if (my $tmpshortpath = &Win32::GetShortPathName($self->{protocolsdir})) { $self->{protocolsdir} = $tmpshortpath; } } if ($self->get_option('report') !~ /^(long|short|html)$/) { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "UNKNOWN - output must be short, long or html"; return undef; } $self->{protocolfile} = sprintf "%s/%s.protocol-%04d-%02d-%02d-%02d-%02d-%02d", $self->{protocolsdir}, $self->{cfgbase}, $year, $mon, $mday, $hour, $min, $sec; $self->{protocololdfiles} = sprintf "%s/%s.protocol-*-*-*-*-*-*", $self->{protocolsdir}, $self->{cfgbase}; $self->{protocolfh} = new IO::File; $self->{protocolwritten} = 0; $self->{allerrors} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; # if parameters update if (@{$self->{searches}}) { $self->{exitcode} = $ExitCode; $self->{exitmessage} = $ExitMsg; return $self; } else { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "UNKNOWN - configuration incomplete"; return undef; } } sub init_from_file { my $self = shift; my $abscfgfile; # # variables from the config file. # our($seekfilesdir, $protocolsdir, $scriptpath, $protocolretention, $prescript, $prescriptparams ,$prescriptstdin, $prescriptdelay, $postscript, $postscriptparams, $postscriptstdin, $postscriptdelay, @searches, @logs, $tracefile, $options, $report, $timeout, $pidfile, $CHECK_LOGFILES_PRIVATESTATE); our $MACROS = {}; if ($^O =~ /MSWin/) { $ENV{HOME} = $ENV{USERPROFILE}; } if ($self->{cfgbase} eq "flatfile") { $self->{cfgfile} =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg; eval $self->{cfgfile}; if ($@) { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "UNKNOWN - syntax error %s", (split(/\n/, $@))[0]; return undef; } $abscfgfile = "/dummy/dummy/".(unpack("H*", $self->{cfgfile})); } else { if (-f $self->{cfgfile}) { $abscfgfile = $self->{cfgfile}; } elsif (-f $self->{cfgfile}.'.cfg') { $abscfgfile = $self->{cfgfile}.'.cfg'; } elsif (-f $ENV{HOME}.'/'.$self->{cfgfile}) { $abscfgfile = $ENV{HOME}.'/'.$self->{cfgfile}; } elsif (-f $ENV{HOME}.'/'.$self->{cfgfile}.'.cfg') { $abscfgfile = $ENV{HOME}.'/'.$self->{cfgfile}.'.cfg'; } else { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "UNKNOWN - can not load configuration file %s", $self->{cfgfile}; return undef; } $abscfgfile = File::Spec->rel2abs($abscfgfile) unless File::Spec->file_name_is_absolute($abscfgfile); delete $INC{$abscfgfile}; # this is mostly because of the tests which cache the cfgfile eval { require $abscfgfile; }; if ($@) { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "UNKNOWN - syntax error %s", (split(/\n/, $@))[0]; return undef; } # We might need this for a pidfile } $self->merge_macros($MACROS); # merge the defaultmacros with macros from the file $seekfilesdir ||= $self->{seekfilesdir}; $protocolsdir ||= $self->{protocolsdir}; $scriptpath ||= $self->{scriptpath}; # We might need this for a pidfile $self->{abscfgfile} = $abscfgfile; $seekfilesdir = $self->relocate_dir("seekfilesdir", $seekfilesdir, dirname(dirname($abscfgfile))); return undef if ! $seekfilesdir; $protocolsdir = $self->relocate_dir("protocolsdir", $protocolsdir, dirname(dirname($abscfgfile))); $scriptpath = $self->relocate_dir("scriptpath", $scriptpath, dirname(dirname($abscfgfile))); $self->resolve_macros(\$seekfilesdir); $self->resolve_macros(\$protocolsdir); $self->resolve_macros(\$scriptpath); $self->{tracefile} = $tracefile if $tracefile; $self->{trace} = -e $self->{tracefile} ? 1 : 0; # already done one level above $self->{cfgbase} = (split /\./, basename($self->{cfgfile}))[0]; $self->{seekfilesdir} = $seekfilesdir if $seekfilesdir; $self->{protocolsdir} = $protocolsdir if $protocolsdir; $self->{scriptpath} = $scriptpath if $scriptpath; $self->{protocolretention} = ($protocolretention * 24 * 3600) if $protocolretention; $self->{prescript} = $prescript if $prescript; $self->{prescriptparams} = $prescriptparams if $prescriptparams; $self->{prescriptstdin} = $prescriptstdin if $prescriptstdin; $self->{prescriptdelay} = $prescriptdelay if $prescriptdelay; $self->{postscript} = $postscript if $postscript; $self->{postscriptparams} = $postscriptparams if $postscriptparams; $self->{postscriptstdin} = $postscriptstdin if $postscriptstdin; $self->{postscriptdelay} = $postscriptdelay if $postscriptdelay; $self->{timeout} = $timeout || 360000; $self->{pidfile} = $pidfile if $pidfile; $self->{privatestate} = {}; $self->refresh_options($options); if (@logs) { # # Since version 1.4 the what/where-array is called @searches. # To stay compatible, @logs is still recognized. # @searches = @logs; } if ($self->{options}->{prescript}) { $_->{scriptpath} = $self->{scriptpath}; %{$_->{macros}} = %{$self->{macros}}; $_->{tracefile} = $self->{tracefile}; $_->{cfgbase} = $self->{cfgbase}; $_->{script} = $self->{prescript}; $_->{scriptparams} = $self->{prescriptparams}; $_->{scriptstdin} = $self->{prescriptstdin}; $_->{scriptdelay} = $self->{prescriptdelay}; $_->{options} = sprintf "%s%sscript", $self->{options}->{supersmartprescript} ? "super" : "", $self->{options}->{smartprescript} ? "smart" : ""; $_->{privatestate} = $self->{privatestate}; my $search = Nagios::CheckLogfiles::Search::Prescript->new($_); push(@{$self->{searches}}, $search); } foreach (@searches) { $_->{seekfilesdir} = $self->{seekfilesdir}; $_->{relocate_seekfilesdir} = $self->{relocate_seekfilesdir}; $_->{scriptpath} = $self->{scriptpath}; %{$_->{macros}} = %{$self->{macros}}; $_->{tracefile} = $self->{tracefile}; $_->{cfgbase} = $self->{cfgbase}; if ((exists $_->{template}) && ! $self->{dynamictag}) { # skip templates if they cannot be tagged next; } $_->{dynamictag} = $self->{dynamictag}; if (my $search = Nagios::CheckLogfiles::Search->new($_)) { $search->refresh_options($self->get_options('report,seekfileerror,logfileerror,protocolfileerror')); push(@{$self->{searches}}, $search); $_->{privatestate}->{$search->{tag}} = $search->{privatestate}; } else { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "cannot create %s search %s", $_->{type}, $_->{tag}; return undef; } } if ($self->{options}->{postscript}) { $_->{scriptpath} = $self->{scriptpath}; %{$_->{macros}} = %{$self->{macros}}; $_->{tracefile} = $self->{tracefile}; $_->{cfgbase} = $self->{cfgbase}; $_->{script} = $self->{postscript}; $_->{scriptparams} = $self->{postscriptparams}; $_->{scriptstdin} = $self->{postscriptstdin}; $_->{scriptdelay} = $self->{postscriptdelay}; $_->{options} = sprintf "%s%sscript", $self->{options}->{supersmartpostscript} ? "super" : "", $self->{options}->{smartpostscript} ? "smart" : ""; $_->{privatestate} = $self->{privatestate}; my $search = Nagios::CheckLogfiles::Search::Postscript->new($_); push(@{$self->{searches}}, $search); } return $self; } sub run { my $self = shift; if ($self->{reset}) { foreach my $search (@{$self->{searches}}) { if ($search->{tag} ne "prescript" && $search->{tag} ne "postscript") { $search->rewind(); } } return $self; } if ($self->{unstick}) { foreach my $search (@{$self->{searches}}) { if ($search->{tag} ne "prescript" && $search->{tag} ne "postscript") { $search->unstick(); } } return $self; } if ($self->{options}->{rununique}) { $self->{pidfile} = $self->{pidfile} || $self->construct_pidfile(); if (! $self->check_pidfile()) { $self->trace("Exiting because another check is already running"); printf "Exiting because another check is already running\n"; exit 3; } } if ($self->get_option('rotatewait')) { $self->await_while_rotate(); } my $protocol_had_error = 0; if (! -w $self->{protocolsdir}) { $protocol_had_error = 1; } foreach my $search (@{$self->{searches}}) { if (1) { # there will be a timesrunningout variable if ($search->{tag} eq "postscript") { $search->{macros}->{CL_SERVICESTATEID} = $self->{exitcode}; $search->{macros}->{CL_SERVICEOUTPUT} = $self->{exitmessage}; $search->{macros}->{CL_LONGSERVICEOUTPUT} = $self->{long_exitmessage} || $self->{exitmessage}; $search->{macros}->{CL_SERVICEPERFDATA} = $self->{perfdata}; $search->{macros}->{CL_PROTOCOLFILE} = $self->{protocolfile}; if ($search->{options}->{supersmartscript}) { # # Throw away everything found so far. Supersmart postscripts # have the last word. # $self->reset_result(); } } $search->{verbose} = $self->{verbose}; $search->{timeout} = $self->{timeout}; $search->run(); if (($search->{tag} eq "prescript") && ($search->{options}->{supersmartscript}) && ($search->{exitcode} > 0)) { # # Prepare for a premature end. A failed supersmart prescript # will abort the whole script. # $self->reset_result(); $self->trace("failed supersmart prescript. aborting..."); } $_->{privatestate}->{$search->{tag}} = $search->{privatestate}; if ($search->{options}->{protocol}) { # must write protocol if ($protocol_had_error) { $search->addmatch($self->get_option('protocolfileerror'), sprintf "cannot write protocol file %s! check your filesystem (permissions/usage/integrity) and disk devices", $self->{protocolsdir}) if lc $self->get_option('protocolfileerror') ne 'ok'; } else { if ($search->getmatches("CRITICAL") || $search->getmatches("WARNING") || $search->getmatches("UNKNOWN")) { if ($self->{protocolfh}->open($self->{protocolfile}, "a")) { foreach (qw(CRITICAL WARNING UNKNOWN)) { if ($search->getmatches($_)) { $self->{protocolfh}->print(sprintf "%s Errors in %s (tag %s)\n", $_, $search->{logbasename}, $search->{tag}); foreach ($search->getmatchmessages($_)) { $self->{protocolfh}->printf("%s\n", $_); } } } $self->{protocolfh}->close(); $self->{protocolwritten} = 1; } } } } if ($search->{options}->{count}) { foreach (qw(OK WARNING CRITICAL UNKNOWN)) { $self->{allerrors}->{$_} += $search->countmatches($_); if ($search->{lastmsg}->{$_}) { $self->{lastmsg}->{$_} = $search->{lastmsg}->{$_}; } foreach my $searchmatch ($search->getmatches($_)) { $self->addfirstmatch($_, $searchmatch->[1], $searchmatch->[0]); } while (scalar($self->getmatches($_)) > $self->get_option("preview")) { $self->removelastmatch($_); } } } $self->formulate_result(); if (($search->{tag} eq "prescript") && ($search->{options}->{supersmartscript}) && ($search->{exitcode} > 0)) { # # Failed supersmart prescript. I'm out... # last; } elsif (($search->{tag} eq "postscript") && ($search->{options}->{supersmartscript})) { my $codestr = {reverse %ERRORS}->{$search->{exitcode}}; ($self->{exitmessage}, $self->{perfdata}) = split(/\|/, $search->{lastmsg}->{$codestr}, 2); $self->{exitcode} = $search->{exitcode}; } } } $self->cleanup_protocols(); if ($self->get_option("htmlencode")) { $self->htmlencode(\$self->{exitmessage}); $self->htmlencode(\$self->{long_exitmessage}); } if ($self->{options}->{rununique}) { $self->cleanup_pidfile(); } return $self; } sub htmlencode { my $self = shift; my $pstring = shift; return if ! $$pstring; $$pstring =~ s/&/&/g; $$pstring =~ s//>/g; $$pstring =~ s/"/"/g; } sub await_while_rotate { my $self = shift; my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; if (($min == 0 || $min == 15 || $min == 30 || $min == 45) && $sec < 15) { $self->trace("waiting until **:**:15"); foreach (1..(15 - $sec)) { sleep 1; } } } sub formulate_result { my $self = shift; # # create the summary from all information collected so far # $self->{hint} = sprintf "(%s", join(", ", grep { $_ } ($self->{allerrors}->{CRITICAL} ? sprintf "%d errors", $self->{allerrors}->{CRITICAL} : undef, $self->{allerrors}->{WARNING} ? sprintf "%d warnings", $self->{allerrors}->{WARNING} : undef, $self->{allerrors}->{UNKNOWN} ? sprintf "%d unknown", $self->{allerrors}->{UNKNOWN} : undef)); if ($self->{protocolwritten}) { $self->{hint} .= sprintf " in %s)", basename($self->{protocolfile}); } else { $self->{hint} .= ")"; } foreach my $level (qw(CRITICAL WARNING UNKNOWN OK)) { my $preview; my $continue; if ($self->get_option("preview") > 1) { if (scalar($self->getmatches($level)) < $self->get_option("preview")) { $preview = join(", ", $self->getmatchmessages($level)); } else { $preview = join(", ", $self->getmatchmessages($level)); } $continue = scalar($self->getmatches($level)) <= $self->get_option("preview") ? "" : "..."; } else { $preview = $self->{lastmsg}->{$level}; $continue = $self->{allerrors}->{$level} == 1 ? "" : "..."; } $self->{exitcode} = $ERRORS{$level}; if (($level ne "OK") && ($self->{allerrors}->{$level})) { $self->{exitmessage} = sprintf "%s%s - %s %s", $level, $self->get_option("outputhitcount") ? " - ".$self->{hint} : "", $preview, $continue; last; } else { $self->{exitmessage} = sprintf "OK - no errors or warnings"; } } $self->{perfdata} = join (" ", map { $_->formulate_perfdata(); if ($_->{perfdata}) {$_->{perfdata}} else {()} } @{$self->{searches}}); if ($self->get_option('report') ne "short") { $self->formulate_long_result(); } } sub formulate_long_result { my $self = shift; my $maxlength = $self->get_option('maxlength'); $self->{long_exitmessage} = ""; my $prefix = ($self->get_option('report') eq "html") ? "" : ""; my $suffix = ($self->get_option('report') eq "html") ? "
" : ""; my $messagelen = length($prefix) + length($suffix) + length($self->{exitmessage}); my $line = ""; foreach my $search (@{$self->{searches}}) { next if $search->{tag} eq 'postscript'; if ($search->getmatches("CRITICAL") || $search->getmatches("WARNING") || $search->getmatches("UNKNOWN")) { if ($self->get_option('report') eq "html") { $line = sprintf "tag %s", (($search->getmatches("CRITICAL") && "CRITICAL") || ($search->getmatches("WARNING") && "WARNING") || ($search->getmatches("UNKNOWN") && "UNKNOWN")), $search->{tag}; } else { $line = sprintf "tag %s %s\n", $search->{tag}, (($search->getmatches("CRITICAL") && "CRITICAL") || ($search->getmatches("WARNING") && "WARNING") || ($search->getmatches("UNKNOWN") && "UNKNOWN")); } if ($messagelen + length($line) < $maxlength) { $self->{long_exitmessage} .= $line; $messagelen += length($line); } else { last; } foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { foreach my $message ($search->getmatchmessages($level)) { if ($self->get_option('report') eq "html") { $message =~ s//>/g; $line = sprintf "%s", $level, $message; } else { $line = sprintf "%s\n", $message; } if ($messagelen + length($line) < $maxlength) { $self->{long_exitmessage} .= $line; $messagelen += length($line); } else { last; } } } } } if ($self->{long_exitmessage}) { $self->{long_exitmessage} = sprintf "%s%s%s\n", $prefix, $self->{long_exitmessage}, $suffix; } } sub reset_result { my $self = shift; $self->{allerrors} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; foreach my $search (@{$self->{searches}}) { next if $search->{tag} eq 'postscript'; next if $search->{tag} eq 'prescript'; $search->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [], } } } sub reset { my $self = shift; $self->{allerrors} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; foreach my $level (qw(OK CRITICAL WARNING UNKNOWN)) { $self->{lastmsg}->{$level} = ""; } foreach my $search (@{$self->{searches}}) { $search->reset(); } } sub cleanup_protocols { my $self = shift; # # cleanup old protocol files # # if ($self->{protocololdfiles} =~ /[^\\][ ]/) { # because Core::glob splits the argument on whitespace $self->{protocololdfiles} =~ s/( )/\\$1/g; } foreach my $oldprotocolfile (glob "$self->{protocololdfiles}") { if ((stat $oldprotocolfile)[9] < (time - $self->{protocolretention})) { $self->trace("deleting old protocol %s", $oldprotocolfile); unlink $oldprotocolfile; } } } sub init_macros { my $self = shift; my($sec, $min, $hour, $mday, $mon, $year) = (localtime)[0, 1, 2, 3, 4, 5]; my $cw = $^O =~ /MSWin/ ? 0 : strftime("%V", $sec, $min, $hour, $mday, $mon, $year, -1, -1, -1); $year += 1900; $mon += 1; # # Set default values for the built-in macros. # my $DEFAULTMACROS = { CL_DATE_YYYY => sprintf("%04d", $year), CL_DATE_YY => substr($year,2,2), CL_DATE_MM => sprintf("%02d", $mon), CL_DATE_DD => sprintf("%02d", $mday), CL_DATE_HH => sprintf("%02d", $hour), CL_DATE_MI => sprintf("%02d", $min), CL_DATE_SS => sprintf("%02d", $sec), CL_DATE_TIMESTAMP => sprintf("%10d", time), CL_DATE_CW => sprintf("%02d", $cw), CL_NSCA_HOST_ADDRESS => "127.0.0.1", CL_NSCA_PORT => 5667, CL_NSCA_TO_SEC => 10, CL_NSCA_CONFIG_FILE => "/usr/local/nagios/etc/send_nsca.cfg", }; if (defined(&Win32::LoginName)) { $DEFAULTMACROS->{CL_USERNAME} = &Win32::LoginName(); $DEFAULTMACROS->{CL_HAS_WIN32} = 1; } else { $DEFAULTMACROS->{CL_USERNAME} = scalar getpwuid $>; $DEFAULTMACROS->{CL_HAS_WIN32} = 0; } if ($^O eq "linux" && hostname() =~ /([^\.]+)\.(.+)/) { # Wenn im Hostnamen ein Punkt vorkommt, dann haengt sich das u.g. # Net::Domain::hostname gerne auf. Beispiel: # hostname -> hostxy.deppen.net # domainname -> (none) # Net::Domain::hostdomain schaut in /etc/resolv.conf und findet # search americadc.deppen.com und anstatt den Krempel nach dem # Punkt im Hostnamen wegzuwerfen, pappt es den Hostnamen und die # erste Domain aus der search-Zeile zusammen und fragt beim Resolver # nach hostxy.deppen.net.americadc.deppen.com und das rennt von # Timeout zu Retry und nochmal und fuenfmal im Kreis. # Und irgendwann wird's dem Naemon zu bloed und der knallt check_logfiles # weg und der Lausser darf sich durch den ganzen Perl-Kack wuehlen, # obwohl er lieber Bauer sucht Frau anschauen wuerde. # Deshalb also diese folgenden drei Zeilen. # Vorerst nur fuer Linux, denn hier ist der Schlamassel aufgetreten. $DEFAULTMACROS->{CL_HOSTNAME} = $1; $DEFAULTMACROS->{CL_DOMAIN} = $2; $DEFAULTMACROS->{CL_FQDN} = $ENV{HOSTNAME}; } elsif (defined(&Net::Domain::hostname)) { $DEFAULTMACROS->{CL_HOSTNAME} = &Net::Domain::hostname(); $DEFAULTMACROS->{CL_DOMAIN} = &Net::Domain::hostdomain(); $DEFAULTMACROS->{CL_FQDN} = &Net::Domain::hostfqdn(); $DEFAULTMACROS->{CL_HAS_NET_DOMAIN} = 1; } else { $DEFAULTMACROS->{CL_HOSTNAME} = POSIX::uname(); $DEFAULTMACROS->{CL_DOMAIN} = "localdomain"; $DEFAULTMACROS->{CL_FQDN} = POSIX::uname().'.'.'localdomain'; $DEFAULTMACROS->{CL_HAS_NET_DOMAIN} = 0; } #printf STDERR "%s\n", Data::Dumper::Dumper($DEFAULTMACROS); $DEFAULTMACROS->{CL_IPADDRESS} = scalar gethostbyname($DEFAULTMACROS->{CL_HOSTNAME}) ? inet_ntoa(scalar gethostbyname($DEFAULTMACROS->{CL_HOSTNAME})) : '127.0.0.1'; # # Add self-defined macros to the defaultmacros structure or overwrite # already defined macros. # if ($self->{macros}) { foreach (keys %{$self->{macros}}) { $DEFAULTMACROS->{$_} = $self->{macros}->{$_}; } } # # Add self-defined macros from the command line # --macro CL_KAAS="so a kaas" --macro CL_SCHMARRN="so a schmarrn" # if ($self->{cmdlinemacros}) { foreach (keys %{$self->{cmdlinemacros}}) { $DEFAULTMACROS->{$_} = $self->{cmdlinemacros}->{$_}; } } # # Escape the most commonly used special characters so they will no longer # be treated like special characters in a pattern. # $self->{macros} = $DEFAULTMACROS; return $self; } sub late_init_macros { # these are macros filled with values that do not exist before # the Nagios::CheckLogfiles object has been fully initialized my $self = shift; $self->{macros}->{CL_SERVICEDESC} = $self->{cfgbase}; $self->{macros}->{CL_NSCA_SERVICEDESC} = $self->{cfgbase}; $self->{macros}->{CL_WARNING} = $self->{warning}; $self->{macros}->{CL_CRITICAL} = $self->{critical}; } sub merge_macros { my $self = shift; my $extramacros = shift; foreach (keys %{$extramacros}) { $self->{macros}->{$_} = $extramacros->{$_}; } } # # Resolve macros in a string. # If a second parameter is given, then this string is meant as a regular expression. # Escape special characters accordingly. # sub resolve_macros { my $self = shift; my $pstring = shift; return if ! defined $$pstring; while ($$pstring =~ /\$(.+?)\$/g) { my $maybemacro = $1; if (exists $self->{macros}->{$maybemacro}) { my $macro = $self->{macros}->{$maybemacro}; $$pstring =~ s/\$$maybemacro\$/$macro/; } } } sub resolve_macros_in_pattern { my $self = shift; my $pstring = shift; return if ! $$pstring; while ($$pstring =~ /\$(.+?)\$/g) { # das alte bleibt hier stehen als denkmal der schande #while ($$pstring =~ /.*\$(\w+)\$.*/g) { my $maybemacro = $1; if (exists $self->{macros}->{$maybemacro}) { my $macro = $self->{macros}->{$maybemacro}; # # Escape the most commonly used special characters so they will no longer # be treated like special characters in a pattern. # $macro =~ s|/|\\/|g; $macro =~ s|\-|\\-|g; $macro =~ s|\.|\\.|g; $$pstring =~ s/\$$maybemacro\$/$macro/; } } } sub default_options { my $self = shift; my $defaults = shift; $self->{defaultoptions} = {}; while (my($key, $value) = each %{$defaults}) { $self->{options}->{$key} = $value; $self->{defaultoptions}->{$key} = $value; } } sub set_options { my $self = shift; my $options = shift; while (my($key, $value) = each %{$options}) { $self->{options}->{$key} = $value if $value; } } sub set_option { my $self = shift; my $option = shift; my $value = shift; $self->{options}->{$option} = $value if defined $value; } sub get_option { my $self = shift; my $option = shift; return exists $self->{options}->{$option} ? $self->{options}->{$option} : undef; } sub get_options { my $self = shift; my $list = shift; if (! $list) { return $self->{options}; } else { my %h = map {($_, $self->{options}->{$_})} split(',', $list); return \%h; } } sub get_non_default_options { my $self = shift; my $list = shift; if (! $list) { my %h = map { ($_, $self->{options}->{$_}) } grep { ! exists $self->{defaultoptions}->{$_} || "$self->{defaultoptions}->{$_}" ne "$self->{options}->{$_}"; } keys %{$self->{options}}; return \%h; } else { my %h = map { ($_, $self->{options}->{$_}) } grep { ! exists $self->{defaultoptions}->{$_} || "$self->{defaultoptions}->{$_}" ne "$self->{options}->{$_}"; } split(',', $list); return \%h; } } sub refresh_default_options { my $self = shift; my $options = shift; if ($options) { if (ref($options) eq 'HASH') { # already as hash foreach my $option (keys %{$options}) { my $optarg = $options->{$option}; if (! exists $self->{defaultoptions}->{$option} || "$self->{defaultoptions}->{$option}" eq "$self->{options}->{$option}") { $self->{options}->{$option} = $optarg; } } } } } sub refresh_options { my $self = shift; my $options = shift; if ($options) { if (ref($options) eq 'HASH') { # already as hash foreach my $option (keys %{$options}) { my $optarg = $options->{$option}; foreach my $defoption (keys %{$self->{options}}) { if ($option eq $defoption) { $self->{options}->{$defoption} = $optarg; } } } } else { # comes as string foreach my $option (split /,/, $options) { my $optarg = undef; $option =~ s/^\s+//; $option =~ s/\s+$//; if ($option =~ /(.*)=(.*)/) { $option = $1; $optarg = $2; $optarg =~ s/^"//; $optarg =~ s/"$//; $optarg =~ s/^'//; $optarg =~ s/'$//; } foreach my $defoption (keys %{$self->{options}}) { if ($option eq $defoption) { if (defined $optarg) { # example: sticky=3600,syslogclient="winhost1.dom" $self->{options}->{$defoption} = $optarg; } else { $self->{options}->{$defoption} = 1; } } elsif ($option eq 'no'.$defoption) { $self->{options}->{$defoption} = 0; } } } } } # reset [smart][pre|post]script options if no script should be called foreach my $option (qw(script prescript postscript)) { if (exists $self->{options}->{'supersmart'.$option}) { $self->{options}->{'smart'.$option} = 1 if $self->{options}->{'supersmart'.$option}; } if (exists $self->{options}->{'smart'.$option}) { $self->{options}->{$option} = 1 if $self->{options}->{'smart'.$option}; } if (exists $self->{options}->{$option}) { if (($self->{options}->{$option}) && ! exists $self->{$option}) { $self->{options}->{$option} = 0; $self->{options}->{'smart'.$option} = 0; $self->{options}->{'supersmart'.$option} = 0; } } } if ($self->{options}->{sticky}) { if ($self->{options}->{sticky} > 1) { $self->{maxstickytime} = $self->{options}->{sticky}; $self->{options}->{sticky} = 1; } else { # durch mehrmaliges refresh (seitens des CheckLogfiles-Objekts kann maxstickytime # zerschossen werden if (! exists $self->{maxstickytime} || $self->{maxstickytime} == 0) { $self->{maxstickytime} = 3600 * 24 * 365 * 10; } } } if ($self->{options}->{syslogclient}) { # $self->{prefilter} = $self->{options}->{syslogclient}; } } sub trace { my $self = shift; my $format = shift; $self->{tracebuffer} = [] unless exists $self->{tracebuffer}; push(@{$self->{tracebuffer}}, @_); if ($self->{verbose}) { printf("%s: ", scalar localtime); printf($format."\n", @_); } if ($self->{trace}) { my $logfh = new IO::File; $logfh->autoflush(1); if ($logfh->open($self->{tracefile}, "a")) { $logfh->printf("%s: ", scalar localtime); $logfh->printf($format, @_); $logfh->printf("\n"); $logfh->close(); } } } sub action { my $self = shift; my $script = shift; my $scriptparams = shift; my $scriptstdin = shift; my $scriptdelay = shift; my $smart = shift; my $privatestate = shift; my $success = 0; my $rc = 0; my $exitvalue; my $signalnum; my $dumpedcore; my $output; my $pid = 0; my $wait = 0; my $strerror = (qw(OK WARNING CRITICAL UNKNOWN)) [$self->{macros}->{CL_SERVICESTATEID}]; my $cmd; my @stdinformat = (); foreach my $macro (keys %{$self->{macros}}) { my $envmacro = $macro; if ($envmacro =~ /^CL_/) { $envmacro =~ s/^CL_/CHECK_LOGFILES_/; } else { $envmacro = "CHECK_LOGFILES_".$macro; } $ENV{$envmacro} = defined($self->{macros}->{$macro}) ? $self->{macros}->{$macro} : ""; } $ENV{CHECK_LOGFILES_SERVICESTATE} = (qw(OK WARNING CRITICAL UNKNOWN)) [$ENV{CHECK_LOGFILES_SERVICESTATEID}]; if (ref $script eq "CODE") { $self->trace("script is of type %s", ref $script); if (ref($scriptparams) eq "ARRAY") { foreach (@{$scriptparams}) { $self->resolve_macros(\$_) if $_; } } my $stdoutvar; open (my $SAVEOUT, '>&', STDOUT); close STDOUT; eval { our $CHECK_LOGFILES_PRIVATESTATE = $privatestate; open(STDOUT, ">", \$stdoutvar); $exitvalue = &{$script}($scriptparams, $scriptstdin); }; open (STDOUT, '>&', $SAVEOUT); if ($@) { $output = $@; $success = 0; $rc = -1; $self->trace("script said: %s", $output); } else { #$output = $stdoutvar || ""; $output = defined $stdoutvar ? $stdoutvar : ""; chomp $output; $self->trace("script said: %s", $output); if ($smart) { if (($exitvalue =~ /^\d/) && ($exitvalue >= 0 && $exitvalue <= 3)) { $success = 1; $rc = $exitvalue; $self->trace("script %s exits with code %d", $script, $rc); } else { $success = 1; $rc = -4; $self->trace("script %s failed for unknown reasons", $script); } } else { $success = 1; $rc = $exitvalue; $output = $self->{macros}->{CL_SERVICEOUTPUT}; } } } else { my $pathsep = ($^O =~ /MSWin/) ? ';' : ':'; foreach my $dir (split(/$pathsep/, $self->{scriptpath})) { if ( -x $dir.'/'.$script || ( -f $dir.'/'.$script && $^O =~ /cygwin|MSWin/ && $script =~ /\.(bat|exe)$/i )) { $self->trace(sprintf "found script in %s/%s", $dir, $script); $cmd = sprintf "%s/%s", $dir, $script; if ($^O =~ /MSWin/) { $cmd =~ s/\//\\/g; if ($cmd =~ /\s/) { if (defined(&Win32::GetShortPathName)) { $cmd = &Win32::GetShortPathName($cmd); } else { $cmd = sprintf "\"%s\"", $cmd; } } } else { # need to escape blanks if ($cmd =~ /\s/) { $cmd =~ s/([ ])/\\$1/g; } } last; } } if ($cmd) { if (defined $scriptparams) { $self->resolve_macros(\$scriptparams); $cmd = sprintf "%s %s", $cmd, $scriptparams; } $self->trace(sprintf "execute %s", $cmd); if (defined $scriptstdin) { my $pid = 0; my $wait = 0; my $maxlines = 100; if (! ref($scriptstdin eq "ARRAY")) { $scriptstdin = [$scriptstdin]; } foreach (@{$scriptstdin}) { $self->resolve_macros(\$_); } @stdinformat = @{$scriptstdin}; # if the format string was defined using single quotes, the escape # characters must be expanded. $stdinformat[0] =~ s/\\t/\t/g; $stdinformat[0] =~ s/\\n/\n/g; # if there is a % in CL_SERVICEOUTPUT we have to escape it $stdinformat[0] =~ s/%/%%/g; $SIG{'PIPE'} = sub {}; $SIG{'CHLD'} = sub {}; my($chld_out, $chld_in); $pid = open2($chld_out, $chld_in, $cmd); $self->trace("stdin is <trace(@stdinformat); $self->trace("EOF"); $chld_in->printf(@stdinformat); $chld_in->close(); $output = $chld_out->getline() || ""; while ($maxlines-- > 0) { # sucking the remaining output to avoid sigpipe $chld_out->getline() || last; } chomp $output; $chld_out->flush(); $chld_out->close(); if ($^O =~ /MSWin/) { # unfortunately waitpid in rare cases returns -1 on windows $wait = wait; } else { $wait = waitpid $pid, 0; } $exitvalue = $? >> 8; $signalnum = $? & 127; $dumpedcore = $? & 128; if (($signalnum == 13) && ($maxlines < 0)) { $signalnum = 0; # the script printed more than the allowed 100 lines of output. # closing the descriptor $chld_out caused a SIGPIPE which will # be accepted here. } } else { my @output = `$cmd`; # find the first non-empty line @output = map { chomp; $_; } grep !/^$/, @output; $output = $output[0] || ""; $exitvalue = $? >> 8; $signalnum = $? & 127; $dumpedcore = $? & 128; } $self->trace("script said: %s", $output); if ($wait != $pid) { $success = 0; $rc = -5; $self->trace("wait %d != %d", $wait, $pid); } elsif ($signalnum) { $success = 0; $rc = -2; $self->trace("script %s received signal %d", $script, $signalnum); $self->trace("script %s exits with code %d", $script, $rc); } elsif ($dumpedcore) { $success = 0; $rc = -3; $self->trace("script %s failed with core dump", $script); } elsif ($smart) { if ($exitvalue >= 0 && $exitvalue <= 3) { $success = 1; $rc = $exitvalue; $self->trace("script %s exits with code %d", $script, $rc); } else { $success = 0; $rc = -4; $self->trace("script %s failed for unknown reasons", $script); } } else { $success = 1; $rc = $exitvalue; $output = $self->{macros}->{CL_SERVICEOUTPUT}; } } else { $self->trace(sprintf "could not find %s", $script); $success = 0; $rc = -1; } } if ($scriptdelay) { $self->trace(sprintf "sleeping for %d seconds", $scriptdelay); sleep $scriptdelay; } map { /^CHECK_LOGFILES/ && delete $ENV{$_}; } keys %{$ENV}; if($output) { # remove ticks in case the script was badly programmed # this is ugly and should be left to the scripts author $output =~ s/^"//; $output =~ s/"$//g; } return ($success, $rc, $output) } sub getfilefingerprint { my $self = shift; my $file = shift; if (-f $file) { if ($self->get_option('randominode')) { return "00:00"; } elsif ($^O eq "MSWin32") { my $magic; if (ref $file) { my $pos = $file->tell(); $file->seek(0, 0); $magic = $file->getline() || "this_was_an_empty_file"; $file->seek(0, $pos); } else { my $fh = new IO::File; $fh->open($file, "r"); $magic = $fh->getline() || "this_was_an_empty_file"; $fh->close(); } if ($self->{options}->{encoding}) { $magic =~ tr/\x80-\xFF//d; $magic =~ tr/\x00-\x1F//d; } $self->trace("magic: %s", $magic); #return(md5_base64($magic)); return(unpack("H*", $magic)); # use the creation time as unique identifier # haaaahaaaaaa win32 creation time is a good joke # google for "tunneling" return sprintf "0:%d", (stat $file)[10]; #return "0:0"; } elsif ($^O eq "linux") { open(MTAB, "/etc/mtab"); my @mtab = ; close MTAB; my @nfsmounts = grep { substr($_->[2], 0, 3) eq "nfs" } map { my ($dev, $mountpoint, $fstype, $rest) = split(/\s+/, $_); [$mountpoint, length($mountpoint), $fstype]; } @mtab; if (@nfsmounts) { # we have nfs mounts if (-l $file) { # Maybe the logfile is a symlink pointing to a file residing # in an nfs-mounted directory. we need to resolve the link. # The following find-routine was copied from # http://www.stonehenge.com/merlyn/UnixReview/col27.html # The author was Randal L. Schwartz, a renowned expert # on the Perl programming language. Thanks Randal! my $dir = cwd; find(sub { my @right = split /\//, $File::Find::name; my @left = do { @right && ($right[0] eq "") ? shift @right : # quick way split /\//, $dir; }; # first element always null while (@right) { my $item = shift @right; next if $item eq "." or $item eq ""; if ($item eq "..") { pop @left if @left > 1; next; } my $link = readlink (join "/", @left, $item); if (defined $link) { my @parts = split /\//, $link; if (@parts && ($parts[0] eq "")) { # absolute @left = shift @parts; # quick way } unshift @right, @parts; next; } else { push @left, $item; next; } } $self->trace("%s is a symlink pointing to %s", $file, join("/", @left)); $file = join("/", @left); }, ($file)); } $file = File::Spec->rel2abs($file) unless File::Spec->file_name_is_absolute($file); my @mountpoints = sort { $b->[1] <=> $a->[1] } grep { substr($file, 0, $_->[1]) eq $_->[0]; } grep { # add an extra filter for nfs, because we had this one: # /etc/auto.direct /pgm autofs rw,relatime.... # nasxy.customer:/vol/zrxwfzx/schnorch_orga1 /pgm nfs # the first line was found -> no nfs -> dev jumped -> critical $_->[2] eq "nfs"; # brauchts seit issue #33 eigentlich nicht mehr, weil in dieser # schleife hier eh @nfsmounts und nicht mehr mtab durchlaufen wird, # aber als mahnmal fuer schlamperei und wegen des schoenen # beispiel-mounts bleibt das stehen. } @nfsmounts; if ($self->get_option('randomdevno')) { # issue #65, xfs and lvm and a kvm disk, device number changes on reboot return sprintf "%d", (stat $file)[1]; } elsif (scalar(@mountpoints) && substr($mountpoints[0][2], 0, 3) eq "nfs") { # At least under RedHat 5 we saw a strange phenomenon: # The device number of an nfs-mounted volume changed from time # to time, and so did the logfile fingerprint. # That's the reason, why we only use the inode for rotation detection # in such an environment. return sprintf "%d", (stat $file)[1]; } else { return sprintf "%d:%d", (stat $file)[0], (stat $file)[1]; } } else { return sprintf "%d:%d", (stat $file)[0], (stat $file)[1]; } } else { return sprintf "%d:%d", (stat $file)[0], (stat $file)[1]; } } else { return "0:0"; } } sub getfilesize { my $self = shift; my $file = shift; return (-f $file) ? (stat $file)[7] : 0; } sub getfileisreadable { my $self = shift; my $file = shift; if ($^O =~ /MSWin/) { # -r is not reliable when working with cacls my $fh = new IO::File; if ($fh->open($file, "r")) { $fh->close(); return 1; } else { return undef; } } elsif (-r $file) { return 1; } else { use filetest 'access'; $self->trace("stat (%s) failed, try access instead", $file); if (-r $file) { return 1; } else { # i'm catholic. i believe in miracles. my $fh = new IO::File; if ($fh->open($file, "r")) { $fh->close(); return 1; } else { return 0; } } } } sub getfileisexecutable { my $self = shift; my $file = shift; if ($^O =~ /MSWin/) { printf STDERR "not yet\n"; } elsif (-x $file) { return 1; } else { use filetest 'access'; $self->trace("stat (%s) failed, try access instead", $file); if (-x $file) { return 1; } else { return 0; } } } sub old_getfileisreadable { my $self = shift; my $file = shift; my $fh = new IO::File; if ($^O =~ /MSWin/) { if ($fh->open($file, "r")) { $fh->close(); return 1; } else { return undef; } } elsif (($^O eq "linux") || ($^O eq "cygwin")) { if (! -r $file) { use filetest 'access'; $self->trace("stat (%s) failed, try access instead", $file); return -r $file; } return -r $file; } else { return -r $file; } } sub system_tempdir { my $self = shift; if ($^O =~ /MSWin/) { return $ENV{TEMP} if defined $ENV{TEMP}; return $ENV{TMP} if defined $ENV{TMP}; return File::Spec->catfile($ENV{windir}, 'Temp') if defined $ENV{windir}; return 'C:\Temp'; } else { return "/tmp"; } } sub construct_pidfile { my $self = shift; if (exists $self->{abscfgfile}) { $self->{pidfilebase} = $self->{abscfgfile}; } else { $self->{pidfilebase} = $self->{tag}; $self->{pidfilebase} .= $self->{logfile}; } $self->{pidfilebase} =~ s/\//_/g; $self->{pidfilebase} =~ s/\\/_/g; $self->{pidfilebase} =~ s/:/_/g; $self->{pidfilebase} =~ s/\s/_/g; $self->{pidfilebase} =~ s/\.cfg$//g; if (scalar(keys %{$self->{cmdlinemacros}})) { my $macrostring = "macros_"; foreach my $key (sort keys %{$self->{cmdlinemacros}}) { $macrostring .= $key."=".$self->{cmdlinemacros}->{$key}."_"; } $macrostring =~ s/\//_/g; $macrostring =~ s/\\/_/g; $macrostring =~ s/:/_/g; $macrostring =~ s/\s/_/g; $self->{pidfilebase} .= "_".$macrostring; } return sprintf "%s/%s.pid", $self->{seekfilesdir}, $self->{pidfilebase}; } sub write_pidfile { my $self = shift; if (! -d dirname($self->{pidfile})) { eval "require File::Path;"; if (defined(&File::Path::mkpath)) { import File::Path; eval { mkpath(dirname($self->{pidfile})); }; } else { my @dirs = (); map { push @dirs, $_; mkdir(join('/', @dirs)) if join('/', @dirs) && ! -d join('/', @dirs); } split(/\//, dirname($self->{pidfile})); } } my $fh = new IO::File; $fh->autoflush(1); if ($fh->open($self->{pidfile}, "w")) { $fh->printf("%s", $$); $fh->close(); } else { $self->trace("Could not write pidfile %s", $self->{pidfile}); die "pid file could not be written"; } } sub check_pidfile { my $self = shift; my $fh = new IO::File; if ($fh->open($self->{pidfile}, "r")) { my $pid = $fh->getline(); $fh->close(); if (! $pid) { $self->trace("Found pidfile %s with no valid pid. Exiting.", $self->{pidfile}); return 0; } else { $self->trace("Found pidfile %s with pid %d", $self->{pidfile}, $pid); my $pidfile_status = 0; # 0=no such pid # 1=held by check_logfiles # 2=held by other if ($^O =~ /MSWin/) { eval "require Win32::OLE;"; if (defined(&Win32::OLE::GetObject)) { import Win32::Daemon; my $objWMI = Win32::OLE->GetObject('winmgmts://./root/cimv2'); foreach my $p (Win32::OLE::in ($objWMI->InstancesOf("Win32_Process")) ) { if ($pid == $p->ProcessID) { if ($p->Name =~ /.*check_logfiles.*/) { $pidfile_status = 1; } else { $pidfile_status = 2; } } } } else { die "get Win32::OLE first"; } } else { kill 0, $pid; if ($! == Errno::ESRCH) { $pidfile_status = 0; } else { $pidfile_status = 2; open(KILL, "/bin/ps -o pid,args -e|"); while () { if (/^\s*(\d+)\s+.*check_logfiles.*/) { if ($1 == $pid) { $pidfile_status = 1; } } } close KILL; } } if ($pidfile_status == 0) { $self->trace("This pidfile is stale. Writing a new one"); $self->write_pidfile(); return 1; } elsif ($pidfile_status == 1) { $self->trace("This pidfile is held by a running process. Exiting"); return 0; } else { $self->trace("This pidfile is held by some other process. Writing a new one"); $self->write_pidfile(); return 1; } } } else { $self->trace("Found no pidfile. Writing a new one"); $self->write_pidfile(); return 1; } } sub cleanup_pidfile { my $self = shift; if ($self->{pidfile}) { $self->trace(sprintf "Cleanup pidfile. %s", -f $self->{pidfile} ? "Yes" : "No"); -f $self->{pidfile} && unlink $self->{pidfile}; $self->trace(sprintf "Cleaned up pidfile. %s", ! -f $self->{pidfile} ? "Yes" : "No"); } else { $self->trace("Not running with a pidfile"); } } sub under_systemctl { my $self = shift; return 0 if $^O !~ /linux/; my $systemctl = 0; if (-x "/usr/bin/systemctl" || -x "/bin/systemctl") { open(SYSTEMCTL, "systemctl status $$|"); while () { if (/Main PID: (\d+)\s/) { $systemctl = 1 if $1 == $$; } } close SYSTEMCTL; } return $systemctl; } sub run_as_daemon { my $self = shift; my $delay = shift; if ($^O =~ /MSWin/) { if ($ENV{PROMPT}) { # i was called from a shell # vielleicht irgendwas mit detach die "not yet implemented"; } else { eval "require Win32::Daemon;"; if (defined(&Win32::Daemon::StartService)) { import Win32::Daemon; my $svc_callback = sub { my( $event, $context ) = @_; # # entgegen der DRECKSDOKU enthaelt $event NICHT den Status # $event = Win32::Daemon::State(); $context->{last_event} = $event; if ($event == SERVICE_RUNNING()) { # main loop $self->trace("Entering main loop"); do { $self->run(); $self->trace(sprintf "%s%s\n%s", $self->{exitmessage}, $self->{perfdata} ? "|".$self->{perfdata} : "", $self->{long_exitmessage} ? $self->{long_exitmessage}."\n" : ""); $self->reset(); foreach (1..$delay) { if (Win32::Daemon::State() == SERVICE_RUNNING()) { sleep 1; } else { last; } } } while(Win32::Daemon::State() == SERVICE_RUNNING()); $self->trace("Leaving main loop"); } elsif ($event == SERVICE_START_PENDING()) { # Initialization code $self->trace("Service initialized"); $context->{last_state} = SERVICE_RUNNING(); Win32::Daemon::State(SERVICE_RUNNING()); } elsif ($event == SERVICE_PAUSE_PENDING()) { $self->trace("Service makes a break"); $context->{last_state} = SERVICE_PAUSED(); Win32::Daemon::State(SERVICE_PAUSED()); } elsif ($event == SERVICE_CONTINUE_PENDING()) { $self->trace("Service continues"); $context->{last_state} = SERVICE_RUNNING(); Win32::Daemon::State(SERVICE_RUNNING()); } elsif ($event == SERVICE_STOP_PENDING()) { $self->trace("Service stops"); $context->{last_state} = SERVICE_STOPPED(); $self->trace("Daemon exiting..."); Win32::Daemon::State(SERVICE_STOPPED()); Win32::Daemon::StopService(); } else { # Take care of unhandled states by setting the State() # to whatever the last state was we set... $self->trace("Service got an unhandled call"); Win32::Daemon::State( $context->{last_state} ); } return(); }; Win32::Daemon::RegisterCallbacks($svc_callback); my %context = ( count => 0, start_time => time(), keep_going => 0, make_a_break => 0, ); # Start the service passing in a context and # indicating to callback using the "Running" event # every 2000 milliseconds (2 seconds). Win32::Daemon::StartService(\%context, 2000); } else { die "omeiomeiomei nix Win32::Daemon"; } } } else { # pidfile must be created before the chdir because it is based on the # cfgfile which can be a relative path $self->{pidfile} = $self->{pidfile} || $self->construct_pidfile(); if (! $self->check_pidfile()) { $self->trace("Exiting because another daemon is already running"); printf "Exiting because another daemon is already running\n"; exit 3; } if (! POSIX::setsid()) { $self->trace("Cannot detach from controlling terminal"); printf "Cannot detach from controlling terminal\n"; exit 3; } $self->set_memory_limit(); chdir '/'; my $under_systemctl = $self->under_systemctl(); if (! $under_systemctl) { exit if (fork()); exit if (fork()); } $self->write_pidfile(); open STDIN, '+>/dev/null'; open STDOUT, '+>&STDIN'; open STDERR, '+>&STDIN'; my $keep_going = 1; $self->trace(sprintf "Daemon running with pid %d", $$); foreach my $signal (qw(HUP INT TERM QUIT)) { $SIG{$signal} = sub { $self->trace("Caught SIG%s: exiting gracefully", $signal); $keep_going = 0; }; } $self->trace("Entering main loop"); do { $self->run(); $self->trace(sprintf "%s%s\n%s", $self->{exitmessage}, $self->{perfdata} ? "|".$self->{perfdata} : "", $self->{long_exitmessage} ? $self->{long_exitmessage}."\n" : ""); $self->reset(); foreach (1..$delay) { if ($keep_going) { sleep 1; } else { last; } } } while($keep_going); $self->cleanup_pidfile(); $self->trace("Daemon exiting..."); } } sub install_windows_service { my $self = shift; my $servicename = shift || 'check_logfiles'; my $cfgfile = shift; my $username = shift; my $password = shift; if ($^O =~ /MSWin/) { eval "require Win32::Daemon;"; if (defined(&Win32::Daemon::StartService)) { import Win32::Daemon; my $fullpath = Win32::GetFullPathName($0); my ($cwd, $base, $ext) = ( $fullpath =~ /^(.*\\)(.*)\.(.*)$/ ) [0..2] ; my $servicepath = ($ext eq 'exe') ? "\"$fullpath\"" : "\"$^X\""; my $serviceparameters = ($ext eq 'exe') ? "--daemon --config \"$cfgfile\"" : " \"$fullpath\" --daemon --config \"$cfgfile\""; my $service = { machine => '', name => $servicename, display => $servicename, path => $servicepath, parameters => $serviceparameters, user => ($username || ''), password => ($password || ''), description => 'This is the Nagios plugin check_logfiles', }; if (Win32::Daemon::CreateService($service)) { $self->{exitmessage} = 'Successfully added service'; $self->{exitcode} = 0; } else { $self->{exitmessage} = 'Failed to add service: '. Win32::FormatMessage(Win32::Daemon::GetLastError()); $self->{exitcode} = 3; } } else { die "nix Win32::Daemon, nix Service, nix install"; } } else { $self->{exitmessage} = 'You just installed a Windows service on a Unix machine. Good luck.'; $self->{exitcode} = 0; } } sub deinstall_windows_service { my $self = shift; my $servicename = shift || 'check_logfiles'; if ($^O =~ /MSWin/) { eval "require Win32::Daemon;"; if (defined(&Win32::Daemon::StartService)) { import Win32::Daemon; if (Win32::Daemon::DeleteService('', $servicename)) { $self->{exitmessage} = 'Successfully deinstalled service'; $self->{exitcode} = 0; } else { $self->{exitmessage} = 'Failed to deinstall service: '. Win32::FormatMessage(Win32::Daemon::GetLastError()); $self->{exitcode} = 3; } } } else { $self->{exitmessage} = 'Congrats. You just deinstalled a Windows service on a Unix machine.'; $self->{exitcode} = 0; } } # We won't allow check_logfiles to consume 70GB of memory any more :-) sub set_memory_limit { my $self = shift; my $limit = $self->get_option("maxmemsize"); # megabytes if (! $limit) { return; } elsif ($limit < 200) { $self->trace("I won't run with at least 200MB memory"); printf "I won't run with at least 200MB memory\n"; exit 3; } elsif ($^O eq "solaris" && ! defined(&SYS_setrlimit)) { # From /usr/include/sys/syscall.h and /usr/include/sys/resource.h eval 'sub SYS_setrlimit () {128;}'; eval 'sub SYS_getrlimit () {129;}'; eval 'sub RLIMIT_AS () {6;}'; } elsif (! defined(&SYS_setrlimit)) { $self->trace("I dont't know how to set resource limits"); printf "I dont't know how to set resource limits\n"; exit 3; } $SIG{'SEGV'} = sub { # usually the perl interpreter aborts after a failed mmap with a # "Out of memory" message. Do not expect to execute a signal handler. printf "I received a SIGSEGV\n"; exit 3; }; my $soft_as_limit = int(1024 * 1024 * $limit); my $hard_as_limit = int(1024 * 1024 * $limit); # L! = native long unsigned int my $limits = pack "L!L!", $soft_as_limit, $hard_as_limit; if (syscall(&SYS_setrlimit, &RLIMIT_AS, $limits) == -1) { $self->trace("Cannot set address space limits (%s)", "$!"); printf "Cannot set address space limits (%s)\n", "$!"; exit 3; } else { syscall(&SYS_getrlimit, &RLIMIT_AS, $limits); my ($new_soft_as_limit, $new_hard_as_limit) = unpack "L!L!", $limits; if ($new_soft_as_limit != $soft_as_limit) { $self->trace("Cannot set address space limits (!=)"); printf "Cannot set address space limits (!=)\n"; exit 3; } else { $self->trace("Setting address space limits to %.2fMB", $limit); } } } sub relocate_dir { # $seekfilesdir = $self->relocate_dir("seekfilesdir", $seekfilesdir, dirname(dirname($abscfgfile)))) { my $self = shift; my $type = shift; my $olddir = shift; my $basedir = shift; my $newdir = ""; if ($olddir =~ /^autodetect:(.*)/) { $self->{"relocate_".$type} = $1; $self->resolve_macros(\$self->{"relocate_".$type}); if ($type eq "scriptpath") { $newdir = join(($^O =~ /MSWin/) ? ';' : ':', grep { -d $_ } map { $basedir.$_; } ('/local/lib/nagios/plugins', '/lib/nagios/plugins')); } else { if (-d $basedir.'/var/tmp' && -w $basedir.'/var/tmp') { $newdir = $basedir.'/var/tmp/check_logfiles'; mkdir($newdir); } elsif (-d $basedir.'/tmp' && -w $basedir.'/tmp') { $newdir = $basedir.'/tmp/check_logfiles'; mkdir($newdir); } elsif ($type eq "seekfilesdir") { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "UNKNOWN - unable to autodetect an adequate seekfilesdir"; return undef; } else { $newdir = $self->system_tempdir(); } } return $newdir; } elsif ($olddir =~ /^homevartmp:(.*)/) { $self->{"relocate_".$type} = $1; $self->resolve_macros(\$self->{"relocate_".$type}); if ($type eq "scriptpath") { } else { foreach my $basedir ($ENV{OMD_ROOT}, $ENV{HOME}) { next if ! $basedir; foreach my $dir ("/var/tmp", "/tmp") { eval { mkpath($basedir.$dir."/check_logfiles"); }; next if $@; $newdir = $basedir.$dir."/check_logfiles"; mkdir($newdir); last; } last if $newdir; } if (! $newdir && $type eq "seekfilesdir") { $ExitCode = $ERROR_UNKNOWN; $ExitMsg = sprintf "UNKNOWN - unable to autodetect an adequate seekfilesdir"; return undef; } elsif (! $newdir) { $newdir = $self->system_tempdir(); } } return $newdir; } else { return $olddir; } } sub countmatches { my $self = shift; my $level = shift; # if report short and sticky count also matchlines XXXcount if ($self->get_option('sticky') and $self->get_option("report") eq "short") { my $matches = 0; map { $matches += $self->{matchlines}->{$level."count"}->{$_}; } keys %{$self->{matchlines}->{$level."count"}}; return $matches; } else { return scalar(@{$self->{matchlines}->{$level}}); } } sub getmatches { my $self = shift; my $level = shift; return @{$self->{matchlines}->{$level}}; } sub getmatchmessages { my $self = shift; my $level = shift; if ($level =~ /^\d/) { $level = (qw(OK WARNING CRITICAL UNKNOWN))[$level]; } else { $level = uc $level; } return map { $_->[1] } @{$self->{matchlines}->{$level}}; } sub getlastmatchmessage { my $self = shift; my $level = shift; if ($level =~ /^\d/) { $level = (qw(OK WARNING CRITICAL UNKNOWN))[$level]; } else { $level = uc $level; } return @{$self->{matchlines}->{$level}}[$#{$self->{matchlines}->{$level}}]->[1]; } sub addfirstmatch { my $self = shift; my $level = shift; my $errormessage = shift; my $when = shift; $when = (defined $when) ? $when : time; if ($level =~ /^\d/) { $level = (qw(OK WARNING CRITICAL UNKNOWN))[$level]; } unshift(@{$self->{matchlines}->{$level}}, [$when, $errormessage]); $self->{lastmsg}->{$level} = ${$self->{matchlines}->{$level}}[$#{$self->{matchlines}->{$level}}]->[1]; } sub removelastmatch { my $self = shift; my $level = shift; if ($level =~ /^\d/) { $level = (qw(OK WARNING CRITICAL UNKNOWN))[$level]; } my $runter = pop(@{$self->{matchlines}->{$level}}); $self->{lastmsg}->{$level} = ${$self->{matchlines}->{$level}}[$#{$self->{matchlines}->{$level}}]->[1]; } sub is_ec2 { my $self = shift; return 0 if $^O !~ /linux/; my $ec2 = 0; if (-f "/etc/os-release") { open(OSRELEASE, "/etc/os-release"); my @osrelease = ; close OSRELEASE; if (grep { /amazon/i } @osrelease) { $ec2 = 1; } return $ec2; } if (-f "/etc/passwd") { open(PASSWD, "/etc/passwd"); my @passwd = ; close PASSWD; if (grep { /^ec2-instance-connect/ } @passwd) { $ec2 = 1; } return $ec2; } if (-r "/sys/hypervisor/uuid") { open(UUID, "/sys/hypervisor/uuid"); my @uuid = ; close UUID; if (@uuid and $uuid[0] =~ /^ec2/i) { $ec2 = 1; } return $ec2; } if (-r "/sys/devices/virtual/dmi/id/product_uuid") { open(UUID, "/sys/devices/virtual/dmi/id/product_uuid"); my @uuid = ; close UUID; if (@uuid and $uuid[0] =~ /^ec2/i) { $ec2 = 1; } return $ec2; } return $ec2; } package Nagios::CheckLogfiles::Search; use strict; use Exporter; use File::Basename; use File::Copy; use POSIX qw(SSIZE_MAX); #use Unicode::Normalize; #use Encode; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles); sub new { my $self = bless {}, shift; my $params = shift; $self->{tag} = $params->{tag} || 'default'; $self->{template} = $params->{template} if $params->{template}; $self->{dynamictag} = $params->{dynamictag} if $params->{dynamictag}; if (exists $self->{template} && exists $self->{dynamictag}) { $self->{tag} = $self->{template}.'_'.$self->{dynamictag}; } else { $self->{tag} = $params->{tag} || 'default'; } $self->{type} = $params->{type}; $self->{logfile} = $params->{logfile}; $self->{rotation} = $params->{rotation}; $self->{script} = $params->{script}; $self->{scriptparams} = $params->{scriptparams}; $self->{scriptstdin} = $params->{scriptstdin}; $self->{scriptdelay} = $params->{scriptdelay}; $self->{cfgbase} = $params->{cfgbase} || "check_logfiles"; $self->{seekfilesdir} = $params->{seekfilesdir} || $self->system_tempdir(); $self->{relocate_seekfilesdir} = $params->{relocate_seekfilesdir}; $self->{archivedir} = $params->{archivedir}; $self->{scriptpath} = $params->{scriptpath}; $self->{macros} = $params->{macros}; $self->{tracefile} = $params->{tracefile}; $self->{prefilter} = $params->{prefilter}; $self->{trace} = -e $self->{tracefile} ? 1 : 0; if (exists $params->{tivolipatterns}) { my $tivoliparams = { }; my $tivolipatterns = []; my $tivoliformatfiles = []; my $tivoliformatstrings = []; if (ref($params->{tivolipatterns}) ne 'ARRAY') { $tivolipatterns = [$params->{tivolipatterns}]; } else { push(@{$tivolipatterns}, @{$params->{tivolipatterns}}); } foreach my $pattern (@{$tivolipatterns}) { if (scalar(@{[split /\n/, $pattern]}) == 1) { push(@{$tivoliparams->{formatfile}}, $pattern); } else { #push(@{$tivoliparams->{formatstring}}, $pattern); # erstmal nur skalar moeglich $tivoliparams->{formatstring} = $pattern; } } if (exists $params->{tivolimapping}) { foreach (keys %{$params->{tivolimapping}}) { $tivoliparams->{severity_mappings}->{lc $_} = 0 if $params->{tivolimapping}->{$_} =~ /(?i)ok/; $tivoliparams->{severity_mappings}->{lc $_} = 1 if $params->{tivolimapping}->{$_} =~ /(?i)warning/; $tivoliparams->{severity_mappings}->{lc $_} = 2 if $params->{tivolimapping}->{$_} =~ /(?i)critical/; $tivoliparams->{severity_mappings}->{lc $_} = 3 if $params->{tivolimapping}->{$_} =~ /(?i)unknown/; $tivoliparams->{severity_mappings}->{lc $_} = $params->{tivolimapping}->{$_} if $params->{tivolimapping}->{$_} =~ /\d/; } } if ($self->{tivoli}->{object} = Nagios::Tivoli::Config::Logfile->new( $tivoliparams )) { } else { die "could not create tivoli object from $params->{tivolipatterns}"; } } if (! $self->{type}) { if ($self->{rotation}) { $self->{type} = "rotating"; } else { $self->{type} = "simple"; } } $self->{privatestate} = {}; my $class = sprintf "Nagios::CheckLogfiles::Search::%s", join "::", map { (uc substr($_, 0, 1)).substr($_, 1); } split(/::/, $self->{type}); bless $self, $class; if (! $self->can("init")) { # # Maybe $class was not defined in this file. Try to find # the external module. # my $module = $class.".pm"; $module =~ s/::/\//g; foreach (@INC) { if (-f $_."/$module") { require $module; bless $self, $class; last; } } } if ($self->can("init")) { if ($self->init($params)) { return $self; } else { return undef; } } else { return undef; } } # # Read a hash with parameters # sub init { my $self = shift; my $params = shift; $self->{laststate} = {}; $self->{relevantfiles} = []; $self->{preliminaryfilter} = { SKIP => [], NEED => [] }; $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{lastmsg} = { OK => "", WARNING => "", CRITICAL => "", UNKNOWN => "" }; $self->{patterns} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{patternfuncs} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{negpatterns} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{negpatterncnt} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{exceptions} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{threshold} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; $self->{thresholdcnt} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; $self->{thresholdtimes} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{patternkeys} = { OK => {}, WARNING => {}, CRITICAL => {}, UNKNOWN => {} }; $self->{filepatterns} = {}; $self->{hasinversepat} = 0; $self->{likeavirgin} = 0; $self->{linesread} = 0; $self->{linenumber} = 0; # used for context $self->{perfdata} = ""; $self->{max_readsize} = 1024 * 1024 * 128; # sysread can only read SSIZE_MAX bytes in one operation. # this is often (1024 * 1024 * 1024 * 2) - 1 = 2GB - 1 # if we need to read from a non-seekable filehandle more than this # amount of data, then we have to perform multiple reads. # because the $bytes variable must hold the result of such a read and # its size is limited by available memory, it is divided by 16 # so each read request does not overburden the sysread call and # does not inflate the process to more than 128MB # # options # $self->default_options({ script => 0, smartscript => 0, supersmartscript => 0, protocol => 1, count => 1, syslogserver => 0, logfilenocry => 1, perfdata => 1, case => 1, sticky => 0, syslogclient => 0, savethresholdcount => 1, thresholdexpiry => 0, encoding => 0, maxlength => 0, lookback => 0, context => 0, allyoucaneat => 0, randominode => 0, randomdevno => 0, preferredlevel => 0, warningthreshold => 0, criticalthreshold => 0, unknownthreshold => 0, report => 'short', seekfileerror => 'critical', logfileerror => 'critical', logfilemissing => 'unknown', protocolfileerror => 'ok', archivedirregexp => 0, capturegroups => 0, maxage => 0, }); $self->refresh_options($params->{options}); # # Dynamic logfile names may contain macros. # if (exists $self->{template} && exists $self->{dynamictag}) { $self->{macros}->{CL_TAG} = $self->{dynamictag}; $self->{macros}->{CL_tag} = lc $self->{dynamictag}; $self->{macros}->{CL_TEMPLATE} = $self->{template}; } else { $self->resolve_macros(\$self->{tag}); $self->{macros}->{CL_TAG} = $self->{tag}; # http://www.nagios-portal.org/wbb/index.php?page=Thread&threadID=18392 # this saves a lot of time when you are working with oracle alertlogs $self->{macros}->{CL_tag} = lc $self->{tag}; } $self->{logfile_before_resolving} = $self->{logfile}; $self->resolve_macros(\$self->{logfile}); $self->{macros}->{CL_LOGFILE} = $self->{logfile}; $self->{logbasename} = basename($self->{logfile}); $self->{archivedir} = exists $params->{archivedir} ? $params->{archivedir} : dirname($self->{logfile}); $self->resolve_macros(\$self->{archivedir}); # # Preliminary filter # if ($self->{prefilter}) { my $pattern = $self->{prefilter}; $self->resolve_macros_in_pattern(\$pattern); $pattern = '(?i)'.$pattern unless $self->{options}->{case}; $self->addfilter(1, $pattern); } if ($self->{options}->{syslogclient}) { my $pattern = $self->{options}->{syslogclient}; $self->resolve_macros_in_pattern(\$pattern); $pattern = '(?i)'.$pattern unless $self->{options}->{case}; $self->addfilter(1, $pattern); } if ($self->{options}->{syslogserver}) { my $pattern = '($CL_HOSTNAME$|localhost)'; $self->resolve_macros_in_pattern(\$pattern); $pattern = '(?i)'.$pattern unless $self->{options}->{case}; $self->addfilter(1, $pattern); } # # the guy who begged me for the encoding option never wrote me a mail again. # this means for me, encoding works perfect. if it does not work for you # then it's not my problem. # if ($self->{options}->{encoding}) { #require Encode qw(encode decode); require Encode; } # # Setup the structure describing what to search for. # foreach my $level (qw(OK CRITICAL WARNING UNKNOWN)) { # # if a single pattern was given as a scalar, force it into an array # and resolve macros. # if (exists $params->{(lc $level).'patterns'}) { if (ref($params->{(lc $level).'patterns'}) eq 'HASH') { map { my $value = $params->{(lc $level).'patterns'}->{$_}; $self->{patternkeys}->{$level}->{$value} = $_; } keys %{$params->{(lc $level).'patterns'}}; my $tmphash = $params->{(lc $level).'patterns'}; $params->{(lc $level).'patterns'} = []; @{$params->{(lc $level).'patterns'}} = values %{$tmphash}; } elsif (ref($params->{(lc $level).'patterns'}) eq 'ARRAY') { } else { $params->{(lc $level).'patterns'} = [$params->{(lc $level).'patterns'}]; } } if (exists $params->{(lc $level).'exceptions'}) { if (ref($params->{(lc $level).'exceptions'}) eq 'HASH') { $params->{(lc $level).'exceptions'} = values %{$params->{(lc $level).'exceptions'}}; my $tmphash = $params->{(lc $level).'exceptions'}; $params->{(lc $level).'exceptions'} = []; @{$params->{(lc $level).'exceptions'}} = values %{$tmphash}; } elsif (ref($params->{(lc $level).'exceptions'}) eq 'ARRAY') { } else { $params->{(lc $level).'exceptions'} = [$params->{(lc $level).'exceptions'}]; } } } if (exists $params->{patternfiles}) { if (ref($params->{patternfiles}) ne 'ARRAY') { $params->{patternfiles} = [$params->{patternfiles}]; } foreach my $patternfile (@{$params->{patternfiles}}) { our($criticalpatterns, $warningpatterns, $criticalexceptions, $warningexceptions); ($criticalpatterns, $warningpatterns, $criticalexceptions, $warningexceptions) = (undef, undef, undef, undef); eval { my $abspatternfile = File::Spec->file_name_is_absolute($patternfile) ? $patternfile : File::Spec->rel2abs($patternfile); do $abspatternfile; }; if ($@) { printf STDERR "%s\n", $@; $self->addmatch(3, $@); } elsif ($!) { my $error = "cannot read $patternfile: $!"; printf STDERR "%s\n", $error; $self->addmatch(3, $error); } else { my $filepatterns = {}; $filepatterns->{criticalpatterns} = $criticalpatterns if $criticalpatterns; $filepatterns->{warningpatterns} = $warningpatterns if $warningpatterns; $filepatterns->{criticalexceptions} = $criticalexceptions if $criticalexceptions; $filepatterns->{warningexceptions} = $warningexceptions if $warningexceptions; foreach my $level (qw(ok warning critical unknown)) { # normalize if (exists $filepatterns->{$level.'patterns'}) { if (ref($filepatterns->{$level.'patterns'}) eq 'HASH') { map { my $value = $filepatterns->{$level.'patterns'}->{$_}; $self->{patternkeys}->{uc $level}->{$value} = $_; } keys %{$filepatterns->{$level.'patterns'}}; my $tmphash = $filepatterns->{$level.'patterns'}; $filepatterns->{$level.'patterns'} = []; @{$filepatterns->{$level.'patterns'}} = values %{$tmphash}; } elsif (ref($filepatterns->{$level.'patterns'}) eq 'ARRAY') { } else { $filepatterns->{$level.'patterns'} = [$filepatterns->{$level.'patterns'}]; } } if (exists $filepatterns->{$level.'exceptions'}) { if (ref($filepatterns->{$level.'exceptions'}) eq 'HASH') { map { my $value = $filepatterns->{$level.'exceptions'}->{$_}; $self->{patternkeys}->{uc $level}->{$value} = $_; } keys %{$filepatterns->{$level.'exceptions'}}; my $tmphash = $filepatterns->{$level.'exceptions'}; $filepatterns->{$level.'exceptions'} = []; @{$filepatterns->{$level.'exceptions'}} = values %{$tmphash}; } elsif (ref($filepatterns->{$level.'exceptions'}) eq 'ARRAY') { } else { $filepatterns->{$level.'exceptions'} = [$filepatterns->{$level.'exceptions'}]; } } if (exists $params->{$level.'patterns'}) { if (exists $filepatterns->{$level.'patterns'}) { unshift(@{$params->{$level.'patterns'}}, @{$filepatterns->{$level.'patterns'}}); } } else { if (exists $filepatterns->{$level.'patterns'}) { @{$params->{$level.'patterns'}} = @{$filepatterns->{$level.'patterns'}}; } } if (exists $params->{$level.'exceptions'}) { if (exists $filepatterns->{$level.'exceptions'}) { unshift(@{$params->{$level.'exceptions'}}, @{$filepatterns->{$level.'exceptions'}}); } } else { if (exists $filepatterns->{$level.'exceptions'}) { @{$params->{$level.'exceptions'}} = @{$filepatterns->{$level.'exceptions'}}; } } } } } } foreach my $level (qw(OK CRITICAL WARNING UNKNOWN)) { # # if a single pattern was given as a scalar, force it into an array # and resolve macros. # if (exists $params->{(lc $level).'patterns'}) { @{$self->{patterns}->{$level}} = @{$params->{(lc $level).'patterns'}}; foreach my $pattern (@{$self->{patterns}->{$level}}) { my $key = $self->{patternkeys}->{$level}->{$pattern}; $self->resolve_macros_in_pattern(\$pattern); $self->{patternkeys}->{$level}->{$pattern} = $key; } # # separate the pattern arrays. patterns beginning with a "!" will raise # an error if they cannot be found. # this type of pattern also needs a counter for the matches because after # scanning the logfiles we must also check for a "not-found" condition. # @{$self->{negpatterns}->{$level}} = map { if (substr($_, 0, 1) eq "!") { push(@{$self->{negpatterncnt}->{$level}}, 0); substr($_, 1) } else { () } } @{$self->{patterns}->{$level}}; if (scalar(@{$self->{negpatterns}->{$level}})) { $self->{hasinversepat} = 1; @{$self->{patterns}->{$level}} = map { if (substr($_, 0, 1) ne "!") { $_ } else { () } } @{$self->{patterns}->{$level}}; } # # prepend the patterns with (?i) if the case insensitivity option is set # if (! $self->{options}->{case}) { foreach my $pattern (@{$self->{patterns}->{$level}}) { $pattern = '(?i)'.$pattern; } foreach my $pattern (@{$self->{negpatterns}->{$level}}) { $pattern = '(?i)'.$pattern; } } # # ignore the match unless a minimum of threshold occurrances were found # if (! $self->{options}->{(lc $level).'threshold'} && $params->{(lc $level).'threshold'}) { $self->{options}->{(lc $level).'threshold'} = $params->{(lc $level).'threshold'}; } if ($self->{options}->{(lc $level).'threshold'}) { $self->{threshold}->{$level} = $self->{options}->{(lc $level).'threshold'} - 1; } else { $self->{threshold}->{$level} = 0; } foreach my $pattern (@{$self->{patterns}->{$level}}) { push(@{$self->{patternfuncs}->{$level}}, eval "sub { local \$_ = shift; return m/\$pattern/o; }"); } } if (exists $params->{(lc $level).'exceptions'}) { push(@{$self->{exceptions}->{$level}}, @{$params->{(lc $level).'exceptions'}}); foreach my $pattern (@{$self->{exceptions}->{$level}}) { $self->resolve_macros_in_pattern(\$pattern); } if (! $self->{options}->{case}) { foreach my $pattern (@{$self->{exceptions}->{$level}}) { $pattern = '(?i)'.$pattern; } } } } foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { foreach my $pattern (@{$self->{negpatterns}->{$level}}) { push(@{$self->{negpatterncnt}->{$level}}, 0); } } if (exists $self->{tivoli}->{object}) { $self->{patterns} = { OK => [], WARNING => [], CRITICAL => ['.*'], UNKNOWN => [] }; push(@{$self->{patternfuncs}->{OK}}, sub { return undef; }); push(@{$self->{patternfuncs}->{WARNING}}, sub { return undef; }); push(@{$self->{patternfuncs}->{UNKNOWN}}, sub { return undef; }); push(@{$self->{patternfuncs}->{CRITICAL}}, eval "sub { local \$_ = shift; return m/.*/o; }"); $self->{tivoli}->{object}->set_format_mappings( hostname => $self->{macros}->{CL_HOSTNAME}, fqhostname => $self->{macros}->{CL_FQDN}, origin => $self->{macros}->{CL_IPADDRESS}, FILENAME => (ref($self) eq 'Nagios::CheckLogfiles::Search::Eventlog') ? 'EventLog' : $self->{macros}->{CL_LOGFILE}, # oder SysLogD LABEL => $self->{macros}->{CL_HOSTNAME}, # NON-TME ); } # # expiry time of hits # if (! $self->{options}->{thresholdexpiry} && $params->{thresholdexpiry}) { $self->{options}->{thresholdexpiry} = $params->{thresholdexpiry}; } $self->construct_seekfile(); $self->{NH_detection} = ($^O =~ /MSWin/) ? 0 : 1; return $self; } sub construct_seekfile { my $self = shift; # since 2.0 the complete path to the logfile is mapped to the seekfilename if ($self->{logfile} ne $self->{logfile_before_resolving}) { $self->{seekfilebase} = $self->{logfile_before_resolving}; $self->resolve_macros(\$self->{seekfilebase}); $self->{seekfilebase} =~ s/\$/_/g; } else { $self->{seekfilebase} = $self->{logfile}; } $self->{seekfilebase} =~ s/\//_/g; $self->{seekfilebase} =~ s/\\/_/g; $self->{seekfilebase} =~ s/:/_/g; $self->{seekfilebase} =~ s/\s/_/g; $self->{seekfiletag} = $self->{tag}; $self->{seekfiletag} =~ s/\//_/g; $self->{seekfile} = sprintf "%s/%s.%s.%s", $self->{seekfilesdir}, $self->{cfgbase}, $self->{seekfilebase}, $self->{tag} eq "default" ? "seek" : $self->{seekfiletag}; $self->{seekfile} = $self->trim_seekfile($self->{seekfile}); $self->{pre3seekfile} = sprintf "/tmp/%s.%s.%s", $self->{cfgbase}, $self->{seekfilebase}, $self->{tag} eq "default" ? "seek" : $self->{seekfiletag}; $self->{pre2seekfile} = sprintf "%s/%s.%s.%s", $self->{seekfilesdir}, $self->{cfgbase}, $self->{logbasename}, $self->{tag} eq "default" ? "seek" : $self->{seekfiletag}; if ($self->{relocate_seekfilesdir}) { $self->{relocate_seekfile} = sprintf "%s/%s.%s.%s", $self->{relocate_seekfilesdir}, $self->{cfgbase}, $self->{seekfilebase}, $self->{tag} eq "default" ? "seek" : $self->{tag}; } } sub trim_seekfile { my ($self, $path) = @_; my $dir = dirname($path); my $file = basename($path); if (length($file) > 200) { # delete every 3rd letter require Digest::MD5; import Digest::MD5 'md5_hex'; my $hash = substr(md5_hex($file), 0, 4); $file =~ s/(([a-zA-Z0-9][a-zA-Z0-9])[a-zA-Z0-9])/$2/g; if (length($file) > 200) { # if it is still too long, cut off > 200 $file = substr($file, 0, 200); } $file .= "-".$hash; $path = $dir."/".$file; } return $path; } sub force_cfgbase { # this is for the -F option. after initialization the seek/protocolfiles # must be reset to cfgbase of the base configfile is used my $self = shift; $self->{cfgbase} = shift; $self->construct_seekfile(); } sub prepare { my $self = shift; return $self; } sub finish { my $self = shift; return $self; } sub rewind { my $self = shift; $self->prepare(); $self->loadstate(); $self->{laststate}->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->addmatch(0, "reset"); $self->{newstate}->{logoffset} = 0; $self->{newstate}->{logtime} = 0; $self->savestate(); return $self; } sub unstick { my $self = shift; $self->prepare(); $self->loadstate(); $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->addmatch(0, "unstick"); $self->trace("remove the sticky error with --unstick"); $self->savestate(); return $self; } sub run { my $self = shift; $self->trace(sprintf "==================== %s ==================", $self->{logfile}); $self->prepare(); $self->{ticktack} = time; $self->loadstate(); $self->analyze_situation(); if ($self->{logrotated} || $self->{logmodified} || $self->{hasinversepat}) { # be lazy and examine files only if necessary $self->collectfiles(); } if ($self->{hasinversepat} || scalar(@{$self->{relevantfiles}})) { $self->scan(); } else { # $state keeps the old values foreach (keys %{$self->{laststate}}) { $self->{newstate}->{$_} = $self->{laststate}->{$_}; } $self->trace("keeping %s", $self->{newstate}->{servicestateid}) if $self->{newstate}->{servicestateid}; # maybe this was the 1st time } $self->check_if_too_old(); $self->savestate(); $self->finish(); $self->formulate_perfdata(); } sub check_if_too_old { my $self = shift; return if ! $self->get_option("maxage"); my $maxage; if ($self->get_option("maxage") =~ /(\d+)s/) { $maxage = $1; } elsif ($self->get_option("maxage") =~ /(\d+)m/) { $maxage = $1 * 60; } elsif ($self->get_option("maxage") =~ /(\d+)h/) { $maxage = $1 * 60 * 60; } elsif ($self->get_option("maxage") =~ /(\d+)d/) { $maxage = $1 * 60 * 60 * 24; } my $max_time = time - $maxage; if ($self->{newstate}->{logtime} && $self->{newstate}->{logtime} <= $max_time) { $self->addmatch(CRITICAL, sprintf "logfile %s is too old (> %s)", $self->{logfile}, $self->get_option("maxage")); return 1; } return 0; } =item loadstate() Load the last session's state. The state is defined by - the position where the last search stopped - the time when the logfile was last touched then. - device and inode of the logfile (since version 1.4) If there is no state file, then this must be the first run of check_logfiles. In this case take the current file length as the stop position, so nothing will actually be done. =cut sub loadstate { my $self = shift; if (-f $self->{seekfile}) { $self->{likeavirgin} = 0; $self->trace(sprintf "found seekfile %s", $self->{seekfile}); our $state = {}; my $absseekfile = File::Spec->file_name_is_absolute($self->{seekfile}) ? $self->{seekfile} : File::Spec->rel2abs($self->{seekfile}); #eval { do $absseekfile; #}; if ($@) { # found a seekfile with the old syntax $self->trace(sprintf "seekfile has old format %s", $@); my $seekfh = new IO::File; $seekfh->open($self->{seekfile}, "r"); $self->{laststate} = { logoffset => $seekfh->getline() || 0, logtime => $seekfh->getline() || 0, devino => $seekfh->getline(), logfile => $self->{logfile}, }; chomp $self->{laststate}->{logoffset} if $self->{laststate}->{logoffset}; chomp $self->{laststate}->{logtime} if $self->{laststate}->{logtime}; chomp $self->{laststate}->{devino} if $self->{laststate}->{devino}; $seekfh->close(); } elsif ($!) { my $error = "cannot read $absseekfile: $!"; printf STDERR "%s\n", $error; $self->addmatch(3, $error) } else { # found a new format seekfile $self->{laststate} = $state; #printf STDERR "LOADED %s\n", Data::Dumper::Dumper($self->{laststate}->{matchlines}); } if (! $self->{laststate}->{logfile}) { $self->{laststate}->{logfile} = $self->{logfile}; } if (! $self->{laststate}->{logtime}) { $self->{laststate}->{logtime} = 0; } if (! $self->{laststate}->{logoffset}) { $self->{laststate}->{logoffset} = 0; } if (! $self->{laststate}->{devino}) { # upgrade vom < 1.4 on the fly $self->{laststate}->{devino} = $self->getfilefingerprint($self->{logfile}); } if (! $self->{laststate}->{servicestateid}) { $self->{laststate}->{servicestateid} = 0; } if (! $self->{laststate}->{serviceoutput}) { $self->{laststate}->{serviceoutput} = "OK"; } my $now = time; foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { if ($self->get_option('thresholdexpiry')) { if (exists $self->{laststate}->{thresholdcnt}->{$level}) { $self->{thresholdtimes}->{$level} = $self->{laststate}->{thresholdtimes}->{$level} || []; # expire $self->trace(sprintf "!!!!!!!!!!found %d counted %s hits", scalar(@{$self->{thresholdtimes}->{$level}}), $level); @{$self->{thresholdtimes}->{$level}} = grep { time - $_ <= $self->get_option('thresholdexpiry') } @{$self->{thresholdtimes}->{$level}}; $self->trace(sprintf "!!!!!!!!!!!!after expiring %d %s counts are left", scalar(@{$self->{thresholdtimes}->{$level}}), $level); $self->{thresholdcnt}->{$level} = scalar(@{$self->{thresholdtimes}->{$level}}); } else { $self->{thresholdcnt}->{$level} = 0; $self->{thresholdtimes}->{$level} = []; } } else { if (exists $self->{laststate}->{thresholdcnt}->{$level}) { $self->{thresholdcnt}->{$level} = $self->{laststate}->{thresholdcnt}->{$level}; } } if ($self->get_option('sticky')) { $self->{matchlines}->{$level} = []; if ($self->get_option("report") eq "short") { if (exists $self->{laststate}->{matchlines}->{$level."count"}) { my @seconds = keys %{$self->{laststate}->{matchlines}->{$level."count"}}; foreach my $second (@seconds) { if (($now - $second) <= $self->{maxstickytime}) { $self->{matchlines}->{$level."count"}->{$second} = $self->{laststate}->{matchlines}->{$level."count"}->{$second}; } else { $self->trace(sprintf "%d sticky %ss expired: [%s]", $self->{laststate}->{matchlines}->{$level."count"}->{$second}, $level, scalar localtime $second); } } } else { $self->{matchlines}->{$level."count"} = {}; } } if (exists $self->{laststate}->{matchlines} and exists $self->{laststate}->{matchlines}->{$level} and scalar($self->{laststate}->{matchlines}->{$level})) { # reusing the old matchlines is not enough, we must run addmatch # in order to create lastmatch etc. foreach my $event (@{$self->{laststate}->{matchlines}->{$level}}) { if (ref($event) ne "ARRAY") { # old format (< 3.2), when sticky events had no individual times $event = [$self->{laststate}->{laststicked}, $event]; } if (($now - $event->[0]) <= $self->{maxstickytime}) { $self->trace(sprintf "sticky match reused [%s] %s", scalar localtime $event->[0], $event->[1]); $self->addmatch($level, $event->[1], $event->[0]); if ($self->get_option("report") eq "short") { if (exists $self->{matchlines}->{$level."count"}->{$event->[0]}) { $self->{matchlines}->{$level."count"}->{$event->[0]} -= 1; } else { $self->{matchlines}->{$level."count"}->{$event->[0]} = 0; } } } else { $self->trace(sprintf "sticky match expired: [%s] %s", scalar localtime $event->[0], $event->[1]); } } } } } $self->trace("LS lastlogfile = %s", $self->{laststate}->{logfile}); $self->trace("LS lastoffset = %u / lasttime = %d (%s) / inode = %s", $self->{laststate}->{logoffset}, $self->{laststate}->{logtime}, scalar localtime($self->{laststate}->{logtime}), $self->{laststate}->{devino}); } else { $self->trace("try pre2seekfile %s instead", $self->{pre2seekfile}); if (-f $self->{pre2seekfile}) { $self->trace("pre-2.0 seekfile %s found. rename it to %s", $self->{pre2seekfile}, $self->{seekfile}); mkdir $self->{seekfilesdir} if ! -d $self->{seekfilesdir}; rename $self->{pre2seekfile}, $self->{seekfile}; $self->trace("and call load_state again"); $self->loadstate() if -f $self->{seekfile}; return $self; } $self->trace("try pre3seekfile %s instead", $self->{pre3seekfile}); if (-f $self->{pre3seekfile}) { $self->trace("pre-3.0 seekfile %s found. rename it to %s", $self->{pre3seekfile}, $self->{seekfile}); mkdir $self->{seekfilesdir} if ! -d $self->{seekfilesdir}; rename $self->{pre3seekfile}, $self->{seekfile}; $self->trace("and call load_state again"); $self->loadstate() if -f $self->{seekfile}; return $self; } if ($self->{relocate_seekfilesdir}) { $self->trace("relocatable seekfile %s found. move it to %s", $self->{relocate_seekfile}, $self->{seekfile}); move $self->{relocate_seekfile}, $self->{seekfile}; $self->trace("and call load_state again"); $self->loadstate() if -f $self->{seekfile}; return $self; } $self->{likeavirgin} = 1; $self->trace("no seekfile %s found", $self->{seekfile}); if (-e $self->{logfile}) { $self->trace(sprintf "but logfile %s found", $self->{logfile}); # Fake a "the logfile was not touched" situation. $self->trace('eat all you can') if $self->{options}->{allyoucaneat}; $self->{laststate} = { logoffset => ($self->{options}->{allyoucaneat} ? 0 : $self->getfilesize($self->{logfile})), #logtime => (stat $self->{logfile})[10] - ($self->{options}->{allyoucaneat} ? 1 : 0), # force a check #logtime => (stat $self->{logfile})[10], logtime => 0, devino => $self->getfilefingerprint($self->{logfile}), logfile => $self->{logfile}, servicestateid => 0, serviceoutput => "OK", }; } else { $self->trace("and no logfile found"); # This is true virginity $self->{laststate} = { logoffset => 0, logtime => 0, devino => "0:0", logfile => $self->{logfile}, servicestateid => 0, serviceoutput => "OK", }; } $self->trace("ILS lastlogfile = %s", $self->{laststate}->{logfile}); $self->trace("ILS lastoffset = %u / lasttime = %d (%s) / inode = %s", $self->{laststate}->{logoffset}, $self->{laststate}->{logtime}, scalar localtime($self->{laststate}->{logtime}), $self->{laststate}->{devino}); } if (exists $self->{laststate}->{privatestate}) { $self->{privatestate} = $self->{laststate}->{privatestate}; $self->trace("found private state %s", Data::Dumper::Dumper($self->{privatestate})); } if (! $self->{laststate}->{runcount}) { $self->{laststate}->{runcount} = 1; } else { $self->{laststate}->{runcount}++; } if (! $self->{laststate}->{runtime}) { $self->{laststate}->{runtime} = 0; } $self->{privatestate}->{lastruntime} = $self->{laststate}->{runtime}; $self->{privatestate}->{runcount} = $self->{laststate}->{runcount}; $self->{privatestate}->{logfile} = $self->{macros}->{CL_LOGFILE}; $self->{macros}->{CL_LAST_RUNTIME} = $self->{privatestate}->{lastruntime}; $self->{macros}->{CL_RUN_COUNT} = $self->{privatestate}->{runcount}; return $self; } =item savestate() Save a session's state. We need this for the next run of check_logfiles. Here we remember, how far we read the logfile, when it was last modified and what it's inode was. =cut sub savestate { my $self = shift; my $seekfh = new IO::File; my $now = time; $@ = undef; # reset this. when a pre-3.0 statefile was read, this is set $self->searchresult(); # calculate servicestateid and serviceoutput if ($self->{options}->{sticky}) { $self->{newstate}->{matchlines} = $self->{matchlines}; if ($self->{laststate}->{servicestateid}) { $self->trace("an error level of %s is sticking at me", $self->{laststate}->{servicestateid}); $self->trace("and now i have %s", $self->{newstate}->{servicestateid}); if ($self->{newstate}->{servicestateid}) { # started with sticky errors and ends with (maybe additional) errors if (($self->{newstate}->{servicestateid} == 1) && ($self->{laststate}->{servicestateid} == 2)) { # if this was a warning and we already have a sticky critical # save the critical as the sticky exitcode $self->{newstate}->{servicestateid} = $self->{laststate}->{servicestateid}; # and keep the critical message as output $self->{newstate}->{serviceoutput} = $self->{laststate}->{serviceoutput}; } if ($self->get_option("report") eq "short") { foreach my $level (qw(WARNING CRITICAL UNKNOWN)) { my @matches = $self->getmatches($level); foreach my $event (@matches) { if (exists $self->{newstate}->{matchlines}->{$level."count"}->{$event->[0]}) { $self->{newstate}->{matchlines}->{$level."count"}->{$event->[0]} += 1; } else { $self->{newstate}->{matchlines}->{$level."count"}->{$event->[0]} = 1; } } if (@matches) { $self->{newstate}->{matchlines}->{$level} = [ pop(@matches) ]; } } } } else { if ($self->{options}->{sticky} > 1) { # we had a stick error, then an ok pattern and no new error $self->trace("sticky error was resetted"); } else { # newstate is 0 because nothing happened in this scan # 0 also means that none of the sticky errors were effective # they probably were discarded as expired during loadstate $self->trace("maxstickytime %d expired", $self->{maxstickytime}); } $self->{newstate}->{servicestateid} = 0; $self->{newstate}->{serviceoutput} = ""; delete $self->{newstate}->{matchlines}; # delete $self->{matchlines}...count, which are used for the summary foreach my $level (qw(WARNING CRITICAL UNKNOWN)) { $self->{matchlines}->{$level."count"} = {} if exists $self->{matchlines}->{$level."count"}; } } } else { $self->trace("no sticky error from last run"); if ($self->get_option("report") eq "short") { foreach my $level (qw(WARNING CRITICAL UNKNOWN)) { my @matches = $self->getmatches($level); foreach my $event (@matches) { if (exists $self->{newstate}->{matchlines}->{$level."count"}->{$event->[0]}) { $self->{newstate}->{matchlines}->{$level."count"}->{$event->[0]} += 1; } else { $self->{newstate}->{matchlines}->{$level."count"}->{$event->[0]} = 1; } } if (@matches) { $self->{newstate}->{matchlines}->{$level} = [ pop(@matches) ]; } } } } } # save threshold counts if a threshold exists for a level if ($self->{options}->{savethresholdcount}) { foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { if ($self->{threshold}->{$level}) { $self->{newstate}->{thresholdcnt}->{$level} = $self->{thresholdcnt}->{$level}; $self->{newstate}->{thresholdtimes}->{$level} = $self->{thresholdtimes}->{$level}; } } } $self->{newstate}->{tag} = $self->{tag}; $self->{newstate}->{privatestate} = $self->{privatestate}; $self->{newstate}->{runcount} = $self->{laststate}->{runcount}; $self->{newstate}->{runtime} = $now; # check if the file can be written if (! -d $self->{seekfilesdir}) { eval { use File::Path; mkpath $self->{seekfilesdir}; }; } if ($@ || ! -w $self->{seekfilesdir}) { $self->addmatch($self->get_option('seekfileerror'), sprintf "cannot write status file %s! check your filesystem (permissions/usage/integrity) and disk devices", $self->{seekfile}); return $self; } if ($seekfh->open($self->{seekfile}, "w")) { my $dumpstate = Data::Dumper->new([$self->{newstate}], [qw(state)]); #printf("save %s\n", $dumpstate->Dump()); $dumpstate = Data::Dumper->new([$self->{newstate}], [qw(state)]); $seekfh->printf("%s\n", $dumpstate->Dump()); $seekfh->printf("\n1;\n"); $seekfh->close(); #printf STDERR "SAVED %s\n", Data::Dumper::Dumper($self->{newstate}->{matchlines}); $self->trace("keeping position %u and time %d (%s) for inode %s in mind", $self->{newstate}->{logoffset}, $self->{newstate}->{logtime}, scalar localtime($self->{newstate}->{logtime}), $self->{newstate}->{devino}); } else { $self->{options}->{count} = 1; $self->addmatch($self->get_option('seekfileerror'), sprintf "cannot write status file %s! check your filesystem (permissions/usage/integrity) and disk devices", $self->{seekfile}); } return $self; } sub formulate_perfdata { my $self = shift; if ($self->{options}->{perfdata}) { if (exists $self->{template} && $self->{dynamictag}) { $self->{perftag} = $self->{template}; } else { $self->{perftag} = $self->{tag}; } $self->{perfdata} = sprintf "'%s_lines'=%d '%s_warnings'=%d '%s_criticals'=%d '%s_unknowns'=%d", $self->{perftag}, $self->{linesread}, $self->{perftag}, scalar($self->getmatches("WARNING")), $self->{perftag}, scalar($self->getmatches("CRITICAL")), $self->{perftag}, scalar($self->getmatches("UNKNOWN")); } } sub addmatch { my $self = shift; my $level = shift; my $errormessage = shift; my $when = shift; $when = (defined $when) ? $when : time; if (! defined $errormessage || $errormessage eq '') { $errormessage = '_(null)_'; } if ($self->{options}->{maxlength}) { $errormessage = substr $errormessage, 0, $self->{options}->{maxlength}; } if ($level =~ /^\d/) { $level = (qw(OK WARNING CRITICAL UNKNOWN))[$level]; } else { $level = uc $level; } push(@{$self->{matchlines}->{$level}}, [$when, $errormessage]); $self->{lastmsg}->{$level} = $errormessage; } sub update_context { my $self = shift; my $follow = shift; my $line = shift; } # # Read through all files found during analyze_situation and compare # the contents with patterns declared critical or warning or.... # sub scan { my $self = shift; my $actionfailed = 0; my $resetted = 0; $self->{timedout} = 0; my $charsize = 1; # 1 byte, e.g. ascii if ($self->{timeout} != 360000) { # 360000 is the default, meaning there was no --timeout use POSIX ':signal_h'; if ($^O =~ /MSWin/) { local $SIG{'ALRM'} = sub { $self->trace(sprintf "timeout after %d seconds in search %s", $self->{timeout} - 1, $self->{tag}); $self->{timedout} = 1; die "alarm\n"; }; } else { my $mask = POSIX::SigSet->new( SIGALRM ); my $action = POSIX::SigAction->new(sub { $self->trace(sprintf "timeout after %d seconds in search %s", $self->{timeout} - 1, $self->{tag}); $self->{timedout} = 1; die "alarm\n" ; }, $mask); my $oldaction = POSIX::SigAction->new(); sigaction(SIGALRM ,$action ,$oldaction ); } alarm($self->{timeout} - 1); # 1 second before the global unknown timeout } my $needfilter = scalar(@{$self->{preliminaryfilter}->{NEED}}); my $skipfilter = scalar(@{$self->{preliminaryfilter}->{SKIP}}); my $knowsexceptions = scalar(@{$self->{exceptions}->{WARNING}}) + scalar(@{$self->{exceptions}->{CRITICAL}}) + scalar(@{$self->{exceptions}->{UNKNOWN}}); if ($self->{options}->{encoding}) { $charsize = length(Encode::encode($self->{options}->{encoding}, Encode::decode("ascii", "a"))); if ($charsize == 2) { # seek stopped pointing at the second byte of a character, so # if we start reading there we will not read the correct # 2-byte-sequences. Instead of a1a2, b1b2, c1c2, .... # we will get a2b1, b2c1, c2d1 with a, b, c being utf-characters $self->{laststate}->{logoffset} = $self->{laststate}->{logoffset} ? $self->{laststate}->{logoffset} - 1 : 0; } } foreach my $logfile (@{$self->{relevantfiles}}) { $self->trace("moving to position %u in %s", $self->{laststate}->{logoffset}, $logfile->{filename}); if ($logfile->{seekable}) { $logfile->{fh}->seek($self->{laststate}->{logoffset}, 0); } else { my $buf; my $needtoread; $logfile->{offset} = 0; if ($self->{laststate}->{logoffset} > $self->{max_readsize}) { $needtoread = $self->{max_readsize}; $self->trace("i cannot sysread %u bytes. begin with %u bytes", $self->{laststate}->{logoffset}, $needtoread); } else { $needtoread = $self->{laststate}->{logoffset}; } while ($logfile->{offset} < $self->{laststate}->{logoffset}) { $self->trace("i start at offset %u", $logfile->{offset}); my $bytes = $logfile->{fh}->sysread($buf, $needtoread); if (! defined $bytes) { $self->trace("read error at position %u", $logfile->{offset}); last; } elsif ($bytes == 0) { # this should not happen, but at least it is an exit # from an endless loop. $self->trace("i read %d bytes. looks like EOF at position %u", $bytes, $logfile->{offset}); last; } else { $self->trace("i read %d bytes", $bytes); $logfile->{offset} += $bytes; if (($self->{laststate}->{logoffset} - $logfile->{offset}) > $self->{max_readsize}) { $needtoread = $self->{max_readsize}; $self->trace("i cannot sysread %u bytes. continue with %u bytes", $self->{laststate}->{logoffset} - $logfile->{offset}, $needtoread); } else { $needtoread = $self->{laststate}->{logoffset} - $logfile->{offset}; $self->trace("i will sysread %u bytes.", $needtoread); } } } $self->trace("fake seek positioned at offset %u", $logfile->{offset}); } while (my $line = $logfile->{fh}->getline()) { if ($self->{timedout}) { $self->trace(sprintf "leaving the scan loop after %d lines", $self->{linesread}); last; } my $filteredout = 0; $self->{linesread}++; if (! $logfile->{seekable}) { $logfile->{offset} += length($line) } if ($self->{options}->{encoding}) { # i am sure this is completely unreliable $line = Encode::encode("ascii", Encode::decode($self->{options}->{encoding}, $line)); # the input stream is somewhat binary, so chomp doesn't know # it neads to remove \r\n on windows. $line =~ s/$1/\n/g if $line =~ /(\r\n?|\n\r?)/; } chomp($line); # # If for example the prefilter option was set, check if the line # needs to be further examined. Only lines which match the needed filter # can pass. # if ($needfilter) { foreach my $filter (@{$self->{preliminaryfilter}->{NEED}}) { if ($line !~ /$filter/) { $self->trace(sprintf "no need for %s", $line); $filteredout = 1; last; } } } # # Skip lines with blacklist patterns # if ($skipfilter) { foreach my $filter (@{$self->{preliminaryfilter}->{SKIP}}) { if ($line =~ /$filter/) { $self->trace(sprintf "skip unwanted %s", $line); $self->trace(sprintf "because matching %s", $filter); $filteredout = 1; last; } } } next if $filteredout; $self->{linenumber}++; $self->update_context(0, $line); # store this line as before my $matches = {}; foreach my $nagioslevel (qw(CRITICAL WARNING UNKNOWN)) { my $level = $nagioslevel; # because it needs to be modified my $outplayed = 0; $matches->{$level} = []; if ($knowsexceptions) { foreach my $exception (@{$self->{exceptions}->{$level}}) { if ($line =~ /$exception/) { $self->trace("exception %s found. aborting.", $exception); $outplayed = 1; last; } } } next if $outplayed; my $patcnt = -1; foreach my $patternfunc (@{$self->{patternfuncs}->{$level}}) { $patcnt++; if (&${patternfunc}($line)) { push(@{$matches->{$level}}, $patcnt); } } } # now we have a structure with all the matches for this line # new option preferredlevel=critical if ($self->{options}->{preferredlevel}) { my $preferredlevel = uc $self->{options}->{preferredlevel}; if (scalar(@{$matches->{$preferredlevel}}) > 0) { # es gibt z.b. einen criticaltreffer und critical ist preferred # d.h. alle anderen level fliegen raus foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { $matches->{$level} = [] unless $level eq $preferredlevel; } } } foreach my $nagioslevel (qw(CRITICAL WARNING UNKNOWN)) { my $level = $nagioslevel; # because it needs to be modified foreach my $patcnt (@{$matches->{$level}}) { my $pattern = @{$self->{patterns}->{$level}}[$patcnt]; $self->trace("MATCH %s %s with %s", $level, $pattern, $line); if ($self->{threshold}->{$level}) { if ($self->{thresholdcnt}->{$level} < $self->{threshold}->{$level}) { $self->trace("skip match and the next %d", $self->{threshold}->{$level} - $self->{thresholdcnt}->{$level}); $self->{thresholdcnt}->{$level}++; if ($self->get_option('thresholdexpiry')) { push(@{$self->{thresholdtimes}->{$level}}, time); } next; } else { $self->{thresholdcnt}->{$level} = 0; $self->trace("count this match"); if ($self->get_option('thresholdexpiry')) { $self->{thresholdtimes}->{$level} = []; } } } if ($self->{tivoli}->{object}) { $self->{tivoli}->{match} = $self->{tivoli}->{object}->match($line); $self->{privatestate}->{tivolimatch} = $self->{tivoli}->{match}; $level = (qw(OK WARNING CRITICAL UNKNOWN))[$self->{tivoli}->{match}->{exit_code}]; next if $self->{tivoli}->{match}->{format_name} eq 'NO MATCHING RULE'; $line = $self->{tivoli}->{match}->{subject}; } else { $self->{privatestate}->{matchingpattern} = $pattern; } if ($self->{options}->{script}) { $self->{macros}->{CL_SERVICESTATE} = $level; $self->{macros}->{CL_SERVICESTATEID} = $ERRORS{$level}; $self->{macros}->{CL_SERVICEOUTPUT} = $line; $self->{macros}->{CL_PATTERN_PATTERN} = $pattern; $self->{macros}->{CL_PATTERN_NUMBER} = $patcnt; if (exists $self->{patternkeys}->{$level}->{$pattern} && defined $self->{patternkeys}->{$level}->{$pattern}) { $self->{macros}->{CL_PATTERN_KEY} = $self->{patternkeys}->{$level}->{$pattern} } else { $self->{macros}->{CL_PATTERN_KEY} = "unknown_pattern"; } if ($self->{options}->{capturegroups}) { $line =~ /$pattern/; no strict 'refs'; foreach (1..20) { $self->{macros}->{CL_CAPTURE_GROUPS} = $_ if (defined ${$_}); $self->{macros}->{'CL_CAPTURE_GROUP'.$_} = ${$_} if (defined ${$_}); } } my ($actionsuccess, $actionrc, $actionoutput) = $self->action($self->{script}, $self->{scriptparams}, $self->{scriptstdin}, $self->{scriptdelay}, $self->{options}->{smartscript}, $self->{privatestate}); if (! $actionsuccess) { # note the script failure. multiple failures will generate # one single event in the end. $actionfailed = 1; $self->addmatch($level, $line); } elsif ($self->{options}->{supersmartscript}) { # completely replace the matched line with the script output $self->addmatch($actionrc, $actionoutput); } elsif ($self->{options}->{smartscript}) { # both matched line and script output are events $self->addmatch($level, $line); $self->addmatch($actionrc, $actionoutput); } else { # dumb scripts generate no events. only the matched line. $self->addmatch($level, $line); } } else { $self->addmatch($level, $line); } if ($self->{tivoli}->{object}) { delete $self->{privatestate}->{tivolimatch}; } } # count patterns which raise an alert only if they were not found. my $patcnt = -1; foreach my $pattern (@{$self->{negpatterns}->{$level}}) { $patcnt++; if ($line =~ /$pattern/) { $self->{negpatterncnt}->{$level}->[$patcnt]++; $self->trace("negative pattern %s found.", $pattern); } } } # maybe a okpattern wipes out the history foreach my $pattern (@{$self->{patterns}->{OK}}) { if ($line =~ /$pattern/) { $self->trace("remedy pattern %s wipes out previous errors", $pattern); $self->trace("remedy pattern %s in line %s", $pattern,$line); $self->{options}->{sticky}++ if $self->{options}->{sticky}; # such a remedypattern neutralizes previous error $self->{matchlines}->{WARNING} = []; $self->{matchlines}->{CRITICAL} = []; $self->{matchlines}->{UNKNOWN} = []; # and also intermediate results which did not hit a threshold so far $self->{thresholdcnt}->{WARNING} = 0; $self->{thresholdcnt}->{CRITICAL} = 0; $self->{thresholdcnt}->{UNKNOWN} = 0; last; } } } # # if there are more files to come, start searching at the beginning # of each file. # only the first (oldest) file will be positioned at an offset. # $self->{laststate}->{logoffset} = 0; $self->{newstate}->{logoffset} = $logfile->{seekable} ? $logfile->{fh}->tell() : $logfile->{offset}; $self->{newstate}->{logtime} = (stat $logfile->{fh})[9] if $logfile->{statable}; #$self->{newstate}->{devino} = $self->getfilefingerprint($logfile->{fh}); $self->{newstate}->{devino} = $self->getfilefingerprint($logfile->{filename}); $self->trace("stopped reading at position %u", $self->{newstate}->{logoffset}); } # # if patterns beginning with ! were not found, treat this as an alert. # if ($self->{hasinversepat}) { foreach my $level (qw(CRITICAL WARNING)) { my $patcnt = -1; foreach my $pattern (@{$self->{negpatterns}->{$level}}) { $patcnt++; # 0 matches means alert. but not when this was an initial run if ($self->{negpatterncnt}->{$level}->[$patcnt] == 0 && ! ($self->{likeavirgin} && $self->{options}->{allyoucaneat})) { if ($self->{options}->{script}) { $self->{macros}->{CL_SERVICESTATEID} = $ERRORS{$level}; $self->{macros}->{CL_SERVICEOUTPUT} = sprintf("MISSING: %s", $pattern); $self->{macros}->{CL_PATTERN_NUMBER} = $patcnt; my ($actionsuccess, $actionrc, $actionoutput) = $self->action($self->{script}, $self->{scriptparams}, $self->{scriptstdin}, $self->{scriptdelay}, $self->{options}->{smartscript}, $self->{privatestate}); if (! $actionsuccess) { $actionfailed = 1; $self->addmatch($level, sprintf("MISSING: %s", $pattern)); } elsif ($self->{options}->{supersmartscript}) { $self->addmatch($actionrc, $actionoutput); } elsif ($self->{options}->{smartscript}) { $self->addmatch($level, sprintf("MISSING: %s", $pattern)); $self->addmatch($actionrc, $actionoutput); } else { $self->addmatch($level, sprintf("MISSING: %s", $pattern)); } } else { $self->addmatch($level, sprintf("MISSING: %s", $pattern)); } } } } # # no files were examined, so no positioning took place. # keep the old status. # if (scalar @{$self->{relevantfiles}} == 0) { $self->{newstate}->{logoffset} = $self->{laststate}->{logoffset}; $self->{newstate}->{logtime} = $self->{laststate}->{logtime}; $self->{newstate}->{devino} = $self->{laststate}->{devino}; } } # # now the heavy work is done. logfiles were searched and matching lines # were found and noted. # close the open file handles and store the current position in a seekfile. # foreach my $logfile (@{$self->{relevantfiles}}) { $logfile->{fh}->close(); } if ((scalar @{$self->{relevantfiles}} > 0) && ($self->{logfile} ne @{$self->{relevantfiles}}[$#{$self->{relevantfiles}}]->{filename})) { # # only rotated files were examined and a new logfile was not created yet. # next time we hopefully will have a new logfile, so start at position 0. # set the lastlogtime to now, and don't care no longer for the past. # $self->trace("rotated logfiles examined but no current logfile found"); $self->{newstate}->{logoffset} = 0; $self->{newstate}->{logtime} = time; } if ($actionfailed) { $self->{options}->{count} = 1; $self->addmatch(WARNING, sprintf "could not execute %s", $self->{script}); #push(@{$self->{matchlines}->{WARNING}}, # sprintf "could not execute %s", $self->{script}); } } sub addfilter { my $self = shift; my $need = shift; my $pattern = shift; if ($need) { push(@{$self->{preliminaryfilter}->{NEED}}, $pattern); } else { push(@{$self->{preliminaryfilter}->{SKIP}}, $pattern); } } sub searchresult { my $self = shift; my @criticals = $self->getmatches("CRITICAL"); my @warnings = $self->getmatches("WARNING"); my @unknowns = $self->getmatches("UNKNOWN"); if (scalar(@criticals)) { $self->{newstate}->{servicestateid} = 2; $self->{newstate}->{serviceoutput} = $self->getlastmatchmessage("CRITICAL"); } elsif (scalar(@warnings)) { $self->{newstate}->{servicestateid} = 1; $self->{newstate}->{serviceoutput} = $self->getlastmatchmessage("WARNING"); } elsif (scalar(@unknowns)) { $self->{newstate}->{servicestateid} = 3; $self->{newstate}->{serviceoutput} = $self->getlastmatchmessage("UNKNOWN"); } else { $self->{newstate}->{servicestateid} = 0; $self->{newstate}->{serviceoutput} = ""; } } sub reset { my $self = shift; $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{lastmsg} = { OK => "", WARNING => "", CRITICAL => "", UNKNOWN => "" }; $self->{negpatterncnt} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{thresholdcnt} = { OK => 0, WARNING => 0, CRITICAL => 0, UNKNOWN => 0 }; $self->{thresholdtimes} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; #$self->{preliminaryfilter} = { SKIP => [], NEED => [] }; $self->{perfdata} = ""; foreach my $level (qw(CRITICAL WARNING UNKNOWN)) { foreach my $pat (@{$self->{negpatterns}->{$level}}) { push(@{$self->{negpatterncnt}->{$level}}, 0); } } if (exists $self->{template} && exists $self->{dynamictag}) { $self->{macros}->{CL_TAG} = $self->{dynamictag}; $self->{macros}->{CL_TEMPLATE} = $self->{template}; } else { #$self->resolve_macros(\$self->{tag}); $self->{macros}->{CL_TAG} = $self->{tag}; } delete $self->{lastlogoffset}; delete $self->{lastlogtime}; delete $self->{lastlogoffset}; delete $self->{lastlogfile}; delete $self->{newlogoffset}; delete $self->{newlogtime}; delete $self->{newdevino}; delete $self->{newlogfile}; $self->{relevantfiles} = []; $self->{logrotated} = 0; $self->{logmodified} = 0; $self->{linesread} = 0; $self->{relevantfiles} = []; if (exists $self->{options}->{sticky}) { $self->{options}->{sticky} = 1 if ($self->{options}->{sticky} > 1); } return $self; } package Nagios::CheckLogfiles::Search::Simple; use strict; use Exporter; use File::Basename; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub analyze_situation { my $self = shift; $self->{logrotated} = 0; $self->{logmodified} = 0; if (! -e $self->{logfile}) { # # the logfile was deleted and no new events occurred since. # todo: no collection, but reset counters, incl. timestamp # with the modified flag we force a call to collectfiles where # [no]logfilenocry will be considered. $self->{logmodified} = 1; $self->trace(sprintf "there is no logfile %s at this moment", $self->{logfile}); $self->{laststate}->{logoffset} = 0; } elsif (! $self->getfileisreadable($self->{logfile})) { $self->{logmodified} = 1; $self->trace(sprintf "first noticed that logfile %s is unreadable", $self->{logfile}); } elsif ($self->{laststate}->{devino} ne $self->getfilefingerprint($self->{logfile})) { # the inode changed (! the old inode could have been reused) # or maybe this is the first time this logfile was seen $self->trace(sprintf "this is not the same logfile %s %s != %s", $self->{logfile}, $self->{laststate}->{devino}, $self->getfilefingerprint($self->{logfile})); $self->{logmodified} = 1; $self->{laststate}->{logoffset} = 0; $self->trace(sprintf "reset to offset 0"); } elsif ($self->getfilesize($self->{logfile}) > $self->{laststate}->{logoffset}) { # # the logfile grew. # this is the normal behaviour. in rare cases the logfile could have been # rotated/recreated and grown very fast. $self->trace(sprintf "the logfile grew to %d", $self->getfilesize($self->{logfile})); $self->{logmodified} = 1; } elsif ($self->getfilesize($self->{logfile}) == 0) { # # the logfile was either truncated or deleted and touched. # nothing to do except reset the position $self->{logmodified} = 0; $self->{laststate}->{logoffset} = 0; $self->{laststate}->{logtime} = (stat $self->{logfile})[9]; $self->trace("logfile has been truncated"); } elsif ($self->getfilesize($self->{logfile}) < $self->{laststate}->{logoffset}) { # # logfile shrunk. either it was truncated or it was # rotated and a new logfile was created. $self->trace(sprintf "the logfile shrunk from %d to %d", $self->{laststate}->{logoffset}, $self->getfilesize($self->{logfile})); $self->{logmodified} = 1; $self->{laststate}->{logoffset} = 0; $self->trace(sprintf "reset to offset 0"); } elsif ($self->getfilesize($self->{logfile}) == $self->{laststate}->{logoffset}) { $self->trace(sprintf "the logfile did not change"); } else { $self->trace("I HAVE NO IDEA WHAT HAPPENED"); } return $self; } sub collectfiles { my $self = shift; my @rotatedfiles = (); if ($self->{logmodified}) { my $fh = new IO::File; # cygwin lets you open files even after chmodding them to 0000, so double check with -r if ($self->getfileisreadable($self->{logfile})) { $fh->open($self->{logfile}, "r"); $self->trace("opened logfile %s", $self->{logfile}); push(@rotatedfiles, { filename => $self->{logfile}, fh => $fh, seekable => 1, statable => 1 }); $self->trace("logfile %s (modified %s / accessed %s / inode %d / inode changed %s)", $self->{logfile}, scalar localtime((stat $self->{logfile})[9]), scalar localtime((stat $self->{logfile})[8]), (stat $self->{logfile})[1], scalar localtime((stat $self->{logfile})[10])); } else { if (-e $self->{logfile}) { # permission problem $self->trace("insufficient permissions to open logfile %s", $self->{logfile}); $self->addmatch($self->get_option('logfileerror'), sprintf "insufficient permissions to open logfile %s", $self->{logfile}); } else { if ($self->get_option('logfilenocry')) { # logfiles which are not rotated but deleted and re-created may be missing # maybe a rotation situation, a typo in the configfile,... $self->trace("could not find logfile %s", $self->{logfile}); $self->addmatch($self->get_option('logfilemissing'), sprintf "could not find logfile %s", $self->{logfile}); } else { # dont care. $self->trace("could not find logfile %s, but that's ok", $self->{logfile}); } } } } $self->trace(sprintf "relevant files: %s", join(", ", map { basename $_->{filename} } @rotatedfiles)); $self->{relevantfiles} = \@rotatedfiles; } package Nagios::CheckLogfiles::Search::Rotating; use strict; use Exporter; use File::Basename; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; # sollte mal raus, da gibts kein sub dazu. # hier kommt eh keiner her, weil eins hoeher geblesst wird # $self->rotationpattern(); return $self->init(shift); } sub analyze_situation { my $self = shift; $self->{logrotated} = 0; $self->{logmodified} = 0; if (! $self->{NH_detection}) { if (! -e $self->{logfile}) { # # if no logfile exists, then probably it was rotated and no new logs # were written since. # find files which were modified after $lasttime. the most recent one # is probably the former logfile. position at $lastoffset. # if this configurations does not care for rotations, there is nothing # we can do here. # $self->{logrotated} = 1; $self->{logmodified} = 1; $self->trace(sprintf "there is no logfile %s at this moment", $self->{logfile}); } elsif ($self->{laststate}->{devino} ne $self->getfilefingerprint($self->{logfile})) { # the inode changed (! the old inode could be reused) $self->trace(sprintf "this is not the same logfile %s != %s", $self->{laststate}->{devino}, $self->getfilefingerprint($self->{logfile})); $self->{logrotated} = 1; $self->{logmodified} = 1; } elsif ($self->getfilesize($self->{logfile}) > $self->{laststate}->{logoffset}) { # # the logfile grew. # this is the normal behaviour. in rare cases the logfile could have been # rotated/recreated and grown very fast. $self->trace(sprintf "the logfile grew to %d", $self->getfilesize($self->{logfile})); if ($self->{likeavirgin}) { # if the logfile grew because we initialized the plugin with an offset of 0, position # at the end of the file and skip this search. otherwise lots of outdated messages could # match and raise alerts. $self->{laststate}->{logoffset} = $self->getfilesize($self->{logfile}); } else { $self->{logmodified} = 1; } } elsif ($self->getfilesize($self->{logfile}) == 0) { # # the logfile was either truncated or deleted and touched. # nothing to do except reset the position $self->{logrotated} = 1; $self->{laststate}->{logtime} = (stat $self->{logfile})[9]; } elsif ($self->getfilesize($self->{logfile}) < $self->{laststate}->{logoffset}) { # # logfile shrunk. either it was truncated or it was # rotated and a new logfile was created. $self->trace(sprintf "the logfile shrunk from %d to %d", $self->{laststate}->{logoffset}, $self->getfilesize($self->{logfile})); $self->{logmodified} = 1; $self->{logrotated} = 1; } elsif ($self->getfilesize($self->{logfile}) == $self->{laststate}->{logoffset}) { $self->trace(sprintf "the logfile did not change"); } else { $self->trace("I HAVE NO IDEA WHAT HAPPENED"); } return $self; } else { # Nigel Harnimans mtime-based algorithm my $filetime = (stat $self->{logfile})[9]; my $lastfiletime = $self->{laststate}->{logtime}; if (! -e $self->{logfile}) { # # if no logfile exists, then probably it was rotated and no new logs # were written since. # find files which were modified after $lasttime. the most recent one # is probably the former logfile. position at $lastoffset. # if this configurations does not care for rotations, there is nothing # we can do here. # $self->{logrotated} = 1; $self->{logmodified} = 1; $self->trace(sprintf "there is no logfile %s at this moment", $self->{logfile}); } elsif ($self->{laststate}->{devino} ne $self->getfilefingerprint($self->{logfile})) { # the inode changed (! the old inode could be reused) $self->trace(sprintf "this is not the same logfile %s != %s", $self->{laststate}->{devino}, $self->getfilefingerprint($self->{logfile})); $self->{logrotated} = 1; $self->{logmodified} = 1; # Ok, we need to make some changes here to handle a situation where the # inode is not changed on file rotation (since the writing app need # continuity) # 1) The last modified time is the same as that of the previously scanned # log file. Therefore it is the same file. No rotation or modification # 2) The last modified time is different, and the file is zero bytes: # - Modified = false # - Rotated = true # 3) The last modified time is different, and the file is not zero bytes # and is less than previous: # - Modified = true # - Rotated = true # 4) The last modified time is different, and the file is not zero bytes # and is more than previous: # - Modified = true # - Rotated = true (we can't actually tell, so need to play safe) } elsif ($self->{likeavirgin}) { $self->trace(sprintf "likevirgin, either eat it all or position at the end"); $self->{logmodified} = 1; } elsif ($filetime == $lastfiletime) { $self->trace(sprintf "Log file has the same modified time: %s ", scalar localtime($filetime)); $self->{laststate}->{logtime} = $filetime; } elsif ($filetime != $lastfiletime) { $self->trace(sprintf "Log file modified time: %s, last modified time: %s", scalar localtime($filetime), scalar localtime($lastfiletime)); if ($self->getfilesize($self->{logfile}) == 0) { $self->trace(sprintf "Log file is zero bytes"); $self->{logrotated} = 1; } else { $self->trace(sprintf "Log file is not zero bytes"); $self->{logrotated} = 1; $self->{logmodified} = 1; } } else { $self->trace("I HAVE NO IDEA WHAT HAPPENED"); } $self->trace(sprintf "Log offset: %i", $self->{laststate}->{logoffset}); return $self; } } sub collectfiles { my $self = shift; my @rotatedfiles = (); if ($self->{logrotated} && $self->{rotation}) { $self->trace("looking for rotated files in %s with pattern %s", $self->{archivedir}, $self->{filenamepattern}); if ($self->get_option('archivedirregexp')) { my $volume = undef; my @catdirs = (); my @dirs = split(/\//, $self->{archivedir}); foreach my $i (1..(scalar(@dirs) - $self->get_option('archivedirregexp'))) { push(@catdirs, shift @dirs); } my $searchdir = join('/', @catdirs); File::Find::find(sub { if (/^$self->{filenamepattern}/ && -f $_) { push(@rotatedfiles, $File::Find::name); } }, $searchdir); } else { opendir(DIR, $self->{archivedir}); @rotatedfiles = map { sprintf "%s/%s", $self->{archivedir}, $_; } grep /^$self->{filenamepattern}/, readdir(DIR); closedir(DIR); } #opendir(DIR, $self->{archivedir}); #@rotatedfiles = map { # sprintf "%s/%s", $self->{archivedir}, $_; #} grep /^$self->{filenamepattern}/, readdir(DIR); #closedir(DIR); # opendir(DIR, $self->{archivedir}); # read the filenames from DIR, match the filenamepattern, check the file age # open the file and return the handle # sort the handles by modification time #@rotatedfiles = sort { (stat $a->{fh})[9] <=> (stat $b->{fh})[9] } map { @rotatedfiles = sort { $a->{modtime} <=> $b->{modtime} } map { #if (/^$self->{filenamepattern}/) { #my $archive = sprintf "%s/%s", $self->{archivedir}, $_; my $archive = $_; $self->trace("archive %s matches (modified %s / accessed %s / inode %d / inode changed %s)", $archive, scalar localtime((stat $archive)[9]), scalar localtime((stat $archive)[8]), (stat $archive)[1], scalar localtime((stat $archive)[10])); if ((stat $archive)[9] >= $self->{laststate}->{logtime}) { $self->trace("archive %s was modified after %s", $archive, scalar localtime($self->{laststate}->{logtime})); my $fh = new IO::File; if (/.*\.gz\s*$/) { $self->trace("uncompressing %s with gzip -dc < %s|", $archive, $archive); if ($fh->open('gzip -dc < '.$archive.'|')) { ({ filename => $archive, fh => $fh, seekable => 0, statable => 0, modtime => (stat $archive)[9], fingerprint => $self->getfilefingerprint($archive).':'.$self->getfilesize($archive) }); } else { $self->trace("archive %s cannot be opened with gzip", $archive); (); } } elsif (/.*\.bz2\s*$/) { $self->trace("uncompressing %s with bzip2 -d < %s|", $archive, $archive); if ($fh->open('bzip2 -d < '.$archive.'|')) { ({ filename => $archive, fh => $fh, seekable => 0, statable => 0, modtime => (stat $archive)[9], fingerprint => $self->getfilefingerprint($archive).':'.$self->getfilesize($archive) }); } else { $self->trace("archive %s cannot be opened with bzip2", $archive); (); } } else { if ($fh->open($archive, "r")) { ({ filename => $archive, fh => $fh, seekable => 1, statable => 1, size => $self->getfilesize($fh), modtime => (stat $archive)[9], fingerprint => $self->getfilefingerprint($archive).':'.$self->getfilesize($archive) }); } else { $self->trace("archive %s cannot be opened", $archive); (); } } } else { (); } #} else { # (); #} } @rotatedfiles; # } readdir(DIR); # closedir(DIR); if (scalar(@rotatedfiles) == 0) { # # although a logfile rotation was detected, no archived files were found. # start seeking at position 0. # if (! $self->{NH_detection}) { $self->{laststate}->{logoffset} = 0; } else { # NH Commented this out, as we may find no rotated files, # in which case we need to use the current file offset again } $self->trace("although a logfile rotation was detected, no archived files were found"); } } if ($self->{logmodified}) { my $fh = new IO::File; # cygwin lets you open files even after chmodding them to 0000, so double check with -r if ($self->getfileisreadable($self->{logfile})) { $fh->open($self->{logfile}, "r"); $self->trace("opened logfile %s", $self->{logfile}); push(@rotatedfiles, { filename => $self->{logfile}, fh => $fh, seekable => 1, statable => 1, size => $self->getfilesize($self->{logfile}), fingerprint => $self->getfilefingerprint($self->{logfile}).':'.$self->getfilesize($self->{logfile}) }); $self->trace("logfile %s (modified %s / accessed %s / inode %d / inode changed %s)", $self->{logfile}, scalar localtime((stat $self->{logfile})[9]), scalar localtime((stat $self->{logfile})[8]), (stat $self->{logfile})[1], scalar localtime((stat $self->{logfile})[10])); } else { if (-e $self->{logfile}) { # permission problem $self->trace("insufficient permissions to open logfile %s", $self->{logfile}); $self->addmatch($self->get_option('logfileerror'), sprintf "insufficient permissions to open logfile %s", $self->{logfile}); } else { if ($self->get_option('logfilenocry')) { # logfiles which are not rotated but deleted and re-created may be missing # maybe a rotation situation, a typo in the configfile,... $self->trace("could not find logfile %s", $self->{logfile}); $self->addmatch($self->get_option('logfilemissing'), sprintf "could not find logfile %s", $self->{logfile}); } else { # dont care. $self->trace("could not find logfile %s, but that's ok", $self->{logfile}); } } } } # now we have an array of structures each pointing to a file # which has been rotated since the last scan plus the current logfile. # the array members are sorted by modification time of the files. # now duplicate entries are removed. in one scenario the current logfile is # a symbolic link to a file which uses the same naming schema as the rotated # logfiles. $self->trace(sprintf "first relevant files: %s", join(", ", map { basename $_->{filename} } @rotatedfiles)); my %seen = (); @rotatedfiles = reverse map { $self->trace("%s has fingerprint %s", $_->{filename}, $_->{fingerprint}); # because of the windows dummy devino 0:0, we need to add the size if (exists $seen{$_->{fingerprint}}) { $self->trace("skipping %s (identical to %s)", $_->{filename}, $seen{$_->{fingerprint}}); (); } else { $seen{$_->{fingerprint}} = $_->{filename}; $_; } } reverse @rotatedfiles; # cleanup again. this is for rotating::uniform, where the current logfile is # analyzed twice. with a fast-growing logfile it may happen that we find # the current logfile with two different fingerprints (dev:inode:size) here %seen = (); @rotatedfiles = reverse map { if (exists $seen{$_->{filename}}) { $self->trace("skipping duplicate %s (was growing during analysis)", $_->{filename}); (); } else { $seen{$_->{filename}} = 1; $_; } } reverse @rotatedfiles; if (0 && (scalar(@rotatedfiles) == 1) && ($rotatedfiles[0]->{filename} eq $self->{logfile}) && ! $self->get_option('randominode')) { # somehow rotated (devino has changed) but there are no rotated files # maybe logfile was rotated=deleted and recreated # a very special case which i found when i wrote 087randominode.t $self->{laststate}->{logoffset} = 0; } elsif (@rotatedfiles && (exists $rotatedfiles[0]->{size}) && ($rotatedfiles[0]->{size} < $self->{laststate}->{logoffset})) { $self->trace(sprintf "file %s is too short (%d < %d). this should not happen. reset", $rotatedfiles[0]->{filename}, $rotatedfiles[0]->{size}, $self->{laststate}->{logoffset}); if ($self->{NH_detection}) { # NH In this case, we have replaced the files, so set to beginning $self->{laststate}->{logoffset} = 0; } else { $self->{laststate}->{logoffset} = $rotatedfiles[0]->{size}; } } $self->trace(sprintf "relevant files: %s", join(", ", map { basename $_->{filename} } @rotatedfiles)); $self->{relevantfiles} = \@rotatedfiles; } sub prepare { my $self = shift; if ("LOGLOGDATE8GZ" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf '^%s[\.\-]{0,1}[0-9]{8}\.gz$', $self->{logbasename}; } elsif ("LOGLOGDATE8BZ2" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf '^%s[\.\-]{0,1}[0-9]{8}\.bz2$', $self->{logbasename}; } elsif ("LOGLOG0LOG1GZ" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf '^%s\.((0)|([1-9]+\.gz))$', $self->{logbasename}; } elsif ("LOGLOG0GZLOG1GZ" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf '^%s\.((0)|([1-9]+[0-9]*))\.gz$', $self->{logbasename}; } elsif ("LOGLOG0BZ2LOG1BZ2" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf '^%s\.((0)|([1-9]+[0-9]*))\.bz2$', $self->{logbasename}; } elsif ("LOGLOG0LOG1" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf '^%s\.((0)|([1-9]+[0-9]*))$', $self->{logbasename}; } elsif ("SUSE" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf "%s.*[0-9]*.gz", $self->{logbasename}; } elsif ("DEBIAN" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf "%s.0|%s.*[0-9]*.gz", $self->{logbasename}, $self->{logbasename}; } elsif ("QMAIL" eq uc($self->{rotation})) { $self->{filenamepattern} = "\@.*"; } elsif ("LOGROTATE" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf "%s.*[0-9]*.gz", $self->{logbasename}; } elsif ("SOLARIS" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf "%s.*\\.[0-9]+", $self->{logbasename}; } elsif ("HPUX" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf "OLD%s", $self->{logbasename}; } elsif ("BMWHPUX" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf 'OLD%s|%s\\.[A-Z][0-9]+_[0-9]+\\.gz$', $self->{logbasename}, $self->{logbasename}; } elsif ("EHL" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf '^%s_%s\.\d\d\d\d_\d+_\d+_\d+_\d+_\d+$', $self->{macros}->{CL_HOSTNAME}, $self->{logbasename}; } elsif ("MOD_LOG_ROTATE" eq uc($self->{rotation})) { $self->{filenamepattern} = sprintf 'access\.log\.\d{10}'; bless $self, "Nagios::CheckLogfiles::Search::Rotating::Uniform"; $self->prepare(); } else { $self->{filenamepattern} = $self->{rotation}; $self->resolve_macros_in_pattern(\$self->{filenamepattern}); } return $self; } package Nagios::CheckLogfiles::Search::Rotating::Uniform; use strict; use Exporter; use File::Basename; use File::Find; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search::Rotating); sub new { my $self = bless {}, shift; return $self->init(shift); } sub prepare { my $self = shift; my $params = shift; my @matchingfiles = (); if (! $self->{filenamepattern}) { $self->{filenamepattern} = $self->{rotation}; $self->resolve_macros_in_pattern(\$self->{filenamepattern}); } # find newest rotatingpattern = logfile if ($self->get_option('archivedirregexp')) { my $volume = undef; my @catdirs = (); my @dirs = split(/\//, $self->{archivedir}); foreach my $i (1..(scalar(@dirs) - $self->get_option('archivedirregexp'))) { push(@catdirs, shift @dirs); } my $searchdir = join('/', @catdirs); File::Find::find(sub { if (/^$self->{filenamepattern}/ && -f $_) { push(@matchingfiles, $File::Find::name); } }, $searchdir); @matchingfiles = sort { $a->{modtime} <=> $b->{modtime} } map { my $archive = $_; ({ filename => $archive, modtime => (stat $archive)[9]}); } @matchingfiles; } else { opendir(DIR, $self->{archivedir}); @matchingfiles = sort { $a->{modtime} <=> $b->{modtime} } map { my $archive = $_; ({ filename => $archive, modtime => (stat $archive)[9]}); } map { sprintf "%s/%s", $self->{archivedir}, $_; } grep /^$self->{filenamepattern}/, readdir(DIR); closedir(DIR); } #opendir(DIR, $self->{archivedir}); #@matchingfiles = sort { $a->{modtime} <=> $b->{modtime} } map { # if (/^$self->{filenamepattern}/) { # my $archive = sprintf "%s/%s", $self->{archivedir}, $_; # ({ filename => $archive, modtime => (stat $archive)[9]}); # } else { # (); # } #} readdir(DIR); #closedir(DIR); if (@matchingfiles) { $self->{logfile} = $matchingfiles[-1]->{filename}; $self->{macros}->{CL_LOGFILE} = $self->{logfile}; $self->{privatestate}->{logfile} = $self->{logfile}; $self->trace("the newest uniform logfile i found is %s", $self->{logfile}); } else { $self->{logfile} = $self->{archivedir}.'/logfilenotfound'; $self->trace("i found no uniform logfiles in %s", $self->{archivedir}); } $self->construct_seekfile(); } sub construct_seekfile { my $self = shift; # modify seekfilename so it can be found even if the logfile has changed $self->{logbasename} = basename($self->{logfile}); if ($self->get_option('archivedirregexp')) { $self->{seekfilebase} = '/regexpuniformlogfile'; } else { $self->{seekfilebase} = dirname($self->{logfile}).'/uniformlogfile'; } $self->{seekfilebase} =~ s/\//_/g; $self->{seekfilebase} =~ s/\\/_/g; $self->{seekfilebase} =~ s/:/_/g; $self->{seekfilebase} =~ s/\s/_/g; $self->{seekfile} = sprintf "%s/%s.%s.%s", $self->{seekfilesdir}, $self->{cfgbase}, $self->{seekfilebase}, $self->{tag} eq "default" ? "seek" : $self->{tag}; $self->{seekfile} = $self->trim_seekfile($self->{seekfile}); $self->{pre3seekfile} = sprintf "/tmp/%s.%s.%s", $self->{cfgbase}, $self->{seekfilebase}, $self->{tag} eq "default" ? "seek" : $self->{tag}; $self->{pre2seekfile} = sprintf "%s/%s.%s.%s", $self->{seekfilesdir}, $self->{cfgbase}, $self->{logbasename}, $self->{tag} eq "default" ? "seek" : $self->{tag}; $self->trace("rewrote uniform seekfile to %s", $self->{seekfile}); return $self; } package Nagios::CheckLogfiles::Search::Virtual; use strict; use Exporter; use File::Basename; use vars qw(@ISA); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->default_options({ savestate => 0, }); $self->SUPER::init($params); } sub loadstate { my $self = shift; if ($self->get_option('savestate')) { $self->SUPER::loadstate(); } $self->{laststate}->{logoffset} = 0; } sub savestate { my $self = shift; if ($self->get_option('savestate')) { $self->SUPER::savestate(); } } sub analyze_situation { my $self = shift; $self->{logmodified} = 1; } sub collectfiles { my $self = shift; my @rotatedfiles = (); my $fh = new IO::File; if ($self->getfileisreadable($self->{logfile})) { $fh->open($self->{logfile}, "r"); $self->trace("opened logfile %s", $self->{logfile}); push(@rotatedfiles, { filename => $self->{logfile}, fh => $fh, seekable => 1, statable => 1 }); } else { if (-e $self->{logfile}) { # permission problem $self->trace("insufficient permissions to open logfile %s", $self->{logfile}); $self->addmatch($self->get_option('logfileerror'), sprintf "insufficient permissions to open logfile %s", $self->{logfile}); } else { if ($self->get_option('logfilenocry')) { $self->trace("could not find logfile %s", $self->{logfile}); $self->addmatch($self->get_option('logfilemissing'), sprintf "could not find logfile %s", $self->{logfile}); } else { # dont care. $self->trace("could not find logfile %s, but that's ok", $self->{logfile}); } } } $self->{relevantfiles} = \@rotatedfiles; } package Nagios::CheckLogfiles::Search::Prescript; use strict; use Exporter; use File::Basename; use vars qw(@ISA); @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{tag} = "prescript"; $self->{scriptpath} = $params->{scriptpath}; $self->{macros} = $params->{macros}; $self->{tracefile} = $params->{tracefile}; $self->{cfgbase} = $params->{cfgbase}; $self->{logbasename} = "prescript"; $self->{script} = $params->{script}; $self->{scriptparams} = $params->{scriptparams}; $self->{scriptstdin} = $params->{scriptstdin}; $self->{scriptdelay} = $params->{scriptdelay}; $self->default_options({ script => 0, protocol => 0, count => 1, smartscript => 0, supersmartscript => 0, report => 'short', seekfileerror => 'critical', protocolfileerror => 'ok', logfileerror => 'critical' }); $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{lastmsg} = { OK => "", WARNING => "", CRITICAL => "", UNKNOWN => "" }; $self->{trace} = -e $self->{tracefile} ? 1 : 0; $self->refresh_options($params->{options}); $self->{exitcode} = 0; $self->{macros}->{CL_LOGFILE} = $params->{cfgbase}; $self->{macros}->{CL_TAG} = $self->{tag}; $self->{macros}->{CL_SERVICESTATEID} = $ERRORS{OK}; $self->{macros}->{CL_SERVICEOUTPUT} = "OK - starting up"; $self->{macros}->{CL_PATTERN_NUMBER} = 0; return $self; } sub run { my $self = shift; $self->trace("call (%s) prescript %s", $self->{options}->{smartscript} ? "smart" : "dumb", $self->{script}); my ($actionsuccess, $actionrc, $actionoutput) = $self->action($self->{script}, $self->{scriptparams}, $self->{scriptstdin}, $self->{scriptdelay}, $self->{options}->{smartscript}, $self->{privatestate}); if (! $actionsuccess) { $self->{options}->{count} = 1; $self->{options}->{protocol} = 1; $self->addmatch('WARNING', sprintf "cannot execute %s", $self->{script}); } elsif ($self->{options}->{smartscript}) { if ($actionrc) { $actionoutput = "prescript" if ! $actionoutput; $self->addmatch($actionrc, $actionoutput); } } $self->{exitcode} = $actionrc; } package Nagios::CheckLogfiles::Search::Postscript; use strict; use Exporter; use File::Basename; use vars qw(@ISA); @ISA = qw(Nagios::CheckLogfiles::Search); sub new { my $self = bless {}, shift; return $self->init(shift); } sub init { my $self = shift; my $params = shift; $self->{tag} = "postscript"; $self->{scriptpath} = $params->{scriptpath}; $self->{macros} = $params->{macros}; $self->{tracefile} = $params->{tracefile}; $self->{cfgbase} = $params->{cfgbase}; $self->{logbasename} = "postscript"; $self->{script} = $params->{script}; $self->{scriptparams} = $params->{scriptparams}; $self->{scriptstdin} = $params->{scriptstdin}; $self->{scriptdelay} = $params->{scriptdelay}; $self->{privatestate} = $params->{privatestate}; $self->default_options({ script => 0, protocol => 0, count => 1, smartscript => 0, supersmartscript => 0, report => 'short', seekfileerror => 'critical', protocolfileerror => 'ok', logfileerror => 'critical', }); $self->{matchlines} = { OK => [], WARNING => [], CRITICAL => [], UNKNOWN => [] }; $self->{lastmsg} = { OK => "", WARNING => "", CRITICAL => "", UNKNOWN => "" }; $self->{trace} = -e $self->{tracefile} ? 1 : 0; $self->refresh_options($params->{options}); $self->{exitcode} = 0; $self->{macros}->{CL_LOGFILE} = $params->{cfgbase}; $self->{macros}->{CL_TAG} = $self->{tag}; $self->{macros}->{CL_SERVICESTATEID} = 0; # will be set in SUPER::run() $self->{macros}->{CL_SERVICEOUTPUT} = ""; # will be set in SUPER::run() $self->{macros}->{CL_PATTERN_NUMBER} = 0; return $self; } sub run { my $self = shift; $self->trace("call postscript %s", $self->{script}); my ($actionsuccess, $actionrc, $actionoutput) = $self->action($self->{script}, $self->{scriptparams}, $self->{scriptstdin}, $self->{scriptdelay}, $self->{options}->{smartscript}, $self->{privatestate}); if (! $actionsuccess) { $self->{options}->{count} = 1; $self->{options}->{protocol} = 1; $self->addmatch('WARNING', sprintf "cannot execute %s", $self->{script}); $actionrc = 2; } elsif ($self->{options}->{smartscript}) { if ($actionrc || $self->{options}->{supersmartscript}) { # strings containing 0 must be treated like a true value #$actionoutput = "postscript" if ! $actionoutput; $actionoutput = "postscript" unless $actionoutput || $actionoutput =~ /0[0\.]*/; $self->addmatch($actionrc, $actionoutput); } } $self->{exitcode} = $actionrc; } 1; check_logfiles-4.1.1/plugins-scripts/Makefile.in0000664000175000017500000003727414336703157016642 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = plugins-scripts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = subst CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libexecdir)" SCRIPTS = $(libexec_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/subst.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) VPATH = $(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = /bin/cat CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO = /bin/echo ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_OPTS = @INSTALL_OPTS@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PROTOCOLS_DIR = @PROTOCOLS_DIR@ RELEASE = @RELEASE@ SED = /bin/sed SEEKFILES_DIR = @SEEKFILES_DIR@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ TRUSTED_PATH = @TRUSTED_PATH@ VERSION = @VERSION@ WARRANTY = @WARRANTY@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_nagios_group = @with_nagios_group@ with_nagios_user = @with_nagios_user@ libexec_SCRIPTS = check_logfiles EXTRA_MODULES = \ Nagios/Tivoli/Config/Logfile.pm \ Nagios/CheckLogfiles.pm \ Nagios/CheckLogfiles/Search/Errpt.pm \ Nagios/CheckLogfiles/Search/Ipmitool.pm \ Nagios/CheckLogfiles/Search/Oraclealertlog.pm \ Nagios/CheckLogfiles/Search/Esxdiag.pm \ Nagios/CheckLogfiles/Search/Executable.pm \ Nagios/CheckLogfiles/Search/Dummy.pm \ Nagios/CheckLogfiles/Search/Journald.pm \ Nagios/CheckLogfiles/Search/Dmesg.pm TEST_MODULES = \ Nagios/CheckLogfiles/Test.pm WIN_MODULES = \ Nagios/CheckLogfiles/Search/Dumpel.pm \ Nagios/CheckLogfiles/Search/Eventlog.pm \ Nagios/CheckLogfiles/Search/Psloglist.pm \ Nagios/CheckLogfiles/Search/Wevtutil.pm GREP = /bin/grep SUFFIXES = .pl .pm .sh EXTRA_DIST = $(libexec_SCRIPTS).pl $(EXTRA_MODULES) $(TEST_MODULES) $(WIN_MODULES) CLEANFILES = $(libexec_SCRIPTS) AM_INSTALL_PROGRAM_FLAGS = @INSTALL_OPTS@ all: all-am .SUFFIXES: .SUFFIXES: .pl .pm .sh $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins-scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu plugins-scripts/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): subst: $(top_builddir)/config.status $(srcdir)/subst.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libexecSCRIPTS: $(libexec_SCRIPTS) @$(NORMAL_INSTALL) @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(libexecdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(libexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libexecSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libexecSCRIPTS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-libexecSCRIPTS .PRECIOUS: Makefile .pm : $(AWK) -f ./subst $< > $@ chmod +x $@ .pl : $(AWK) -f ./subst $< > $@ chmod +x $@ .sh : $(AWK) -f ./subst $< > $@ chmod +x $@ $(libexec_SCRIPTS) : $(EXTRA_DIST) $(ECHO) "#! #PERL# " | $(AWK) -f ./subst > $@ $(ECHO) "# nagios: -epn" >> $@ $(ECHO) >> $@ for m in ${EXTRA_MODULES}; do \ $(SED) -e 's/^1;//g' < $$m | $(SED) -e '/^__END__/,$$d' | $(AWK) -f ./subst >> $@; \ done $(CAT) check_logfiles.pl | $(AWK) -f ./subst >> $@ chmod +x $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: check_logfiles-4.1.1/plugins-scripts/Makefile.am0000644000175000017500000000270314336703157016614 00000000000000libexec_SCRIPTS=check_logfiles EXTRA_MODULES=\ Nagios/Tivoli/Config/Logfile.pm \ Nagios/CheckLogfiles.pm \ Nagios/CheckLogfiles/Search/Errpt.pm \ Nagios/CheckLogfiles/Search/Ipmitool.pm \ Nagios/CheckLogfiles/Search/Oraclealertlog.pm \ Nagios/CheckLogfiles/Search/Esxdiag.pm \ Nagios/CheckLogfiles/Search/Executable.pm \ Nagios/CheckLogfiles/Search/Dummy.pm \ Nagios/CheckLogfiles/Search/Journald.pm \ Nagios/CheckLogfiles/Search/Dmesg.pm TEST_MODULES=\ Nagios/CheckLogfiles/Test.pm WIN_MODULES=\ Nagios/CheckLogfiles/Search/Dumpel.pm \ Nagios/CheckLogfiles/Search/Eventlog.pm \ Nagios/CheckLogfiles/Search/Psloglist.pm \ Nagios/CheckLogfiles/Search/Wevtutil.pm SED=/bin/sed GREP=/bin/grep CAT=/bin/cat ECHO=/bin/echo SUFFIXES = .pl .pm .sh VPATH=$(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t EXTRA_DIST=$(libexec_SCRIPTS).pl $(EXTRA_MODULES) $(TEST_MODULES) $(WIN_MODULES) CLEANFILES=$(libexec_SCRIPTS) AM_INSTALL_PROGRAM_FLAGS=@INSTALL_OPTS@ .pm : $(AWK) -f ./subst $< > $@ chmod +x $@ .pl : $(AWK) -f ./subst $< > $@ chmod +x $@ .sh : $(AWK) -f ./subst $< > $@ chmod +x $@ $(libexec_SCRIPTS) : $(EXTRA_DIST) $(ECHO) "#! #PERL# " | $(AWK) -f ./subst > $@ $(ECHO) "# nagios: -epn" >> $@ $(ECHO) >> $@ for m in ${EXTRA_MODULES}; do \ $(SED) -e 's/^1;//g' < $$m | $(SED) -e '/^__END__/,$$d' | $(AWK) -f ./subst >> $@; \ done $(CAT) check_logfiles.pl | $(AWK) -f ./subst >> $@ chmod +x $@ check_logfiles-4.1.1/plugins-scripts/check_logfiles.pl0000755000175000017500000004045014336703157020062 00000000000000package main; use strict; use utf8; use File::Basename; use File::Find; use Getopt::Long; #import Devel::TraceMethods qw( # Nagios::CheckLogfiles # Nagios::CheckLogfiles::Search # Nagios::CheckLogfiles::Search::Simple # Nagios::CheckLogfiles::Search::Rotating # Nagios::CheckLogfiles::Search::Rotating::Uniform # Nagios::CheckLogfiles::Search::Virtual # Nagios::CheckLogfiles::Search::Prescript # Nagios::CheckLogfiles::Search::Postscript # Nagios::Tivoli::Config::Logfile # Nagios::Tivoli::Config::Logfile::Format # Nagios::Tivoli::Config::Logfile::Hit #); #Devel::TraceMethods::callback ( # 'Nagios::CheckLogfiles' => \&logger, # 'Nagios::CheckLogfiles::Search' => \&logger, # 'Nagios::CheckLogfiles::Search::Simple' => \&logger, # 'Nagios::CheckLogfiles::Search::Rotating' => \&logger, # 'Nagios::CheckLogfiles::Search::Rotating::Uniform' => \&logger, # 'Nagios::CheckLogfiles::Search::Virtual' => \&logger, # 'Nagios::CheckLogfiles::Search::Prescript' => \&logger, # 'Nagios::CheckLogfiles::Search::Postscript' => \&logger, # 'Nagios::Tivoli::Config::Logfile' => \&logger, # 'Nagios::Tivoli::Config::Logfile::Format' => \&logger, # 'Nagios::Tivoli::Config::Logfile::Hit' => \&logger, #); use constant OK => 0; use constant WARNING => 1; use constant CRITICAL => 2; use constant UNKNOWN => 3; Getopt::Long::Configure qw(no_ignore_case); # compatibility with old perls use vars qw (%commandline $SEEKFILESDIR $PROTOCOLSDIR $SCRIPTPATH); $SEEKFILESDIR = '#SEEKFILES_DIR#'; $PROTOCOLSDIR = '#PROTOCOLS_DIR#'; $SCRIPTPATH = '#TRUSTED_PATH#'; my @cfgfiles = (); my $needs_restart = 0; my $enough_info = 0; sub logger { my $method = shift; my @args = @_; printf STDERR "%s\n", $method; printf STDERR " %s\n", Data::Dumper::Dumper(\@args); } my $plugin_revision = '$Revision: 1.0 $ '; my $progname = basename($0); sub print_version { printf "%s v#PACKAGE_VERSION#\n", basename($0); } sub print_help { print < The configfile looks like this: \$seekfilesdir = '/opt/nagios/var/tmp'; # where the state information will be saved. \$protocolsdir = '/opt/nagios/var/tmp'; # where protocols with found patterns will be stored. \$scriptpath = '/opt/nagios/var/tmp'; # where scripts will be searched for. \$MACROS = \{ CL_DISK01 => "/dev/dsk/c0d1", CL_DISK02 => "/dev/dsk/c0d2" \}; \@searches = ( { tag => 'temperature', logfile => '/var/adm/syslog/syslog.log', rotation => 'bmwhpux', criticalpatterns => ['OVERTEMP_EMERG', 'Power supply failed'], warningpatterns => ['OVERTEMP_CRIT', 'Corrected ECC Error'], options => 'script,protocol,nocount', script => 'sendnsca_cmd' }, { tag => 'scsi', logfile => '/var/adm/messages', rotation => 'solaris', criticalpatterns => 'Sense Key: Not Ready', criticalexceptions => 'Sense Key: Not Ready /dev/testdisk', options => 'noprotocol' }, { tag => 'logins', logfile => '/var/adm/messages', rotation => 'solaris', criticalpatterns => ['illegal key', 'read error.*\$CL_DISK01\$'], criticalthreshold => 4 warningpatterns => ['read error.*\$CL_DISK02\$'], } ); EOTXT } sub print_usage { print < [--searches=tag1,tag2,...] check_logfiles [-t timeout] --logfile= --tag= --rotation= --criticalpattern= --warningpattern= EOTXT } sub decode_rfc3986 { my ($str) = @_; if ($str && $str =~ /^rfc3986:\/\/(.*)/) { $str = $1; $str =~ s/%([A-Za-z0-9]{2})/chr(hex($1))/seg; } return $str; } %commandline = (); my @params = ( "timeout|t=i", "version|V", "help|h", "debug|d", "verbose|v", # # # "environment|e=s%", "daemon:i", "report=s", "reset", "unstick", # # limit process address space to i megabytes # "maxmemsize=i", # # # "install", "deinstall", "service=s", "username=s", "password=s", # # which searches # "config|f=s", "configdir|F=s", "searches=s", "selectedsearches=s", # # globals # "seekfilesdir=s", "protocolsdir=s", "protocolsretention=i", "macro=s%", "seekfileerror=s", # # thresholds # "warning=s", "critical=s", # # search # "template=s", "tag=s", "logfile=s", "rotation=s", "tivolipattern=s", "criticalpattern=s", "criticalexception=s", "warningpattern=s", "warningexception=s", "patternfile=s", "okpattern=s", "type=s", "archivedir=s", # # search options # "noprotocol", "nocase", "nologfilenocry", "logfilemissing=s", "maxlength=i", "syslogserver", "syslogclient=s", "sticky:s", "noperfdata", "winwarncrit", "lookback=s", "allyoucaneat", "context=i", "criticalthreshold=i", "warningthreshold=i", "encoding=s", "preferredlevel=s", "logfileerror=s", "rotatewait", "rununique", "htmlencode", "randominode", "randomdevno", ); if (! GetOptions(\%commandline, @params)) { print_help(); exit $ERRORS{UNKNOWN}; } if (exists $commandline{version}) { print_version(); exit UNKNOWN; } if (exists $commandline{help}) { print_help(); exit UNKNOWN; } if (exists $commandline{config}) { $enough_info = 1; } elsif (exists $commandline{configdir}) { $enough_info = 1; } elsif (exists $commandline{logfile}) { $enough_info = 1; } elsif (exists $commandline{type} && $commandline{type} =~ /^(eventlog|errpt|ipmitool|wevtutil|executable|dumpel|journald|dmesg)/) { $enough_info = 1; } elsif (exists $commandline{deinstall}) { $commandline{type} = 'dummy'; $enough_info = 1; } if (! $enough_info) { print_usage(); exit UNKNOWN; } if (exists $commandline{daemon}) { my @newargv = (); foreach my $option (keys %commandline) { if (grep { /^$option/ && /=/ } @params) { push(@newargv, sprintf "--%s", $option); push(@newargv, sprintf "%s", $commandline{$option}); } else { push(@newargv, sprintf "--%s", $option); } } #$0 = 'check_logfiles '.join(' ', @newargv); # SNMP shows a hwSWRunStatus 4 if there are blanks in /proc/pid/comm $0 = "check_logfiles\0".join("\0", @newargv); if (! $commandline{daemon}) { $commandline{daemon} = 300; } } if (exists $commandline{environment}) { # if the desired environment variable values are different from # the environment of this running script, then a restart is necessary. # because setting $ENV does _not_ change the environment of the running script. foreach (keys %{$commandline{environment}}) { if ((! $ENV{$_}) || ($ENV{$_} ne $commandline{environment}->{$_})) { $needs_restart = 1; $ENV{$_} = $commandline{environment}->{$_}; } } } if ($needs_restart) { my @newargv = (); foreach my $option (keys %commandline) { if (grep { /^$option/ && /=/ } @params) { if (ref ($commandline{$option}) eq "HASH") { foreach (keys %{$commandline{$option}}) { push(@newargv, sprintf "--%s", $option); push(@newargv, sprintf "%s=%s", $_, $commandline{$option}->{$_}); } } else { push(@newargv, sprintf "--%s", $option); push(@newargv, sprintf "%s", $commandline{$option}); } } else { push(@newargv, sprintf "--%s", $option); } } exec $0, @newargv; # this makes sure that even a SHLIB or LD_LIBRARY_PATH are set correctly # when the perl interpreter starts. Setting them during runtime does not # help loading e.g. libclntsh.so exit; } if (exists $commandline{configdir}) { sub eachFile { my $filename = $_; my $fullpath = $File::Find::name; #remember that File::Find changes your CWD, #so you can call open with just $_ if ((-f $filename) && ($filename =~ /\.(cfg|conf)$/)) { push(@cfgfiles, $fullpath); } } find (\&eachFile, $commandline{configdir}); @cfgfiles = sort { $a cmp $b } @cfgfiles; } if (exists $commandline{config}) { # -f is always first unshift(@cfgfiles, $commandline{config}); } if (scalar(@cfgfiles) == 1) { $commandline{config} = $cfgfiles[0]; } elsif (scalar(@cfgfiles) > 1) { $commandline{config} = \@cfgfiles; } if (exists $commandline{searches}) { $commandline{selectedsearches} = $commandline{searches}; } if (! exists $commandline{selectedsearches}) { $commandline{selectedsearches} = ""; } if (exists $commandline{type}) { my ($type, $details) = split(":", $commandline{type}); } if (exists $commandline{criticalpattern}) { $commandline{criticalpattern} = '.*' if $commandline{criticalpattern} eq 'match_them_all'; delete $commandline{criticalpattern} if $commandline{criticalpattern} eq 'match_never_ever'; } if (exists $commandline{warningpattern}) { $commandline{warningpattern} = '.*' if $commandline{warningpattern} eq 'match_them_all'; delete $commandline{warningpattern} if $commandline{warningpattern} eq 'match_never_ever'; } if (! exists $commandline{seekfilesdir}) { if (exists $ENV{OMD_ROOT}) { $commandline{seekfilesdir} = $ENV{OMD_ROOT}."/var/tmp/check_logfiles"; } else { $commandline{seekfilesdir} = $SEEKFILESDIR; } } if ($^O eq "hpux") { $ENV{PATH} = $ENV{PATH}.":/usr/contrib/bin"; } foreach my $key (keys %commandline) { $commandline{$key} = decode_rfc3986($commandline{$key}); } if (my $cl = Nagios::CheckLogfiles->new({ cfgfile => $commandline{config} ? $commandline{config} : undef, searches => [ map { if (exists $commandline{type} && $commandline{type} eq 'rotating::uniform') { $_->{type} = $commandline{type}; } elsif (exists $commandline{type}) { # "eventlog" or "eventlog:eventlog=application,include,source=cdrom,source=dvd,eventid=23,eventid=29,operation=or,exclude,eventid=4711,operation=and" my ($type, $details) = split(":", $commandline{type}); $_->{type} = $type; if ($details) { $_->{$type} = {}; my $toplevel = $_->{$type}; foreach my $detail (split(",", $details)) { my ($key, $value) = split("=", $detail); if ($value) { if (exists $toplevel->{$key}) { $toplevel->{$key} .= ','.$value; } else { $toplevel->{$key} = $value; } } else { $_->{$type}->{$key} = {}; $toplevel = $_->{$type}->{$key}; } } } } $_; } map { # ausputzen foreach my $key (keys %{$_}) { delete $_->{$key} unless $_->{$key}}; $_; } ({ tag => $commandline{tag} ? $commandline{tag} : undef, logfile => $commandline{logfile} ? $commandline{logfile} : undef, type => $commandline{type} ? $commandline{type} : undef, rotation => $commandline{rotation} ? $commandline{rotation} : undef, tivolipatterns => $commandline{tivolipattern} ? $commandline{tivolipattern} : undef, criticalpatterns => $commandline{criticalpattern} ? $commandline{criticalpattern} : undef, criticalexceptions => $commandline{criticalexception} ? $commandline{criticalexception} : undef, warningpatterns => $commandline{warningpattern} ? $commandline{warningpattern} : undef, warningexceptions => $commandline{warningexception} ? $commandline{warningexception} : undef, okpatterns => $commandline{okpattern} ? $commandline{okpattern} : undef, patternfiles => $commandline{patternfile} ? $commandline{patternfile} : undef, options => join(',', grep { $_ } $commandline{noprotocol} ? "noprotocol" : undef, $commandline{nocase} ? "nocase" : undef, $commandline{noperfdata} ? "noperfdata" : undef, $commandline{nosavethresholdcount} ? "nosavethresholdcount" : undef, $commandline{thresholdexpiry} ? "thresholdexpiry=".$commandline{thresholdexpiry} : undef, $commandline{winwarncrit} ? "winwarncrit" : undef, $commandline{nologfilenocry} ? "nologfilenocry" : undef, $commandline{logfilemissing} ? "logfilemissing=".$commandline{logfilemissing} : undef, $commandline{syslogserver} ? "syslogserver" : undef, $commandline{syslogclient} ? "syslogclient=".$commandline{syslogclient} : undef, $commandline{maxlength} ? "maxlength=".$commandline{maxlength} : undef, $commandline{lookback} ? "lookback=".$commandline{lookback} : undef, $commandline{context} ? "context=".$commandline{context} : undef, $commandline{allyoucaneat} ? "allyoucaneat" : undef, $commandline{criticalthreshold} ? "criticalthreshold=".$commandline{criticalthreshold} : undef, $commandline{warningthreshold} ? "warningthreshold=".$commandline{warningthreshold} : undef, $commandline{encoding} ? "encoding=".$commandline{encoding} : undef, defined $commandline{sticky} ? "sticky".($commandline{sticky} ? "=".$commandline{sticky} : "") : undef, $commandline{preferredlevel} ? "preferredlevel=".$commandline{preferredlevel} : undef, $commandline{randominode} ? "randominode" : undef, $commandline{randomdevno} ? "randomdevno" : undef, ), archivedir => $commandline{archivedir} ? $commandline{archivedir} : undef, })], options => join(',', grep { $_ } $commandline{report} ? "report=".$commandline{report} : undef, $commandline{seekfileerror} ? "seekfileerror=".(uc $commandline{seekfileerror}) : undef, $commandline{logfileerror} ? "logfileerror=".(uc $commandline{logfileerror}) : undef, $commandline{maxmemsize} ? "maxmemsize=".$commandline{maxmemsize} : undef, $commandline{rotatewait} ? "rotatewait" : undef, $commandline{htmlencode} ? "htmlencode" : undef, $commandline{rununique} ? "rununique" : undef, ), selectedsearches => [split(/,/, $commandline{selectedsearches})], dynamictag => $commandline{tag} ? $commandline{tag} : undef, #report => $commandline{report} ? $commandline{report} : undef, cmdlinemacros => $commandline{macro}, seekfilesdir => $commandline{seekfilesdir} ? $commandline{seekfilesdir} : undef, protocolsdir => $commandline{protocolsdir} ? $commandline{protocolsdir} : undef, scriptpath => $commandline{scriptpath} ? $commandline{scriptpath} : undef, protocolsretention => $commandline{protocolsretention} ? $commandline{protocolsretention} : undef, reset => $commandline{reset} ? $commandline{reset} : undef, unstick => $commandline{unstick} ? $commandline{unstick} : undef, warning => $commandline{warning} ? $commandline{warning} : undef, critical => $commandline{critical} ? $commandline{critical} : undef, })) { $cl->{verbose} = $commandline{verbose} ? 1 : 0; $cl->{timeout} = $commandline{timeout} ? $commandline{timeout} : 360000; if ($commandline{install}) { $cl->install_windows_service($commandline{service}, $commandline{config}, $commandline{username}, $commandline{password}); } elsif ($commandline{deinstall}) { $cl->deinstall_windows_service($commandline{service}); } elsif ($commandline{daemon}) { $cl->run_as_daemon($commandline{daemon}); } else { $cl->run(); } my $exitmessage = $cl->{exitmessage}; # Escape | character to not break perfdata $exitmessage =~ s/\|/\/\//g; my $long_exitmessage = $cl->{long_exitmessage} ? $cl->{long_exitmessage}."\n" : ""; printf "%s%s\n%s", $exitmessage, $cl->{perfdata} ? "|".$cl->{perfdata} : "", $long_exitmessage; exit $cl->{exitcode}; } else { printf "%s\n", $Nagios::CheckLogfiles::ExitMsg; exit $Nagios::CheckLogfiles::ExitCode; } check_logfiles-4.1.1/config.guess0000755000175000017500000013036114336703157013734 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: check_logfiles-4.1.1/Makefile.in0000664000175000017500000006030714336703157013465 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # find . \( -type d -and -name .svn -and -prune \) -or -type f -exec fromdos -v {} \; VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING ChangeLog \ INSTALL NEWS README TODO config.guess config.sub install-sh \ missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_OPTS = @INSTALL_OPTS@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PROTOCOLS_DIR = @PROTOCOLS_DIR@ RELEASE = @RELEASE@ SED = @SED@ SEEKFILES_DIR = @SEEKFILES_DIR@ SET_MAKE = @SET_MAKE@ SH = @SH@ SHELL = @SHELL@ STRIP = @STRIP@ SUPPORT = @SUPPORT@ TRUSTED_PATH = @TRUSTED_PATH@ VERSION = @VERSION@ WARRANTY = @WARRANTY@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_nagios_group = @with_nagios_group@ with_nagios_user = @with_nagios_user@ SUBDIRS = plugins-scripts t EXTRA_DIST = winconfig.pl README.windows-exe all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile dist-hook: rm -f t/var/tmp/* rm -f t/var/adm/* find $(distdir) -type f -exec dos2unix {} \; make exe: pp -M PerlIO -M Digest::MD5 -M Encode::Encoding -M Encode::Unicode -M Encode::Unicode::UTF7 -M Net::Domain -M Win32::Daemon -o check_logfiles.exe check_logfiles # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: check_logfiles-4.1.1/configure0000775000175000017500000035327214336703145013332 00000000000000#! /bin/sh # From configure.ac . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for check_logfiles 4.1.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='check_logfiles' PACKAGE_TARNAME='check_logfiles' PACKAGE_VERSION='4.1.1' PACKAGE_STRING='check_logfiles 4.1.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_default_prefix=/usr/local/nagios ac_subst_vars='LTLIBOBJS LIBOBJS CAT SED ECHO GZIP PERL SH TRUSTED_PATH PROTOCOLS_DIR SEEKFILES_DIR INSTALL_OPTS with_nagios_group with_nagios_user SUPPORT WARRANTY INSTALL RELEASE host_os host_vendor host_cpu host build_os build_vendor build_cpu build AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_silent_rules with_nagios_user with_nagios_group with_seekfiles_dir with_protocols_dir with_trusted_path with_perl with_gzip ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures check_logfiles 4.1.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/check_logfiles] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of check_logfiles 4.1.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-nagios-user=USER set user name to run nagios --with-nagios-group=GROUP set group name to run nagios --with-seekfiles-dir=PATH sets directory for the state files (default=/tmp) --with-protocols-dir=PATH sets directory for the protocol files (default=/tmp) --with-trusted-path=PATH sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin) --with-perl=PATH sets path to perl executable --with-gzip=PATH sets path to gzip executable Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF check_logfiles configure 4.1.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by check_logfiles $as_me 4.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='check_logfiles' VERSION='4.1.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac RELEASE=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi WARRANTY="This plugin comes with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugin under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n" SUPPORT="Send email to gerhard.lausser@consol.de if you have questions\nregarding use of this software.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n" # Check whether --with-nagios_user was given. if test "${with_nagios_user+set}" = set; then : withval=$with_nagios_user; with_nagios_user=$withval else with_nagios_user=nagios fi # Check whether --with-nagios_group was given. if test "${with_nagios_group+set}" = set; then : withval=$with_nagios_group; with_nagios_group=$withval else with_nagios_group=nagios fi INSTALL_OPTS="-o $with_nagios_user -g $with_nagios_group" case "$host_os" in *hp*) defaulttrustedpath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/contrib/bin ;; *) defaulttrustedpath=/bin:/sbin:/usr/bin:/usr/sbin ;; esac # Check whether --with-seekfiles_dir was given. if test "${with_seekfiles_dir+set}" = set; then : withval=$with_seekfiles_dir; with_seekfiles_dir=$withval else with_seekfiles_dir=/var/tmp/check_logfiles fi SEEKFILES_DIR=$with_seekfiles_dir echo variable with_seekfiles_dir is $with_seekfiles_dir # Check whether --with-protocols_dir was given. if test "${with_protocols_dir+set}" = set; then : withval=$with_protocols_dir; with_protocols_dir=$withval else with_protocols_dir=/tmp fi PROTOCOLS_DIR=$with_protocols_dir # Check whether --with-trusted_path was given. if test "${with_trusted_path+set}" = set; then : withval=$with_trusted_path; with_trusted_path=$withval else with_trusted_path=$defaulttrustedpath fi TRUSTED_PATH=$with_trusted_path EXTRAS= # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SH+:} false; then : $as_echo_n "(cached) " >&6 else case $SH in [\\/]* | ?:[\\/]*) ac_cv_path_SH="$SH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SH=$ac_cv_path_SH if test -n "$SH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SH" >&5 $as_echo "$SH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GZIP+:} false; then : $as_echo_n "(cached) " >&6 else case $GZIP in [\\/]* | ?:[\\/]*) ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GZIP=$ac_cv_path_GZIP if test -n "$GZIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 $as_echo "$GZIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gawk nawk /usr/xpg4/bin/awk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_AWK+:} false; then : $as_echo_n "(cached) " >&6 else case $AWK in [\\/]* | ?:[\\/]*) ac_cv_path_AWK="$AWK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi AWK=$ac_cv_path_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done # Extract the first word of "echo", so it can be a program name with args. set dummy echo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECHO+:} false; then : $as_echo_n "(cached) " >&6 else case $ECHO in [\\/]* | ?:[\\/]*) ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECHO=$ac_cv_path_ECHO if test -n "$ECHO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5 $as_echo "$ECHO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 $as_echo "$SED" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CAT+:} false; then : $as_echo_n "(cached) " >&6 else case $CAT in [\\/]* | ?:[\\/]*) ac_cv_path_CAT="$CAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CAT=$ac_cv_path_CAT if test -n "$CAT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 $as_echo "$CAT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-perl was given. if test "${with_perl+set}" = set; then : withval=$with_perl; with_perl=$withval else with_perl=$PERL fi PERL=$with_perl # Check whether --with-gzip was given. if test "${with_gzip+set}" = set; then : withval=$with_gzip; with_gzip=$withval else with_gzip=$GZIP fi GZIP=$with_gzip ac_config_files="$ac_config_files Makefile plugins-scripts/Makefile plugins-scripts/subst t/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by check_logfiles $as_me 4.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ check_logfiles config.status 4.1.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "plugins-scripts/Makefile") CONFIG_FILES="$CONFIG_FILES plugins-scripts/Makefile" ;; "plugins-scripts/subst") CONFIG_FILES="$CONFIG_FILES plugins-scripts/subst" ;; "t/Makefile") CONFIG_FILES="$CONFIG_FILES t/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo " --with-perl: $with_perl" echo " --with-gzip: $with_gzip" echo " --with-seekfiles-dir: $with_seekfiles_dir" echo " --with-protocols-dir: $with_protocols_dir" echo " --with-trusted-path: $with_trusted_path" echo " --with-nagios-user: $with_nagios_user" echo " --with-nagios-group: $with_nagios_group" check_logfiles-4.1.1/aclocal.m40000664000175000017500000007252514336703157013265 00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) check_logfiles-4.1.1/Makefile.am0000755000175000017500000000075214336703157013453 00000000000000## Process this file with automake to produce Makefile.in # find . \( -type d -and -name .svn -and -prune \) -or -type f -exec fromdos -v {} \; SUBDIRS = plugins-scripts t EXTRA_DIST = winconfig.pl README.windows-exe dist-hook: rm -f t/var/tmp/* rm -f t/var/adm/* find $(distdir) -type f -exec dos2unix {} \; make exe: pp -M PerlIO -M Digest::MD5 -M Encode::Encoding -M Encode::Unicode -M Encode::Unicode::UTF7 -M Net::Domain -M Win32::Daemon -o check_logfiles.exe check_logfiles check_logfiles-4.1.1/INSTALL0000755000175000017500000002203014336703157012441 00000000000000Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. check_logfiles-4.1.1/winconfig.pl0000755000175000017500000001101714336703157013733 00000000000000use strict; use File::Basename; use Getopt::Long qw(:config no_ignore_case getopt_compat); # --with-seekfiles-dir=PATH sets directory for the state files (default=/tmp) # --with-protocols-dir=PATH sets directory for the protocol files (default=/tmp) # --with-trusted-path=PATH sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin) # --with-perl=PATH sets path to perl executable # --with-gzip=PATH sets path to gzip executable my($opt_with_seekfiles_dir, $opt_with_protocols_dir, $opt_with_trusted_path, $opt_with_perl, $opt_with_gzip); my $release = ""; open CFGAC, "configure.ac"; while () { $release = $1 if /^AC_INIT\(.*,([\d\.]+)\)/; } close CFGAC; if (! GetOptions( "with-seekfiles-dir=s" => \$opt_with_seekfiles_dir, "with-protocols-dir=s" => \$opt_with_protocols_dir, "with-trusted-path=s" => \$opt_with_trusted_path, "with-perl=s" => \$opt_with_perl, "with-gzip=s" => \$opt_with_gzip, )) { printf "nonono\n"; exit; } $opt_with_seekfiles_dir = 'C:\TEMP' if ! $opt_with_seekfiles_dir; $opt_with_protocols_dir = 'C:\TEMP' if ! $opt_with_protocols_dir; $opt_with_trusted_path = '' if ! $opt_with_trusted_path; $opt_with_perl = 'C:\strawberry\perl\bin\perl' if ! $opt_with_perl; $opt_with_gzip = '' if ! $opt_with_gzip; if (open CHECKLOGFILES, ">./plugins-scripts/check_logfiles") { printf CHECKLOGFILES "#! %s -w\n", $opt_with_perl; if (open CHECKLOGFILESPM, './plugins-scripts/Nagios/Tivoli/Config/Logfile.pm') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPM; } if (open CHECKLOGFILESPM, './plugins-scripts/Nagios/CheckLogfiles.pm') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPM; } if (open CHECKLOGFILESPM, './plugins-scripts/Nagios/CheckLogfiles/Search/Psloglist.pm') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPM; } if (open CHECKLOGFILESPM, './plugins-scripts/Nagios/CheckLogfiles/Search/Dumpel.pm') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPM; } if (open CHECKLOGFILESPM, './plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPM; } if (open CHECKLOGFILESPM, './plugins-scripts/Nagios/CheckLogfiles/Search/Wevtutil.pm') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPM; } if (open CHECKLOGFILESPM, './plugins-scripts/Nagios/CheckLogfiles/Search/Dummy.pm') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPM; } if (open CHECKLOGFILESPL, './plugins-scripts/check_logfiles.pl') { while() { s/^1;//g; s/#SEEKFILES_DIR#/$opt_with_seekfiles_dir/g; s/#PROTOCOLS_DIR#/$opt_with_protocols_dir/g; s/#TRUSTED_PATH#/$opt_with_trusted_path/g; s/#PACKAGE_VERSION#/$release/g; printf CHECKLOGFILES "%s", $_; } close CHECKLOGFILESPL; } close CHECKLOGFILES; } check_logfiles-4.1.1/README.windows-exe0000755000175000017500000000460414336703157014547 00000000000000How to create a windows native binary check_logfiles.exe 0) Deinstall ActiveState Perl VMWare Remote CLI and any other Perl packages you can find. 1) Install Strawberry Perl from http://strawberryperl.com/ 2) Prepare your environment so that strawberry perl is the preferred perl interpreter. $env:STRAWDIR = "C:\Users\lausser\Documents\Software\strawberry-perl-5.26.2.1-64bit-portable" $env:Path = $env:STRAWDIR + '\perl\bin;' + $env:Path $env:Path = $env:STRAWDIR + '\perl\site\bin;' + $env:Path $env:Path = $env:STRAWDIR + '\c\bin;' + $env:Path $env:Path = $env:STRAWDIR + '\perl\site\bin;' + $env:Path Better: Deinstall ActiveState Perl and any other Perl packages you can find. 3) Install PAR::Packer perl -MCPAN -eshell install PAR install PAR::Packer You will see error messages and the installation will fail. No problem! We can repair it. cd C:\strawberry\cpan\build a) cd PAR-0.980- perl Makefile.PL dmake dmake install b) cd PAR-Packer-0.980- edit myldr/Makefile.PL and add $file =~ s/^lib// if $^O eq "MSWin32"; after line 142. perl Makefile.PL dmake dmake install 4) Build the plugin cd check_logfiles-x.x.x.x perl winconfig.pl 5) Compile the plugin cd plugins-scripts pp -M PerlIO -M Digest::MD5 -M Encode::Encoding -M Encode::Unicode -M Encode::Unicode::UTF7 -M Net::Domain -M Win32::NetResource -M Win32::Daemon -M Time::Piece -M Time::Local -M Win32::EventLog -M Win32::TieRegistry -M Win32::WinError -M Date::Manip -M Win32::OLE -o check_logfiles.exe check_logfiles (maybe you need to install Win32::NetResource and Win32::Daemon) (Win32::Service is useful, too) 6) Package the plugin C:\Programme\WinZip\WINZIP32.EXE -a check_logfiles.zip plugins-scripts\check_logfiles If it does not work it's not my fault. It worked for me and my PC. I read the documentation and played around until it worked. If it does not work for you, read the documentation and play around. At least for a week. If it still does not work, forget check_logfiles. Use check_hanswurscht instead. The source of check_hanswurscht is: printf "hello hanswurscht\n"; Now try to create a windows binary with pp -o check_hanswurscht.exe check_hanswurscht Do not contact me if check_hanswurscht.exe doesn't work. Please contact Strawberry and tell them: "hi, i am a hanswurscht and i have a problem..." check_logfiles-4.1.1/acinclude.m40000755000175000017500000000454714336703157013616 00000000000000dnl @synopsis ACX_WHICH_GETHOSTBYNAME_R dnl dnl Provides a test to determine the correct way to call gethostbyname_r dnl dnl defines HAVE_GETHOSTBYNAME_R to the number of arguments required dnl dnl e.g. 6 arguments (linux) dnl e.g. 5 arguments (solaris) dnl e.g. 3 arguments (osf/1) dnl dnl @version $Id: acinclude.m4,v 1.5 2004/02/18 14:56:34 kdebisschop Exp $ dnl @author Brian Stafford dnl dnl based on version by Caolan McNamara dnl based on David Arnold's autoconf suggestion in the threads faq dnl AC_DEFUN([ACX_WHICH_GETHOSTBYNAME_R], [AC_CACHE_CHECK(number of arguments to gethostbyname_r, acx_which_gethostbyname_r, [ AC_TRY_COMPILE([ # include ], [ char *name; struct hostent *he; struct hostent_data data; (void) gethostbyname_r(name, he, &data); ],acx_which_gethostbyname_r=3, [ dnl acx_which_gethostbyname_r=0 AC_TRY_COMPILE([ # include ], [ char *name; struct hostent *he, *res; char *buffer = NULL; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop) ],acx_which_gethostbyname_r=6, [ dnl acx_which_gethostbyname_r=0 AC_TRY_COMPILE([ # include ], [ char *name; struct hostent *he; char *buffer = NULL; int buflen = 2048; int h_errnop; (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop) ],acx_which_gethostbyname_r=5,acx_which_gethostbyname_r=0) ] ) ] ) ]) if test $acx_which_gethostbyname_r -gt 0 ; then AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME_R], $acx_which_gethostbyname_r, [Number of parameters to gethostbyname_r or 0 if not available]) fi ]) dnl @synopsis ACX_HELP_STRING(OPTION,DESCRIPTION) AC_DEFUN([ACX_HELP_STRING], [ $1 builtin([substr],[ ],len($1))[$2]]) dnl @synopsis ACX_FEATURE(ENABLE_OR_WITH,NAME[,VALUE]) AC_DEFUN([ACX_FEATURE], [echo "builtin([substr],[ ],len(--$1-$2))--$1-$2: ifelse($3,,[$]translit($1-$2,-,_),$3)"]) check_logfiles-4.1.1/COPYING0000755000175000017500000004312714336703157012455 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. check_logfiles-4.1.1/README0000755000175000017500000006645714336703157012315 00000000000000check_logfiles Nagios Plugin README --------------------- This plugin looks for patterns in files. It is capable of detecting logfile rotation. If you tell it how the rotated archives look like, it will also examine these files. Traditional logfile plugins were not aware of the gap which could occur, so under some circumstances they ignored what had happened between their checks. In a production environment this is not tolerable, that's why check_logfiles came into being. * For instructions on installing this plugin for use with Nagios, see below. In addition, generic instructions for the GNU toolchain can be found in the INSTALL file. * For major changes between releases, read the CHANGES file. * For information on detailed changes that have been made, read the Changelog file. * This plugins is self documenting. All plugins that comply with the basic guidelines for development will provide detailed help when invoked with the '-h' or '--help' options. * The file check_logfiles.cfg contains example configurations for many of the plugins You can check for the latest plugin at: http://sourceforge.net/projects/check-logfiles/ or The documentation in this README covers only the most common features. To view the full documentation and examples, go to http://www.consol.com/opensource/nagios/check-logfiles or http://www.consol.de/opensource/nagios/check-logfiles Send mail to gerhard.lausser@consol.de or use the sourceforge forum for assistance. Please include the OS type and version that you are using. Also, run the plugin with the '-vvv' option and provide the resulting version information. Of course, there may be additional diagnostic information required as well. Use good judgment. For patch submissions and bug reports, please use the appropriate resources at http://sourceforge.net/projects/check-logfiles/ (navigate to the bug tool and/or patch tool from the summary page). Patches should be relative to the current CVS head (development), or to the head of the current stable branch. Also, please include version information for your OS and the plugin(s) your are patching/reporting. How to "compile" the check_logfiles script. -------------------------------------------------------- 1) Run the configure script to initialize variables and create a Makefile, etc. ./configure --prefix=BASEDIRECTORY --with-nagios-user=SOMEUSER --with-nagios-group=SOMEGROUP --with-perl=PATH_TO_PERL --with-gzip=PATH_TO_GZIP --with-trusted-path=PATH_YOU_TRUST --with-seekfiles-dir=SEEKFILES_DIR --with-protocols-dir=PROTOCOLS_DIR a) Replace BASEDIRECTORY with the path of the directory under which Nagios is installed (default is '/usr/local/nagios') b) Replace SOMEUSER with the name of a user on your system that will be assigned permissions to the installed plugins (default is 'nagios') c) Replace SOMEGRP with the name of a group on your system that will be assigned permissions to the installed plugins (default is 'nagios') d) Replace PATH_TO_PERL with the path where a perl binary can be found. Besides the system wide perl you might have installed a private perl just for the nagios plugins (default is the perl in your path). e) Replace PATH_TO_GZIP with the path where a gzip binary can be found. On some operating systems gzip is not in the standard path. (default is the gzip in your path). f) Replace PATH_YOU_TRUST with the path where you want the plugin to look for scripts which will be called if a certain pattern has been found. (default is /sbin:/usr/sbin:/bin:/usr/bin. HP-UX adds /usr/contrib/bin to this list. You can override this later in the config file). g) Replace SEEKFILES_DIR with the path where you want the script to write it's state files. (default is /tmp. You can override this later in the config file). h) Replace PROTOCOLS_DIR with the path where you want the script to write it's protocol files. (default is /tmp. You can override this later in the config file). Simply running ./configure will be sufficient to create a check_logfiles script which you can customize later with your configuration file. 2) "Compile" the plugin with the following command: make This will produce a "check_logfiles" script. You will also find a "check_logfiles.pl" which you better ignore. It is the base for the compilation filled with placeholders. These will be replaced during the make process. 3) Install the compiled plugin script with the following command: make install The installation procedure will attempt to place the plugin in a 'libexec/' subdirectory in the base directory you specified with the --prefix argument to the configure script. 4) Verify that your configuration files for Nagios contains the correct paths to the new plugin. How to build a debian package ----------------------------- Calling the script ./gen_deb_pkg.sh should be enough. Command line parameters ----------------------- --logfile= This is the logfile which will be scanned. --criticalpattern= This is the regular expression which will raise a critical error if found. --warningpattern= This is the regular expression which will raise a critical error if found. Usage is optional. --tag= This is a unique identifier for this logfile/pattern combination. You _must_ use it if you plan to call check_logfiles with more than one of these combinations. Usage is optional but strongly recommended. --noprotocol If you do not want all the matching lines being written to a protocol file, set this option. Usage is optional. --syslogserver If the server this script is running on is a syslogserver with messages from several hosts in the logfile, you can limit the scan to lines originationg from the local host. Usage is optional. -f Instead of describing on the command line what you search and where you search, you can describe much more complex configurations in a file. -d With this option you can turn on debugging. A file /tmp/check_logfiles.trace will be created and check_logfile's inner working will be logged into it. An alternative way to turn on debugging is to create the tracefile yourself. This is the preferred method to debug on the fly if you don't want to change your nagios configuration and add the "-d" to your command_line. Format of the configuration file -------------------------------- check_logfiles interprets a configuration file, which sets some global variables and tells the plugin which logfiles to scan for which patterns and what to do if a matching line was found. The filename you provide to the -f option is either an absolute filename or relative to the calling user's home directory. The configfile is a piece of perl code, which will be imported and evaluated. The variables you can define here are: 1) $seekfilesdir A directory where check_logfiles writes state files. The information in the state files helps check_logfiles to remember up to which time in the past the log information was already read. (default is /tmp or whatever you provided to the --with-seekfiles-dir option of configure) 2) $protocolsdir A directory where check_logfiles writes protocol files which contain the matches found during a check_logfiles run. (default is /tmp or whatever you provided to the --with-protocols-dir option of configure) 3) $scriptpath A colon-separated list of directories where check_logfiles searches for scripts. (default is /bin:/usr/bin:/sbin:/usr/sbin or whatever you provided to the --with-trusted-path option of configure) 4) $MACROS A structure where you define macros. You can use these macros in your pattern definitions (enclosed in $-signs) , where they will be replaced with the macro's value before pattern matching takes place. It is also possible to use macros in your logfile names. $MACROS = { CL_DOMAIN => 'muc', CL_VG00 => '/dev/vg00' } If you don't define your own macros, you still can use the predefined macros in your patterns. At the moment there are: $CL_HOSTNAME$ - the hostname without domain. $CL_IPADDRESS$ - the IP address of the aforementioned. $CL_DATE_YYYY$ - the year (1970...) $CL_DATE_MM$ - the month (01..12) $CL_DATE_DD$ - the day of month (01..31) $CL_DATE_HH$ - the hour (00..23) $CL_DATE_MI$ - the minute (00..59) $CL_DATE_SS$ - the second (00..59) $CL_SERVICEDESC$ - the service description derived from the config file. $CL_NSCA_SERVICEDESC$ - dto. $CL_NSCA_HOST_ADDRESS$ - the local address 127.0.0.1 $CL_NSCA_PORT$ - 5667 $CL_NSCA_TO_SEC$ - 10 $CL_NSCA_CONFIG_FILE$ - send_nsca.cfg The following (predefined) macros change their value during a check_logfile run: $CL_LOGFILE$ - the name of the current logfile. $CL_TAG$ - the current tag. $CL_SERVICESTATEID$ - the state of the last match. (0..3) $CL_SERVICEOUTPUT$ - the text of the last match. 5) @searches An array of references to hashes, each describing where to search, what to search for and what to do if it was found. (to stay backwards compatible you can also say @logs here) The hash pointed to has the following keys: a) tag An identifier you need if you have more than one entry in @logs dealing with the same logfile. The seekfile is derived from the logfile's name, so in this case there would be problems if two different entries would rely on a single state file. The tag is made part of the seekfiles' name. b) logfile The name of the logfile you want to search for patterns. This is usually syslog's main output file (/var/adm/messages, /var/log/syslog.log) but can also be any application's log. (Oracle alertlog) There may even be logfiles with shifting names, e.g. LOGBUCH20060801230000 which is derived from date/time. You can try to catch these names with macro definitions. ( logfile => 'LOGBUCH$CL_DATE_YYYY$$CL_DATE_MM$$CL_DATE_DD$...' ) c) archivedir The name of a directory where your system writes rotated logfiles to. (default is the directory of the logfile). d) rotation A regular expression which will be applied to the files in archivedir. Matches are considered rotated logfiles. Instead of a regular expression you can also use one of the predefined symbols. See list below. This is not a mandatory parameter, but consider the following: - 12:00 check_logfiles runs, finds nothing and writes into it's state file: "at 12:01 i seeked up to line no. 2384" - 12:02 something very bad happens and it's noted in the syslog. - 12:03 the logfile is rotated and has now size 0. - 12:04 something very harmless happens and it's noted in the syslog. - 12:05 check_logfile runs, reads the state file, wants to continue at line 2385, fails and begins reading at line 0. As rotated logfiles do not matter here, the critical message will never be reported. So if you take your business serious, you cannot afford not to ignore rotated logfiles. Example: You have a logfile suelzomat.log and keep the logs for 7 days. Every day at midnight you move the logfile to suelzomat.old. where day is an integer (1=monday, 2=tuesday,.....), so your archivedir might look like messages messages.0 messages.1.gz suelzomat.log suelzomat.old.1 suelzomat.old.2 suelzomat.old.3 suelzomat.old.4 suelzomat.old.5 suelzomat.old.6 suelzomat.old.7 uucp.log Your searches entry would then look like: rotation => 'suelzomat.old.[0-9]' If you call check_logfiles with -d you will find a trace file in /tmp/check_logfiles.trace where you can follow the inner logic. Use it if you have your own naming scheme and you will see how rotations are detected and what happens then. d) criticalpatterns A single regular expression or a pointer to an array of regular expressions. The lines of your logfile will be compared to these and a match will be considered a critical error. criticalpatterns => ['.*Sense Key: Media Error.*', '.*Sense Key: Not Ready.*', '.*Sense Key: Hardware Error.*', ....] Remember, you can use macros here: criticalpatterns => ['.*illegal login from $CL_IPADDRESS$'] (this example may not make sense, it's just an example) You can prepend a pattern with "!". In this case the search for patterns is reversed. Only if there is no match, an alert is raised. Imagine you have an application which writes every minute "i am alive" to it's logfile. With a pattern like '!.*i am alive.*' and check_logfiles running in intervals of more than a minute, you can monitor if your application is running properly. e) criticalexceptions A single regular expression or a pointer to an array of regular expressions just like criticalpatterns. With exceptions you can cancel the processing and reporting of a preceded criticalpatterns match. criticalpatterns => '.*Failed password for illegal user.*', criticalexceptions => '.*Failed password for illegal user lausser', In this example an alert will be raised if someone tries to log in with an invalid password. This is what we want except for one case. User lausser is known to be scatterbrained and we don't want an alert every time he forgets his password. f) criticalthreshold A number telling check_syslog how much matching patterns to ignore until an event is generated. A value of 5 means, skip 4 matches and only count the 5th one. g) warningpatterns A single regular expression or a pointer to an array of regular expressions. The lines of your logfile will be compared to these and a match will be considered a warning. warningpatterns => ['.*vxvm:vxio: Subdisk.*Uncorrectable write error.*', ....] h) warningthreshold Same as criticalthreshold, only for warningpatterns. i) warningexceptions Same as criticalexceptions, only for warningpatterns. j) options A comma-separated list of options. possible values are: - [no]script If a pattern matches, execute a script. (see script key below). (default is noscript) - [no]protocol If a pattern matches, write the matching line to a protocol file. The filename of the protocol file is derived from the configuration file's name. Any file extensions are cut off and a timestamp is added. Example: at 12:00 "check_logfiles -f check_oracle_alerts" is called. Your configuration file is named check_oracle_alerts.cfg Any matching patterns will then be written to $protocoldir/check_oracle_alerts.protocol-2006-03-14-12-00-02 The output of this plugin will point you to the file. Example: CRITICAL - 5 errors in /opt/nagios/log/check_oracle_alerts.... (default is protocol) - [no]count If a pattern matches, a counter will be incremented, either one for the warnings or one for the errors. Their final value will cause the exit code of this plugin. This is the normal behaviour of a nagios plugin, but you might consider a szenario, where you don't want nagios to care about the results and use it just as a vehicle to periodically run the plugin. You leave the processing of the results solely to a script you defined here. (default is count) - [no]syslogserver If your system is used as a syslog server, your logfiles may contain messages belonging to other hosts in your network. To restrict the search to lines which originate from the server, where check_logfiles is executed, you can use the option syslogserver. This will prepend every pattern with .*(your_servers_hostname|localhost).* where your_servers_hostname is the hostname without domain. If you have a configuration, where hosts with equal hostname but different domain log to your server, you set nosyslogserver, but prepend your patterns with .*($CL_HOSTNAMEFQDN$|localhost).* and define CL_HOSTNAMEFQDN in $MACROS as the fully qualified hostname. k) script A script or binary which will be called if you set the script option. It must reside in one of the directories of $scriptpath. Warning: before version 1.3.4 the matching line prepended with WARNING or CRITICAL was piped into the standard input of the script. This has seriously changed: By default, nothing will be written to stdin of the script. The relevant information will be passed by environment variables. CHECK_LOGFILES_LOGFILE - the logfile in which the pattern was found. CHECK_LOGFILES_TAG - the tag of the @searches-entry. CHECK_LOGFILES_SERVICESTATE - WARNING or CRITICAL CHECK_LOGFILES_SERVICESTATEID - 1 or 2 CHECK_LOGFILES_SERVICEOUTPUT - the matching line. CHECK_LOGFILES_HOSTNAME - the name of the local host. l) scriptparams An optional string with command line parameters which will be appended to the script command. The string can contain macros. e.g. scriptparams => '-H $CL_NSCA_HOST_ADDRESS$'; m) scriptstdin If you want to write something into the stdin of your script, you can use the scriptstdin option to describe the format of the input. It is a simple string like: scriptstdin => '$CL_HOSTNAME$\t$CL_SERVICEDESC$\t$CL_SERVICESTATEID$\n'; which can contain macros and the sequences \t and \n. See below for real-world examples. n) scriptdelay The number of seconds to sleep after the script has finished until check_logfiles will continue to work. This is a rarely used parameter. Do not waste many thoughts on it. 6) $protocolretention The number of days you want to keep your protocol files. Files older than this number of days will be deleted automatically. (default is 7 days) 8) prescript A script or binary which will be called at the beginning of a check_logfiles run. This is similar to the script option mentioned in the @searches section. This script could for example force an application to flush it's output buffer into it's logfile. The CHECK_LOGFILES_TAG will be set to "startup" and the servicestate is always OK. prescriptparams and prescriptstdin are used as described above. prescriptdelay is can be used in a configuration where you force an application or simply the syslog daemon to write something into a logfile to see if they really work. As this may take some time, you can set a delay here until check_logfile will search for the message in the logfile. 9) postscript A script or binary which will be called at the end of a check_logfiles run. This is similar to the script option mentioned in the @searches section. The CHECK_LOGFILES_TAG will be set to "summary". postscriptparams and postscriptstdin are used as described above. postdelay is also supported but i cannot imagine how to use it. How to call check_logfiles from Nagios -------------------------------------- 1) If you defined just one service for your logfile analysis, then you can hardcode the path to your configuration file in your nrpe.cfg (I assume, most of you monitor multiple servers and use nrpe). define service { service_description check_sanlogs host_name oaschgeign.muc check_command check_nrpe!check_logfiles is_volatile 1 check_period 7x24 max_check_attempts 1 ... } define command { command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } command[check_logfiles]=/opt/nagios/libexec/check_logfiles -f logdefs.cfg or if you chose command line parameters instead of a config file: define service { service_description check_sanlogs_withoutconfigfile host_name oaschgeign.muc check_command check_nrpe_cl!60!check_logfiles!san!/var/log/messages!SUSE!OFFLINE ... define command { command_name check_nrpe_cl command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t $ARG1$ -c $ARG2$ -a $ARG3$ $ARG4$ $ARG5$ $ARG6$ } command[check_logfiles]=/opt/nagios/libexec/check_logfiles --tag=$ARG1$ --logfile=$ARG2$ --rotation=$ARG3$ --criticalpattern=$ARG4$ --noprotocol Unfortunately the command line parameter method works only for very basic patterns. Nrpe doesn't accept special characters like \ or [ which are necessary for most regular expressions. 2) In an environment with multiple services using check_logfiles or even multiple nagios instances, you have to use parameters to establish the connection between service and config file. I propose you name the config files after the service descriptions like in the following example. a) Nagios instance Solaris define service { service_description logfilescan register 0 is_volatile 1 check_period 7x24 max_check_attempts 1 ... } define service { service_description solaris_check_sanlogs host_name oaschgeign.muc check_command check_nrpe_arg!20!check_logfiles!cfg.d/$SERVICEDESC$ contact_group sanadmin use logfilescan } define service { service_description solaris_check_apachelogs host_name oaschgeign.muc check_command check_nrpe_arg!20!check_logfiles!cfg.d/$SERVICEDESC$ contact_group webadmin use logfilescan } define command { command_name check_nrpe_arg command_line $USER1$/check_nrpe -p 5777 -H $HOSTADDRESS$ -t $ARG1$ -c $ARG2$ -a $ARG3$ } b) Nagios instance Oracle define service { service_description logfilescan register 0 is_volatile 1 check_period 7x24 max_check_attempts 1 ... } define service { service_description oracle_check_alerts host_name oaschgeign.muc check_command check_nrpe_arg!20!check_logfiles!cfg.d/$SERVICEDESC$ contact_group oraadmin use logfilescan } define command { command_name check_nrpe_arg command_line $USER1$/check_nrpe -p 5777 -H $HOSTADDRESS$ -t $ARG1$ -c $ARG2$ -a $ARG3$ } c) Nrpe on host oaschgeign.muc [check_logfiles]=/opt/nagios/libexec/check_logfiles -f $ARG1$ A check of solaris_check_apachelogs would then result in the following command: /opt/nagios/libexec/check_logfiles -f cfg.d/solaris_check_apachelogs In your nrpe user's home directory you have a subdirectory cfg.d holding the single configuration files solaris_check_sanlogs.cfg, solaris_check_apachelogs.cfg and oracle_check_alerts.cfg where each team writes it's individual patterns and logfile definitions. How to run check_logfiles as standalone program and inform nagios via nsca -------------------------------------- First some facts we assume in this example. The nagios server is called lpmon1.muc The nagios client is called orschgeign.muc Calling hostname() on orschgeign.muc returns orschgeign.local Like before, you define a service in your nagios configuration, but this time it is acting passive. define service { service_description logfilescan register 0 is_volatile 1 check_period 7x24 passive_checks_enabled 1 active_checks_enabled 0 max_check_attempts 1 ... } define service { service_description check_sanlogs host_name oaschgeign.muc contact_group sanadmin use logfilescan } Then start your nsca listener (in this example listening on port 5778), which will wait for asynchronous notifications concerning the solaris_check_sanlogs status. On the monitored host oaschgeign, you will run check_logfiles periodically as a cronjob. The configuration file check_sanlogs.cfg looks like: $scriptpath = '/usr/bin/nagios/libexec:/usr/local/nagios/contrib'; $MACROS = { NAGIOS_HOSTNAME => "oaschgeign.muc", CL_NSCA_HOST_ADDRESS => "lpmon1.muc", CL_NSCA_PORT => 5778 }; $postscript = 'send_nsca'; $postscriptparams = '-H $CL_NSCA_HOST_ADDRESS$ -p $CL_NSCA_PORT$ -to $CL_NSCA_TO_SEC$ -c $CL_NSCA_CONFIG_FILE$'; $postscriptstdin = '$CL_HOSTNAME$\t$CL_SERVICEDESC$\t$CL_SERVICESTATEID$\t$CL_SERVICEOUTPUT$\n'; @searches = ( { tag => 'san', logfile => '/var/adm/messages', criticalpatterns => [ 'Link Down Event received', 'Loop OFFLINE', 'fctl:.*disappeared from fabric', '.*Lun.*disappeared.*' ], }, ); Now if check_logfiles finds matching patterns in the logfile, at the end of the check_logfiles run it will execute a "send_nsca -H lpmon1.muc -p 5778" which sends the line "oaschgeign.muccheck_sanlogs2CRITICAL - critical errors ...." to the nsca daemon. The nsca daemon will write an external command to the nagios command pipe which causes nagios to set the status of service check_san to critical and send a notification to contactgroup sanadmin immediately. If you don't expect too many matching lines in your logfiles, you can send event to the nsca daemon for each matching pattern instead of a summary. Your config file would then look like this: $scriptpath = '/usr/bin/nagios/libexec:/usr/local/nagios/contrib'; $MACROS = { NAGIOS_HOSTNAME => "oaschgeign.muc", CL_NSCA_HOST_ADDRESS => "lpmon1.muc", CL_NSCA_PORT => 5778 }; @searches = ( { tag => 'san', logfile => '/var/adm/messages', criticalpatterns => [ 'Link Down Event received', 'Loop OFFLINE', 'fctl:.*disappeared from fabric', '.*Lun.*disappeared.*' ], script => 'send_nsca', scriptparams => '-H $CL_NSCA_HOST_ADDRESS$ -p $CL_NSCA_PORT$ -to $CL_NSCA_TO_SEC$ -c $CL_NSCA_CONFIG_FILE$', scriptstdin => '$CL_HOSTNAME$\t$CL_SERVICEDESC$\t$CL_SERVICESTATEID$\t$CL_SERVICEOUTPUT$\n', }, ); In older releases you could find a nsca configuration option. This was dropped in favour of the (pre/post)script options which provide much more flexibility if you want to replace the nsca mechanism for example by snmp. That's it. If you have any problems or questions, feel free to send mail to gerhard.lausser@consol.de Format of the seekfile ---------------------- $state = { logoffset logtime devino logfile servicestateid serviceoutput }; Common errors ------------- Bad arg length for Socket::inet_ntoa, length is 0, should be 4 at use Net::Domain qw(hostname hostdomain hostfqdn); printf "hostname() = %s\n", hostname(); printf "hostdomain() = %s\n", hostdomain(); printf "hostfqdn() = %s\n", hostfqdn(); printf "hostfqdn() = %s\n", hostfqdn(); printf "ipaddress = %s\n", inet_ntoa(scalar gethostbyname(hostname())); Usually there is a problem with the backward resolution of the hostname. Look into your /etc/hosts and add | -- Gerhard Lausser check_logfiles-4.1.1/install-sh0000755000175000017500000003325514336703157013424 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: check_logfiles-4.1.1/TODO0000755000175000017500000000116614336703157012107 00000000000000------------------------------------------------------------- TIMEOUT O timeout leads to graceful shutdown instead of sudden death ------------------------------------------------------------- VARTMP O use /var/tmp as default instead of /tmp migration of old seekfiles ------------------------------------------------------------- PROTOCOLMACRO X update documentation for CL_PROTOCOLFILE ------------------------------------------------------------- MORECOMMANDLINE X move parameters from configfile to commandline X --criticalexception X --warningexception X --okpattern X --sticky X update documentation