![background image](http://html.mh-extra.com/html/hp/t9576g06/t9576g06_management-manual_2175294561.webp)
Trap Multiplexer Subagent/Manager
SNMP Configuration and Management Manual — 424777-006
12 -69
Application Source Code
/* Open the new process to pass this startup message */
ccval = FILE_OPEN_(proc_name, /* file name */ <-- 43
proc_len, /* length */
&distr); /* file number */
if (ccval)
{
printf ("FILE_OPEN_ returned %d\n", ccval);
exit (1);
}
/* Add "TYPE CONSUMER" to startup msg to send to EMSDIST */
strcat (ci_startup.param, "TYPE CONSUMER"); <-- 44
/* Now write the startup struct */
ccval = WRITEREADX (distr, /* file number */
(char*)&ci_startup, /* buffer */
(short)(sizeof(startup_msg_type) /* write-count */
- sizeof(ci_startup.param)
+ strlen ("TYPE CONSUMER") + 1),
0); /* read-count */
FILE_GETINFO_ (distr, (short*)&error);
if ( ! ( error == 0 || error == 70 ))
{
printf ("WRITEREADX returned error: %d\n", error);
exit (1);
}
/* We can now close the distributor */
FILE_CLOSE_ (distr); <-- 45
/* Prepare to reopen the distributor using spi-interface */
proc_name[proc_len] = '\0';
strcat (proc_name, ".#ZSPI");
ccval = FILE_OPEN_(proc_name, /* file name */
(short)(pstrlen(".#ZSPI")), /* length */
(short*)&distr); /* file number */
if (ccval)
{
printf ("FILE_OPEN_ returned : %d\n", ccval);
exit(1);
}
/* Tell collector to use log files as event-message source */
spi_cmd_set_source (spi_buf, coll_name_Cxx, distr); <-- 46
/* Load filter and filter parameters into the distributor */
spi_cmd_load_filter (spi_buf, filt_name_Cxx, distr); <-- 47
/* start collecting the EMS events */
getevent_loop (spi_buf, distr); <-- 48
/* close the distributor */
FILE_CLOSE_ (distr);
} /* main */
Example 12-3. Sample Application Source Code
(page 14 of 14)
Summary of Contents for T9576G06
Page 24: ...Contents SNMP Configuration and Management Manual 424777 006 xxii Tables continued ...
Page 38: ...Part I Installing and Configuring SNMP SNMP Configuration and Management Manual 424777 006 ...
Page 140: ...Part II SCF for the SNMP Agent SNMP Configuration and Management Manual 424777 006 ...
Page 208: ...Part III Troubleshooting SNMP Configuration and Management Manual 424777 006 ...
Page 230: ...Part IV SNMP Subagents SNMP Configuration and Management Manual 424777 006 ...
Page 704: ...Part V Appendices SNMP Configuration and Management Manual 424777 006 ...
Page 778: ...Index SNMP Configuration and Management Manual 424777 006 Index 32 Special Characters ...