SNMP Subagent Programmer's Guide
Writing Subagent Logic
SNMP Subagent Programmer’s Guide—119728 4-9
Management Functions
mgmt_init_env()
The mgmt_init_env() function initializes the management environment. No other 
management functions can succeed until mgmt_init_env() completes successfully. 
mgmt-env
is a void pointer that you pass as the first argument to all subsequent management 
function calls.
process-name
is a pointer to the name of the NonStop agent process. A value of NULL assigns the 
default process name:  $ZSNMP on the local system.
me
is a pointer to an object identifier structure in the GDMOC output that defines the 
subagent. GDMOC names the structure by appending the name of your MIB to the 
string GI_. For example, the structure is assigned the following name in the case of 
the Hello World sample subagent:
GI_hello
desc
is a pointer to a character string describing the subagent. A value of NULL assigns 
the default description: Anonymous Entity.
password
is ignored.
idle
is ignored.
Entry Condition
The mgmt_init_env() function must be the first management function called by a 
subagent.
#include "mgmtpubh"
mgmt-env = mgmt_init_env(process-name, me, desc, password,
 idle);
void *
mgmt_init_env(process-name, me, desc, password, idle);
 char *process-name;
 ObjId_t *me;
 char *desc;
 Octets_t *password;
 void_function idle;"










