IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 4 replies
  • Latest Post - ‏2013-04-18T09:12:32Z by iLorenz
iLorenz
iLorenz
3 Posts

Pinned topic Get computer IDS from a name list

‏2013-04-05T14:53:00Z |
Hi
..using the Session Relevance Tester,I'm banging my head trying to find the solution to a 'simple' question:
I have a list of computers (a plural string) and I need to have their IDs.

the following pseudo-code exemplificates the problem:
(names of it) of (bes computers whose (name of it = ("computerA";"computerB"))

I've experimented usings "sets of", but again, while it is trivial to get the ID of a single computer given its name, I've been unable to do so for multiple names/lists of names)

Any help is greatly appreciated :)
Thanks
Updated on 2013-04-05T16:04:17Z at 2013-04-05T16:04:17Z by Lee Wei
  • Lee Wei
    Lee Wei
    598 Posts

    Re: Get computer IDS from a name list

    ‏2013-04-05T15:06:51Z  
    Here are 2 examples for you.
    If you have many, the 2nd form might look tighter.

    
    ids of bes computers whose (name of it = 
    "computerA" or name of it = 
    "computerB")   ids of bes computers whose (
    "|" & name of it & 
    "|" is contained by 
    "|computerA|computerB|")
    


    For the 2nd form, the reason we put "|" around the name is to avoid partial match. For example, without the "|", computerA would have been a match for the following:

    
    ids of bes computers whose (name of it is contained by 
    "|computerABC|computerB|")
    


    Lee Wei
  • iLorenz
    iLorenz
    3 Posts

    Re: Get computer IDS from a name list

    ‏2013-04-05T15:51:21Z  
    • Lee Wei
    • ‏2013-04-05T15:06:51Z
    Here are 2 examples for you.
    If you have many, the 2nd form might look tighter.

    <pre class="jive-pre"> ids of bes computers whose (name of it = "computerA" or name of it = "computerB") ids of bes computers whose ( "|" & name of it & "|" is contained by "|computerA|computerB|") </pre>

    For the 2nd form, the reason we put "|" around the name is to avoid partial match. For example, without the "|", computerA would have been a match for the following:

    <pre class="jive-pre"> ids of bes computers whose (name of it is contained by "|computerABC|computerB|") </pre>

    Lee Wei
    Thanks for the fast reply Lee!

    I've tried your soluntion and surely it works.. but only if the list is short.
    In our enviroment the list seems to be too long to be effective; our complete code is:

    
    (ids of it) of bes computers whose ( name of it is contained by ( concatenation 
    "|" of ( unique values of ( (preceding text of first 
    "." of it|preceding text of first 
    ":" of it) of relay server of computer of it) of results of bes actions whose ( ID of it = 145145 ) ) ) )
    


    (please excuse the poor indentation but the form seems a bit trobulesome on Chrome)

    The 'concatenation "|"' consists of more than 5 thousands hostnames (witch could go up as high as 90k).. so the code above just takes ages (and eventually times out)

    [btw, the :
    (preceding text of first "." of it|preceding text of first ":" of it) of relay server of computer of it

    syntax if needed because some of our relay do report with the
    hostname:port
    syntax and the others do report as
    hostname.fqdn:port

    so we just extract the hostname this way]
  • Lee Wei
    Lee Wei
    598 Posts

    Re: Get computer IDS from a name list

    ‏2013-04-05T16:04:17Z  
    • iLorenz
    • ‏2013-04-05T15:51:21Z
    Thanks for the fast reply Lee!

    I've tried your soluntion and surely it works.. but only if the list is short.
    In our enviroment the list seems to be too long to be effective; our complete code is:

    <pre class="jive-pre"> (ids of it) of bes computers whose ( name of it is contained by ( concatenation "|" of ( unique values of ( (preceding text of first "." of it|preceding text of first ":" of it) of relay server of computer of it) of results of bes actions whose ( ID of it = 145145 ) ) ) ) </pre>

    (please excuse the poor indentation but the form seems a bit trobulesome on Chrome)

    The 'concatenation "|"' consists of more than 5 thousands hostnames (witch could go up as high as 90k).. so the code above just takes ages (and eventually times out)

    [btw, the :
    (preceding text of first "." of it|preceding text of first ":" of it) of relay server of computer of it

    syntax if needed because some of our relay do report with the
    hostname:port
    syntax and the others do report as
    hostname.fqdn:port

    so we just extract the hostname this way]
    In you are using the Session Relevance Tester, it defaults to timing out after 60 seconds I believe.
    In the 2nd tab "Configuration", you can set to not time out.

    Since you have a more involved use case, you might want to work with someone to figure out what is the end goal.
    I cannot tell from the statement what we are trying to accomplish, and if there is a different way to get there.

    Lee Wei
  • iLorenz
    iLorenz
    3 Posts

    Re: Get computer IDS from a name list

    ‏2013-04-18T09:12:32Z  
    • Lee Wei
    • ‏2013-04-05T16:04:17Z
    In you are using the Session Relevance Tester, it defaults to timing out after 60 seconds I believe.
    In the 2nd tab "Configuration", you can set to not time out.

    Since you have a more involved use case, you might want to work with someone to figure out what is the end goal.
    I cannot tell from the statement what we are trying to accomplish, and if there is a different way to get there.

    Lee Wei

    Thanks Lee

    Yes, we're aware of the timeout setting, but even with 30 minutes that relevance does not complete given the high number of clients we have.

    Thanks to Brian Green tho,  we now have a working solution in place. I'm posting it here should it be of use to other people:

    (id of it) of items 1 of (set of (

                                       (preceding text of first "." of it|preceding text of first ":" of it) of
                                             relay servers of computer of it) of
                                                   results of bes actions whose (
                                                         ID of it = 147132
                                                   )
                ,bes computers ) whose ( item 0 of it contains name of item 1 of it )

    Updated on 2013-04-18T09:16:48Z at 2013-04-18T09:16:48Z by iLorenz