1. Please help support our sponsors by considering their products and services.
    Our sponsors enable us to maintain high-speed Internet connection and fast webservers.
    They support this free information and knowledge exchange forum service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions

Combine scripts

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

  1. dicowins

    dicowins ADSM.ORG Member

    Joined:
    Nov 8, 2002
    Messages:
    17
    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,607
    Likes Received:
    370
    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:
    17
    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:
    17
    Likes Received:
    0
    Thank you
     

Share This Page