Installing Net-SNMP on Visual Studio 15 (Windows 10 64bit)












0















I'm new to SNMP but I want to use it to configure a wifi AP based on info given by a user. My issue is that I can't seem to properly install Net-SNMP on my Visual Studio project.



I've searched a lot but couldn't find a solution that works for me.



So far I've installed Net-SNMP 5.8 on my machine from the source-forge installer. I have an snmp folder in C:usr and in C:Program Filesnet-snmp-5.8. From the command prompt I can use SET / GET commands so that's working. I'm now trying to have Net-SNMP on Visual Studio so I can use commands from a script in my C++ project.



This is a simple script I found and modified to test Net-SNMP on VS.



#include <net-snmp/net-snmp-config.h> 
#include <net-snmp/net-snmp-includes.h>
#include <string.h>

std::string oiids = ".1.3.6.1.4.1.30429.1.3.2.1.0";
struct snmp_session session, *ss;
struct snmp_pdu *pdu;
struct snmp_pdu *response;
oid anOID[MAX_OID_LEN];
size_t anOID_len = MAX_OID_LEN;
// netsnmp_variable_list *vars;
int status;
init_snmp("APC Check");
snmp_sess_init(&session);
ss = snmp_open(&session);
session.peername = "192.168.1.253";
session.community = (u_char *) "private";
session.community_len = strlen("private");
session.version = SNMP_VERSION_2c;
ss = snmp_open(&session);
pdu = snmp_pdu_create(SNMP_MSG_GET);
read_objid(oiids.c_str(), anOID, &anOID_len);
snmp_add_null_var(pdu, anOID, anOID_len);
status = snmp_synch_response(ss, pdu, &response);
for (variable_list * vars = response->variables; vars; vars = vars->next_variable)
print_variable(vars->name, vars->name_length, vars);
if (response)
snmp_free_pdu(response);
snmp_close(ss);


I tried to add all the .h files to my project but now I'm getting missing functions because I don't think I have all the C source code. I'm ready to uninstall everything and start from scratch if someone has a solution.



Thanks for any help!



Note:



This is for a project I'm working on with different people using git. Would they all have to install Net-SNMP on their computer or is there a way to have all the necessary files in the project?










share|improve this question



























    0















    I'm new to SNMP but I want to use it to configure a wifi AP based on info given by a user. My issue is that I can't seem to properly install Net-SNMP on my Visual Studio project.



    I've searched a lot but couldn't find a solution that works for me.



    So far I've installed Net-SNMP 5.8 on my machine from the source-forge installer. I have an snmp folder in C:usr and in C:Program Filesnet-snmp-5.8. From the command prompt I can use SET / GET commands so that's working. I'm now trying to have Net-SNMP on Visual Studio so I can use commands from a script in my C++ project.



    This is a simple script I found and modified to test Net-SNMP on VS.



    #include <net-snmp/net-snmp-config.h> 
    #include <net-snmp/net-snmp-includes.h>
    #include <string.h>

    std::string oiids = ".1.3.6.1.4.1.30429.1.3.2.1.0";
    struct snmp_session session, *ss;
    struct snmp_pdu *pdu;
    struct snmp_pdu *response;
    oid anOID[MAX_OID_LEN];
    size_t anOID_len = MAX_OID_LEN;
    // netsnmp_variable_list *vars;
    int status;
    init_snmp("APC Check");
    snmp_sess_init(&session);
    ss = snmp_open(&session);
    session.peername = "192.168.1.253";
    session.community = (u_char *) "private";
    session.community_len = strlen("private");
    session.version = SNMP_VERSION_2c;
    ss = snmp_open(&session);
    pdu = snmp_pdu_create(SNMP_MSG_GET);
    read_objid(oiids.c_str(), anOID, &anOID_len);
    snmp_add_null_var(pdu, anOID, anOID_len);
    status = snmp_synch_response(ss, pdu, &response);
    for (variable_list * vars = response->variables; vars; vars = vars->next_variable)
    print_variable(vars->name, vars->name_length, vars);
    if (response)
    snmp_free_pdu(response);
    snmp_close(ss);


    I tried to add all the .h files to my project but now I'm getting missing functions because I don't think I have all the C source code. I'm ready to uninstall everything and start from scratch if someone has a solution.



    Thanks for any help!



    Note:



    This is for a project I'm working on with different people using git. Would they all have to install Net-SNMP on their computer or is there a way to have all the necessary files in the project?










    share|improve this question

























      0












      0








      0








      I'm new to SNMP but I want to use it to configure a wifi AP based on info given by a user. My issue is that I can't seem to properly install Net-SNMP on my Visual Studio project.



      I've searched a lot but couldn't find a solution that works for me.



      So far I've installed Net-SNMP 5.8 on my machine from the source-forge installer. I have an snmp folder in C:usr and in C:Program Filesnet-snmp-5.8. From the command prompt I can use SET / GET commands so that's working. I'm now trying to have Net-SNMP on Visual Studio so I can use commands from a script in my C++ project.



      This is a simple script I found and modified to test Net-SNMP on VS.



      #include <net-snmp/net-snmp-config.h> 
      #include <net-snmp/net-snmp-includes.h>
      #include <string.h>

      std::string oiids = ".1.3.6.1.4.1.30429.1.3.2.1.0";
      struct snmp_session session, *ss;
      struct snmp_pdu *pdu;
      struct snmp_pdu *response;
      oid anOID[MAX_OID_LEN];
      size_t anOID_len = MAX_OID_LEN;
      // netsnmp_variable_list *vars;
      int status;
      init_snmp("APC Check");
      snmp_sess_init(&session);
      ss = snmp_open(&session);
      session.peername = "192.168.1.253";
      session.community = (u_char *) "private";
      session.community_len = strlen("private");
      session.version = SNMP_VERSION_2c;
      ss = snmp_open(&session);
      pdu = snmp_pdu_create(SNMP_MSG_GET);
      read_objid(oiids.c_str(), anOID, &anOID_len);
      snmp_add_null_var(pdu, anOID, anOID_len);
      status = snmp_synch_response(ss, pdu, &response);
      for (variable_list * vars = response->variables; vars; vars = vars->next_variable)
      print_variable(vars->name, vars->name_length, vars);
      if (response)
      snmp_free_pdu(response);
      snmp_close(ss);


      I tried to add all the .h files to my project but now I'm getting missing functions because I don't think I have all the C source code. I'm ready to uninstall everything and start from scratch if someone has a solution.



      Thanks for any help!



      Note:



      This is for a project I'm working on with different people using git. Would they all have to install Net-SNMP on their computer or is there a way to have all the necessary files in the project?










      share|improve this question














      I'm new to SNMP but I want to use it to configure a wifi AP based on info given by a user. My issue is that I can't seem to properly install Net-SNMP on my Visual Studio project.



      I've searched a lot but couldn't find a solution that works for me.



      So far I've installed Net-SNMP 5.8 on my machine from the source-forge installer. I have an snmp folder in C:usr and in C:Program Filesnet-snmp-5.8. From the command prompt I can use SET / GET commands so that's working. I'm now trying to have Net-SNMP on Visual Studio so I can use commands from a script in my C++ project.



      This is a simple script I found and modified to test Net-SNMP on VS.



      #include <net-snmp/net-snmp-config.h> 
      #include <net-snmp/net-snmp-includes.h>
      #include <string.h>

      std::string oiids = ".1.3.6.1.4.1.30429.1.3.2.1.0";
      struct snmp_session session, *ss;
      struct snmp_pdu *pdu;
      struct snmp_pdu *response;
      oid anOID[MAX_OID_LEN];
      size_t anOID_len = MAX_OID_LEN;
      // netsnmp_variable_list *vars;
      int status;
      init_snmp("APC Check");
      snmp_sess_init(&session);
      ss = snmp_open(&session);
      session.peername = "192.168.1.253";
      session.community = (u_char *) "private";
      session.community_len = strlen("private");
      session.version = SNMP_VERSION_2c;
      ss = snmp_open(&session);
      pdu = snmp_pdu_create(SNMP_MSG_GET);
      read_objid(oiids.c_str(), anOID, &anOID_len);
      snmp_add_null_var(pdu, anOID, anOID_len);
      status = snmp_synch_response(ss, pdu, &response);
      for (variable_list * vars = response->variables; vars; vars = vars->next_variable)
      print_variable(vars->name, vars->name_length, vars);
      if (response)
      snmp_free_pdu(response);
      snmp_close(ss);


      I tried to add all the .h files to my project but now I'm getting missing functions because I don't think I have all the C source code. I'm ready to uninstall everything and start from scratch if someone has a solution.



      Thanks for any help!



      Note:



      This is for a project I'm working on with different people using git. Would they all have to install Net-SNMP on their computer or is there a way to have all the necessary files in the project?







      snmp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 31 at 16:50









      MortZMortZ

      11




      11






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400665%2finstalling-net-snmp-on-visual-studio-15-windows-10-64bit%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400665%2finstalling-net-snmp-on-visual-studio-15-windows-10-64bit%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Сан-Квентин

          8-я гвардейская общевойсковая армия

          Алькесар