The cl_getcluster returns information about the
cluster specified by the cluster ID.
Syntax
int cl_getcluster (int clusterid, struct cl_cluster *clusterbuf)
Parameters
| Item |
Description |
| clusterid |
The cluster ID of the desired cluster. |
| clusterbuf |
Storage for the returned cluster information. |
Status codes
| Item |
Description |
| CLE_OK |
The request completed successfully. |
| CLE_SYSERR |
System error. Check the AIX® global
variable errno for additional information. |
| CLE_BADARGS |
Missing or invalid parameters. |
| CLE_IVCLUSTERID |
The request specified an invalid cluster ID. |
Example
int clusterid = 1113325332;
int status;
struct cl_cluster cluster;
status = cl_getcluster(clusterid, &cluster);
if (status != CLE_OK) {
cl_perror(status, "Can't get cluster information");
} else {
printf("cluster id:
printf("cluster name:
printf("state= %d [%s]\n",
cluster.clc_state,
get_state(cluster.clc_state));
printf("substate=
printf("primary= <
printf("nodes= %d, sites= %d, groups= %d, networks= %d\n",
cluster.clc_number_of_nodes,
cluster.clc_number_of_sites,
cluster.clc_number_of_groups,
cluster.clc_number_of_networks);
}