Ad Widget

Collapse

Log file monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jansonz
    Member
    • Dec 2006
    • 53

    #1

    Log file monitoring

    Hi,

    Is tit possible to capture several lines from log at once?

    I'm trying to capture errors (with stack trace) in tomcat log files. They usually contain quite meaningful indications to problem I would like to capture those as well.

    Janis
  • zab_monkey
    Member
    • Mar 2010
    • 37

    #2
    Hi,

    Sorry to ask but I want to clarify before offering an option;

    Do you mean you want to search a number of lines at once and capture results, or;

    Do you mean if you find a expression you are looking for, to capture in and the following, say, 10 lines or so?

    Cheers,

    JC

    Comment

    • jansonz
      Member
      • Dec 2006
      • 53

      #3
      Well,

      Usually the error in Tomcat looks like this:
      <Timestamp>ERROR java.io.FileNotFoundException: fred.txt
      at java.io.FileInputStream.<init>(FileInputStream.jav a)
      at java.io.FileInputStream.<init>(FileInputStream.jav a)
      at ExTest.readMyFile(ExTest.java:19)
      at ExTest.main(ExTest.java:7)

      If I capture all the ERROR messages in the log with zabbix, it download only the line with "ERROR".

      Do make some more specific triggers, I need to capture the following lines as well for Zabbix analysis.

      Maybe anybody has some other solution in mind?

      Comment

      • alusvedejs
        Junior Member
        • Jul 2011
        • 11

        #4
        is there an answer?

        Hi!

        looks like i am searching for similar solution

        i am trying to monitor DB2 log file
        and it also writes error message in several lines

        to search for the error message in unix i use "grep -p Error"

        v7-p7-prod 11:28:34 zabbix:/home/zabbix$ tail -100000 /home/db2inst1/sqllib/db2dump/db2diag.log | grep -p Error
        2011-07-30-04.00.21.954691+180 I149135337A181 LEVEL: Error
        PID:63242488 TID:49352 NODE:000 Title: SQLP_ALRCB
        Dump File:/home/db2inst1/sqllib/db2dump/63242488.49352.000.dump.bin

        2011-07-30-04.00.21.955063+180 I149135519A578 LEVEL: Error
        PID : 63242488 TID : 49352 PROC : db2sysc 0
        INSTANCE: db2inst1 NODE : 000 DB : RIDDB2
        APPHDL : 0-57694 APPID: *LOCAL.db2inst1.110801091918
        AUTHID : CDCINST1
        EDUID : 49352 EDUNAME: db2agent (RIDDB2) 0
        FUNCTION: DB2 UDB, data protection services, sqlp_AsyncLogReadAPI, probe:210
        DATA #1 : String, 132 bytes
        Error: sqlcode -2657, rc 262144, hflag2LsnReuse 0
        action 1, startLSN 000000769C966801, endLSN 00000076D039E44A, logBufferSize 204800

        2011-07-30-05.00.34.216699+180 I149146247A181 LEVEL: Error
        PID:63242488 TID:44211 NODE:000 Title: SQLP_ALRCB
        Dump File:/home/db2inst1/sqllib/db2dump/63242488.44211.000.dump.bin

        2011-07-30-05.00.34.216921+180 I149146429A578 LEVEL: Error
        PID : 63242488 TID : 44211 PROC : db2sysc 0
        INSTANCE: db2inst1 NODE : 000 DB : RIDDB2
        APPHDL : 0-760 APPID: *LOCAL.db2inst1.110801113231
        AUTHID : CDCINST1
        EDUID : 44211 EDUNAME: db2agent (RIDDB2) 0
        FUNCTION: DB2 UDB, data protection services, sqlp_AsyncLogReadAPI, probe:210
        DATA #1 : String, 132 bytes
        Error: sqlcode -2657, rc 262144, hflag2LsnReuse 0
        action 1, startLSN 000000769E4060AB, endLSN 00000076D089C5C7, logBufferSize 204800


        but if i am not using "-p" switch for grep i get meaningless information:

        v7-p7-prod 11:29:56 zabbix:/home/zabbix$ tail -100000 /home/db2inst1/sqllib/db2dump/db2diag.log | grep Error
        2011-07-30-04.00.21.954691+180 I149135337A181 LEVEL: Error
        2011-07-30-04.00.21.955063+180 I149135519A578 LEVEL: Error

        and if i create zabbix (active) item:
        log["/home/db2inst1/sqllib/db2dump/db2diag.log","Error","UTF-8",100]

        i also get meaningless information that tells me "something is wrong there"
        but is not giving me a clue shat exactly is happening.

        how can i add "-P" flag for grep in zabbix (active) item ?

        Comment

        Working...