How does snmpd process SNMP requests? -
I am new to the SNMP protocol. I would like to know how the I understand that this is implementing MIB, e.g. SNMPv2-MIB, but execution of that it sometimes < / Strong> is actually based on To understand that SNMPP implementation of SNMP requests, for example:
snmpget -v1 -c public localhost sysName
uname -n ? See net-SNPP SNPP mapping for CISNAIIID OID for
uname , see the code snippet below:
# Ifdef HAVE_GETHOSTNAME gethostname (sysName, sizeof (sysName)); #else #ifdef HAVE_UNAME strlcpy (sysName, utsName.nodename, sizeof (sysName)); #ElS #if Defined (HAVE_EXECV) & amp; Amp; ! Defined (mingw32) sprintf (extmp.command, "% s -n", UNAMEPROG); / * * Setup error * / extmp.type = EXECPROC; Extmp.next = NULL; Exec_command (& amp; extmp); strlcpy (sysName, extmp.output, sizeof (sysName)); If (stren (sysName)> gt1 = 1) sysName [strlen (sysName) - 1] = 0; / * chomp new line * / #else strcpy (sysName, "unknown"); #endif / * HAVE_EXECV * / #endif/ * HAVE_UNAME * / #endif/ * HAVE_GETHOSTNAME * /
SNMPP works internally Looks at the page on the net -snmp site it's detailed and also explains how to expand the Net-SNP with new MIBs.
Comments
Post a Comment