How does snmpd process SNMP requests? -


I am new to the SNMP protocol. I would like to know how the SNMPP implementation of SNMP requests, for example:

  snmpget -v1 -c public localhost sysName   

I understand that this is implementing MIB, e.g. SNMPv2-MIB, but execution of uname -n ? See net-SNPP SNPP mapping for CISNAIIID OID for

that it sometimes < / Strong> is actually based on 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 * /   

To understand that 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

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -