HP StorageWorks MSA 2/8 HP StorageWorks Fabric Watch V3.1.x/4.1.x User Guide ( - Page 231
Sample Script
View all HP StorageWorks MSA 2/8 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 231 highlights
Sample API Script Sample Script /* FabricWatchExample.c*/ /* C Library Headers */ #include /* standard io function library */ #include /* string functions */ #include /* for malloc() and exit()*/ /* HP API Library Headers */ #include "hapi.h" #include "hapiattr.h" int main(int argc, char **argv) { int fwArea,fwClass,fwIndex,i,ch,str_len; char buf[32]; OID_t switchOID,classAreaOID,threshEntryOID,FabOID; char *addr_string=NULL; AddrType *ipaddress=NULL; FabricIdentitiesType *fab_id_p=(FabricIdentitiesType *)NULL; ObjTypeFWClassArea *obj_fw_ca=(ObjTypeFWClassArea *)NULL; ObjTypeFWThresholdEntry *obj_fw_te=(ObjTypeFWThresholdEntry *)NULL; ObjTypeFabric *fab_obj_p=(ObjTypeFabric *)NULL; ipaddress = (AddrType *)malloc(sizeof(AddrType)*(1+1)); printf("IP Address: "); fflush(stdin); for( i = 0; (i < 32) && ((ch = getchar()) != EOF) && (ch != '\n'); i++ ) buf[i] = (char)ch; buf[i] = '\0'; str_len = strlen(buf) + 1; Fabric Watch Version 3.1.x/4.1.x User Guide 231