1. Community Tip: Please Give Thanks to Those Sharing Their Knowledge.
    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.
  2. Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)
    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

Combine scripts

Discussion in 'Scripting' started by dicowins, May 5, 2017.

  1. dicowins

    dicowins ADSM.ORG Member

    Joined:
    Nov 8, 2002
    Messages:
    14
    Likes Received:
    0
    I have two sql statements

    select domain_name,schedule_name,count(*) from associations group by domain_name,schedule_name

    and

    select domain_name,schedule_name,action,sched_style,starttime,period,perunits,duration,durunits,dayofweek,enh_month,dayofmonth,weekofmonth,expiration from client_schedules

    So the first creates a unique list of Domeain names and schedules and calculates the No of nodes per schedule.

    I want to then fill in the unique values selected in the second sql line and add those details to the first list
     
  2.  
  3. marclant

    marclant ADSM.ORG Moderator

    Joined:
    Jun 16, 2006
    Messages:
    2,463
    Likes Received:
    346
    Occupation:
    Accelerated Value Specialist for Spectrum Protect
    Location:
    Canada
  4. StiffBoard

    StiffBoard ADSM.ORG Member

    Joined:
    Mar 1, 2014
    Messages:
    45
    Likes Received:
    3
    Inner join as mentioned...

    select client_schedules.domain_name, client_schedules.schedule_name, dayofweek, duration, count(associations.schedule_name) as Counts from client_schedules inner join associations on client_schedules.schedule_name = associations.schedule_name group by client_schedules.domain_name, client_schedules.schedule_name, dayofweek, duration

    Fill in the rest of the columns you need, both after select and after Group by.
     
  5. dicowins

    dicowins ADSM.ORG Member

    Joined:
    Nov 8, 2002
    Messages:
    14
    Likes Received:
    0
    Thank you very helpful
     
  6. Andrew21210

    Andrew21210 ADSM.ORG Member

    Joined:
    Apr 10, 2008
    Messages:
    82
    Likes Received:
    1
    This is a useful script. Is there a way to get the node names associated to a specific schedule that also includes the OS Platform per node?
     
  7. mlowe

    mlowe Newcomer

    Joined:
    Apr 10, 2017
    Messages:
    1
    Likes Received:
    0
    I use this It contains OS and Client level:
    select nodes.node_name,nodes.platform_name,nodes.client_version,nodes.client_release,nodes.client_level,nodes.client_sublevel from nodes,associations where associations.schedule_name = 'someschedulename' and nodes.node_name = associations.node_name
     
  8. dicowins

    dicowins ADSM.ORG Member

    Joined:
    Nov 8, 2002
    Messages:
    14
    Likes Received:
    0
    Thank you
     

Share This Page