Results 1 to 8 of 8
  1. #1
    Newcomer
    Join Date
    Feb 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need an 'Q EVENT' script that can use a file for the 'nodes' option

    For example, I can run a select to show me a list of nodes that have a common contact:

    select node_name from nodes where contact like 'Windows_Group%'

    But then I want to run a query event log to show a list of missed/failed for the nodes that were reported from the select statement above. Such as:

    q ev * * node=(INPUT_FILE) begind=-1 begint=17:00 endd=today endt=now ex=yes

    Please let me know if I am being to vague.

    Thanks in advance,

    Don

  2. #2
    Senior Member
    Join Date
    Dec 2004
    Location
    NC
    Posts
    200
    Thanks
    0
    Thanked 12 Times in 11 Posts

    Default

    You can't specify a file but you can use a comma delimited list of nodes.

    q eve * * node=NODE1,NODE2,NODE3,...,NODEN ....
    "If we knew what it was we were doing, it would not be called research, would it?" -- Albert Einstein

  3. #3
    Newcomer
    Join Date
    Feb 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Problem is the list is HUGE. The only other way I thought of was either splitting into separate schedules within the same domain.

  4. #4
    Moderator chad_small's Avatar
    Join Date
    Dec 2002
    Location
    Gilbert, AZ
    Posts
    2,194
    Thanks
    1
    Thanked 26 Times in 25 Posts

    Default

    You would have to change your query into a select statement. I gathered the last 10 days in the following script, just change the days to what you need.

    If you want just missed/failed/pending then use:

    select -
    schedule_name, -
    cast(SUBSTR(CHAR(actual_start),12, as char() AS START, -
    node_name, -
    cast(status as char(10)) as "STATUS", -
    cast(result as char(7)) as "RESULT" -
    from EVENTS -
    where scheduled_start>(CURRENT TIMESTAMP - 10 DAYS) -
    and STATUS not in ('Completed','Future') -
    and node_name in (select node_name from nodes -
    where contact like 'Windows_Group%')


    This is an example returning all results:

    select -
    schedule_name, -
    cast(SUBSTR(CHAR(actual_start),12, as char() AS START, -
    node_name, -
    cast(status as char(10)) as "STATUS", -
    case -
    when result=0 then ' 0-Succ' -
    when result=4 then ' 4-SkFi' -
    when result=8 then ' 8-Warn' -
    when result=12 then '12-Errs' -
    else cast(result as char(7)) -
    end -
    as "RESULT" -
    from events -
    where scheduled_start>(CURRENT TIMESTAMP - 10 DAYS) -
    and node_name in (select node_name from nodes -
    where contact like 'Windows_Group%')

    If you are seeing a smiley in the syntax it represents an eight followed by )
    Last edited by chad_small; 07-31-2012 at 12:14 PM.
    Chad Small
    IBM Certified Deployment Professional
    chadsmal@gmail.com
    http://www.tsmadmin.com

  5. #5
    Newcomer
    Join Date
    Feb 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What are the red smily faces supposed to be?

  6. #6
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,934
    Thanks
    4
    Thanked 233 Times in 228 Posts

    Default

    Quote Originally Posted by dhipp View Post
    What are the red smily faces supposed to be?
    See the last line on Chad's post!
    Ed

  7. #7
    Newcomer
    Join Date
    Feb 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yea, just caught that... Did get the following:

    tsm: TSMZWEI>select schedule_name cast(SUBSTR(CHAR(actual_start),12, as char() AS START,node_name, cast(status as char(10)) as "STATUS", case when result=0 then ' 0-Succ' hen result=4 then ' 4-SkFi' when result=8 then ' 8-Warn' when result=12 then '12-Errs' else cast(result as char(7)) end as "RESULT" from events where start_time>(CURRENT TIMESTAMP - 10 DAYS) and node_name in (select node_name from nodes where contact like 'sea%')
    ANR0162W Supplemental database diagnostic information: -1:42601:-104 ([IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An
    unexpected token "(" was found following "t schedule_name cast". Expected tokens may include: ",". SQLSTATE=42601
    ).

  8. #8
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,934
    Thanks
    4
    Thanked 233 Times in 228 Posts

    Default

    Should be for the two select statements:

    Code:
    schedule_name, - 
    cast(SUBSTR(CHAR(actual_start),12,8) as char(8)) AS START, - 
    node_name, -
    cast(status as char(10)) as "STATUS", -
    cast(result as char(7)) as "RESULT" -
    from EVENTS -
    where scheduled_start>(CURRENT TIMESTAMP - 10 DAYS) -
    and STATUS not in ('Completed','Future') -
    and node_name in (select node_name from nodes - 
    where contact like 'Windows_Group%')
    
    
    This is an example returning all results:
    
    select - 
    schedule_name, - 
    cast(SUBSTR(CHAR(actual_start),12,8) as char(8)) AS START, - 
    node_name, - 
    cast(status as char(10)) as "STATUS", - 
    case - 
    when result=0 then ' 0-Succ' - 
    when result=4 then ' 4-SkFi' - 
    when result=8 then ' 8-Warn' - 
    when result=12 then '12-Errs' - 
    else cast(result as char(7)) - 
    end - 
    as "RESULT" - 
    from events - 
    where scheduled_start>(CURRENT TIMESTAMP - 10 DAYS) - 
    and node_name in (select node_name from nodes - 
    where contact like 'Windows_Group%')
    Ed

Similar Threads

  1. Replies: 3
    Last Post: 12-05-2007, 01:09 PM
  2. option file
    By click007 in forum ISC -Integrated Solution Console
    Replies: 1
    Last Post: 09-14-2007, 11:39 AM
  3. Option sets and Nodes creating them selves
    By Rick111 in forum Backup / Archive Discussion
    Replies: 5
    Last Post: 12-06-2005, 04:38 AM
  4. Replies: 2
    Last Post: 11-11-2004, 08:28 AM
  5. dsm.opt - can't find option for the CLI Command : backup event entire
    By Tom in forum Backup / Archive Discussion
    Replies: 0
    Last Post: 03-12-2003, 09:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •