<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how can I get the node name in a vms cluster using c program? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878829#M34953</link>
    <description>I didn't think that a VMS cluster had a&lt;BR /&gt;"master" computer.  Why do you think that it&lt;BR /&gt;has one?&lt;BR /&gt;&lt;BR /&gt;You can use sys$getsyi() to get some&lt;BR /&gt;cluster-related data.  See, for example:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/doc/732FINAL/4527/4527pro_005.html#jun_312" target="_blank"&gt;http://h71000.www7.hp.com/doc/732FINAL/4527/4527pro_005.html#jun_312&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Getting _the_ IP address may be more&lt;BR /&gt;complicated, as a node may have more than&lt;BR /&gt;one, and the cluster node name may not be&lt;BR /&gt;related to the IP host name (although they&lt;BR /&gt;are normally related).&lt;BR /&gt;&lt;BR /&gt;Is there some problem which you are trying&lt;BR /&gt;to solve?&lt;BR /&gt;</description>
    <pubDate>Wed, 11 Oct 2006 23:28:14 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2006-10-11T23:28:14Z</dc:date>
    <item>
      <title>how can I get the node name in a vms cluster using c program?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878828#M34952</link>
      <description>There are two alpha computer in my cluster,and I want to get the master computer's node name and tcp/ip address in the vms cluster,are there any sys$ or lib$ function that can be called by c program?</description>
      <pubDate>Wed, 11 Oct 2006 23:01:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878828#M34952</guid>
      <dc:creator>likuair_1</dc:creator>
      <dc:date>2006-10-11T23:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the node name in a vms cluster using c program?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878829#M34953</link>
      <description>I didn't think that a VMS cluster had a&lt;BR /&gt;"master" computer.  Why do you think that it&lt;BR /&gt;has one?&lt;BR /&gt;&lt;BR /&gt;You can use sys$getsyi() to get some&lt;BR /&gt;cluster-related data.  See, for example:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/doc/732FINAL/4527/4527pro_005.html#jun_312" target="_blank"&gt;http://h71000.www7.hp.com/doc/732FINAL/4527/4527pro_005.html#jun_312&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Getting _the_ IP address may be more&lt;BR /&gt;complicated, as a node may have more than&lt;BR /&gt;one, and the cluster node name may not be&lt;BR /&gt;related to the IP host name (although they&lt;BR /&gt;are normally related).&lt;BR /&gt;&lt;BR /&gt;Is there some problem which you are trying&lt;BR /&gt;to solve?&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Oct 2006 23:28:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878829#M34953</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-11T23:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the node name in a vms cluster using c program?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878830#M34954</link>
      <description>My way is to link against the exec. Something like this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  $ cc node_name&lt;BR /&gt;  $ link/sysexe node_name&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;#include &lt;SSDEF.H&gt;&lt;BR /&gt;#include &lt;STARLET.H&gt;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;**  External data storage references.&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;extern unsigned int SCS$GB_NODENAME;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;        char nodename[6];&lt;BR /&gt;&lt;BR /&gt;    strncpy(nodename,(char * ) &amp;amp;SCS$GB_NODENAME,6);&lt;BR /&gt;    nodename[5] = '\0'; /* Terminate the string */&lt;BR /&gt;&lt;BR /&gt;        printf("%s \n",nodename);&lt;BR /&gt;&lt;BR /&gt;}/*main*/&lt;BR /&gt;&lt;BR /&gt;&lt;/STARLET.H&gt;&lt;/SSDEF.H&gt;</description>
      <pubDate>Wed, 11 Oct 2006 23:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878830#M34954</guid>
      <dc:creator>Thomas Ritter</dc:creator>
      <dc:date>2006-10-11T23:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the node name in a vms cluster using c program?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878831#M34955</link>
      <description>&lt;!--!*#--&gt;Or, if you're really desperate for amusement:&lt;BR /&gt;&lt;BR /&gt;alp $ type clu.c&lt;BR /&gt;/* 2006-10-12 SMS.&lt;BR /&gt; * Cluster node info demo.&lt;BR /&gt; */&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;SSDEF.H&gt;&lt;BR /&gt;#include &lt;STARLET.H&gt;&lt;BR /&gt;#include &lt;STSDEF.H&gt;&lt;BR /&gt;#include &lt;SYIDEF.H&gt;&lt;BR /&gt;&lt;BR /&gt;/* GETxxx item descriptor structure. */&lt;BR /&gt;typedef struct&lt;BR /&gt;        {&lt;BR /&gt;        short buf_len;&lt;BR /&gt;        short itm_cod;&lt;BR /&gt;        void *buf;&lt;BR /&gt;        int *ret_len;&lt;BR /&gt;        } xxx_item_t;&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;    int csi;&lt;BR /&gt;    int sts;&lt;BR /&gt;    char *p;&lt;BR /&gt;&lt;BR /&gt;    /* Storage for data returned by sys$getsyi(). */&lt;BR /&gt;    static int buf_nn_used;&lt;BR /&gt;    static char buf_nn[ 9];&lt;BR /&gt;    static int buf_hw_used;&lt;BR /&gt;    static char buf_hw[ 61];&lt;BR /&gt;    static int csid;&lt;BR /&gt;&lt;BR /&gt;    /* Item list structure to get various cluster data using sys$getsyi(). */&lt;BR /&gt;    struct&lt;BR /&gt;    {&lt;BR /&gt;        xxx_item_t syi_scsnode_itm;     /* SCS node name. */&lt;BR /&gt;        xxx_item_t syi_hw_name_itm;     /* Hardware model name. */&lt;BR /&gt;        xxx_item_t syi_node_csid_itm;   /* Cluster system ID. */&lt;BR /&gt;        int term;&lt;BR /&gt;    } syi_itm_lst =&lt;BR /&gt;     { { sizeof buf_nn, SYI$_SCSNODE, &amp;amp;buf_nn, &amp;amp;buf_nn_used },&lt;BR /&gt;       { sizeof buf_hw, SYI$_HW_NAME, &amp;amp;buf_hw, &amp;amp;buf_hw_used },&lt;BR /&gt;       { sizeof buf_hw, SYI$_NODE_CSID, &amp;amp;csid, NULL },&lt;BR /&gt;       0&lt;BR /&gt;     };&lt;BR /&gt;&lt;BR /&gt;    csi = -1;                    /* Cluster ID wildcard. */&lt;BR /&gt;&lt;BR /&gt;    for (sts = SS$_NORMAL; sts == SS$_NORMAL; )&lt;BR /&gt;    {&lt;BR /&gt;        sts = sys$getsyiw( 0,               /* Event flag. */&lt;BR /&gt;                           &amp;amp;csi,            /* Cluster system ID. */&lt;BR /&gt;                           NULL,            /* Node name (not used). */&lt;BR /&gt;                           &amp;amp;syi_itm_lst,    /* Ilem list. */&lt;BR /&gt;                           0,               /* IOSB (not used). */&lt;BR /&gt;                           0,               /* AST address (not used). */&lt;BR /&gt;                           0);              /* AST parameter (not used). */&lt;BR /&gt;&lt;BR /&gt;        if ((sts&amp;amp; STS$M_SEVERITY) == STS$K_SUCCESS)&lt;BR /&gt;        {&lt;BR /&gt;            /* NUL-terminate the SCS name, and trim any trailing spaces. */&lt;BR /&gt;            buf_nn[ buf_nn_used] = '\0';&lt;BR /&gt;            if ((p = strchr( buf_nn, ' ')) != NULL)&lt;BR /&gt;                *p = '\0';&lt;BR /&gt;&lt;BR /&gt;            /* NUL-terminate the hw name. */&lt;BR /&gt;            buf_hw[ buf_hw_used] = '\0';&lt;BR /&gt;&lt;BR /&gt;            /* Print the results. */&lt;BR /&gt;            printf( " &amp;gt;%s&amp;lt; %.*s&amp;gt;%s&amp;lt; %%x%08x.\n",&lt;BR /&gt;             buf_nn, (8- strlen( buf_nn)), "        ", buf_hw, csid);&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;alp $ cc clu&lt;BR /&gt;alp $ link clu&lt;BR /&gt;alp $ run clu&lt;BR /&gt; &amp;gt;ALP&amp;lt;      &amp;gt;COMPAQ Professional Workstation XP1000&amp;lt; %x00010001.&lt;BR /&gt; &amp;gt;ALP2&amp;lt;     &amp;gt;COMPAQ Professional Workstation XP1000&amp;lt; %x00010006.&lt;BR /&gt;alp $&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Of course, the IP data are not available&lt;BR /&gt;here.&lt;/SYIDEF.H&gt;&lt;/STSDEF.H&gt;&lt;/STARLET.H&gt;&lt;/SSDEF.H&gt;&lt;/STRING.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Thu, 12 Oct 2006 00:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878831#M34955</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-12T00:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the node name in a vms cluster using c program?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878832#M34956</link>
      <description>likuair,&lt;BR /&gt;&lt;BR /&gt;if by "master node", you mean "founding node", you might even get info about a node that long ago left the cluster...&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Sat, 14 Oct 2006 06:21:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878832#M34956</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2006-10-14T06:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: how can I get the node name in a vms cluster using c program?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878833#M34957</link>
      <description>likuair,&lt;BR /&gt;&lt;BR /&gt;I would strongly recommend the use of the system services to obtain the information.&lt;BR /&gt;&lt;BR /&gt;Using the system services almost guarantees that your program will run against multiple releases of the system.&lt;BR /&gt;&lt;BR /&gt;Programs that directly access the executive and its data structures will require re-linking on upgrades. This is a serious drawback, particularly when the information is available in a completely release independent way.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Sat, 14 Oct 2006 07:21:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-can-i-get-the-node-name-in-a-vms-cluster-using-c-program/m-p/3878833#M34957</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2006-10-14T07:21:20Z</dc:date>
    </item>
  </channel>
</rss>

