- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - OpenVMS
- >
- how can I get the node name in a vms cluster using...
-
- Forums
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- OEM Solutions
- Servers: The Right Compute
- Shifting to Software-Defined
- Telecom IQ
- Transforming IT
- Infrastructure Solutions German
- L’Avenir de l’IT
- IT e Trasformazione Digitale
- Enterprise Topics
- ИТ для нового стиля бизнеса
- Blogs
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Forums
-
Blogs
-
InformationEnglish
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-11-2006 04:01 PM
10-11-2006 04:01 PM
how can I get the node name in a vms cluster using c program?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-11-2006 04:28 PM
10-11-2006 04:28 PM
Re: how can I get the node name in a vms cluster using c program?
"master" computer. Why do you think that it
has one?
You can use sys$getsyi() to get some
cluster-related data. See, for example:
http://h71000.www7.hp.com/doc/732FINAL/4527/4527pro_005.html#jun_312
Getting _the_ IP address may be more
complicated, as a node may have more than
one, and the cluster node name may not be
related to the IP host name (although they
are normally related).
Is there some problem which you are trying
to solve?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-11-2006 04:31 PM
10-11-2006 04:31 PM
Re: how can I get the node name in a vms cluster using c program?
$ cc node_name
$ link/sysexe node_name
*/
#include
#include
/*
** External data storage references.
*/
extern unsigned int SCS$GB_NODENAME;
int main()
{
char nodename[6];
strncpy(nodename,(char * ) &SCS$GB_NODENAME,6);
nodename[5] = '\0'; /* Terminate the string */
printf("%s \n",nodename);
}/*main*/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-11-2006 05:43 PM
10-11-2006 05:43 PM
Re: how can I get the node name in a vms cluster using c program?
alp $ type clu.c
/* 2006-10-12 SMS.
* Cluster node info demo.
*/
#include
#include
#include
#include
#include
#include
/* GETxxx item descriptor structure. */
typedef struct
{
short buf_len;
short itm_cod;
void *buf;
int *ret_len;
} xxx_item_t;
main()
{
int csi;
int sts;
char *p;
/* Storage for data returned by sys$getsyi(). */
static int buf_nn_used;
static char buf_nn[ 9];
static int buf_hw_used;
static char buf_hw[ 61];
static int csid;
/* Item list structure to get various cluster data using sys$getsyi(). */
struct
{
xxx_item_t syi_scsnode_itm; /* SCS node name. */
xxx_item_t syi_hw_name_itm; /* Hardware model name. */
xxx_item_t syi_node_csid_itm; /* Cluster system ID. */
int term;
} syi_itm_lst =
{ { sizeof buf_nn, SYI$_SCSNODE, &buf_nn, &buf_nn_used },
{ sizeof buf_hw, SYI$_HW_NAME, &buf_hw, &buf_hw_used },
{ sizeof buf_hw, SYI$_NODE_CSID, &csid, NULL },
0
};
csi = -1; /* Cluster ID wildcard. */
for (sts = SS$_NORMAL; sts == SS$_NORMAL; )
{
sts = sys$getsyiw( 0, /* Event flag. */
&csi, /* Cluster system ID. */
NULL, /* Node name (not used). */
&syi_itm_lst, /* Ilem list. */
0, /* IOSB (not used). */
0, /* AST address (not used). */
0); /* AST parameter (not used). */
if ((sts& STS$M_SEVERITY) == STS$K_SUCCESS)
{
/* NUL-terminate the SCS name, and trim any trailing spaces. */
buf_nn[ buf_nn_used] = '\0';
if ((p = strchr( buf_nn, ' ')) != NULL)
*p = '\0';
/* NUL-terminate the hw name. */
buf_hw[ buf_hw_used] = '\0';
/* Print the results. */
printf( " >%s< %.*s>%s< %%x%08x.\n",
buf_nn, (8- strlen( buf_nn)), " ", buf_hw, csid);
}
}
}
alp $ cc clu
alp $ link clu
alp $ run clu
>ALP< >COMPAQ Professional Workstation XP1000< %x00010001.
>ALP2< >COMPAQ Professional Workstation XP1000< %x00010006.
alp $
Of course, the IP data are not available
here.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-13-2006 11:21 PM
10-13-2006 11:21 PM
Re: how can I get the node name in a vms cluster using c program?
if by "master node", you mean "founding node", you might even get info about a node that long ago left the cluster...
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-14-2006 12:21 AM
10-14-2006 12:21 AM
Re: how can I get the node name in a vms cluster using c program?
I would strongly recommend the use of the system services to obtain the information.
Using the system services almost guarantees that your program will run against multiple releases of the system.
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.
- Bob Gezelter, http://www.rlgsc.com
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2019 Hewlett Packard Enterprise Development LP