Announcement

Collapse
No announcement yet.

Customib.c Set problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Customib.c Set problem

    Hi,

    I'm actually trying to use the customib.c example you propose.
    While i can read all the variable from mib Browser with their correct values i can't set any of them and i've got this error message:
    Set failed: information no access.
    The problem is that variable i'm trying to modify are read/write and a get request is working fine but not a set request.
    Did anybody get the same problem or any possible issue.
    Last edited by b.cayzergues; 06-26-2009, 08:45 AM.

  • #2
    nobody got problem with that because i really need to make the snmp set operation work and even with a custom mib i made on my own i've got the same problem.
    I tried to set a value with Getif (2.2 2.3.1) , MIB Browser and net-SNMP(with both Linux and windows XP) and i still got the same response: no access.

    In my MIB.text definition the variable is indicate as read-write and during the MIB creation i put the MIBOPT_W option which should allow set operation (if i understood correctly evolution_snmp.h).

    one more time i really need to make this work so i'll take all suggestions.

    Comment


    • #3
      Make sure you are using the correct community name for a set operation.

      Comment


      • #4
        I checked this already and i verified with wireshark content of messages and i observed that communties name are matching betweem the manager and the matchport.
        But every time i've got the same error no such name.

        this is my variable definition:

        static const MIBVAR mibVar[] =
        {
        {{11,{0x2b,6,1,4,1,0x87,0x5f,1,1,9,0}},
        MIBOPT_W+MIBOPT_CAW,
        SNMP_String, sizeof(sint32_t), &etat1},
        }

        i just made a chek programm to test if the value is correctly setted:

        static int mibSet2(
        int varix,
        const uint8_t *index, uint32_t indexLen,
        uint8_t *data
        )
        {
        char *buffer;

        buffer = MALLOC(100); /*Allocate memory*/

        snprintf(buffer,100,"ok");
        SerialWrite(0,buffer,strlen(buffer),true);
        Free(buffer);

        return 0;
        }
        and here is my mib definition
        MIB mib_ltrx =
        {
        mibVar,
        mibVarSize,
        NULL,
        NULL,
        NULL, /* mibget */
        NULL, /* mibset */
        mibSet2,
        NULL, /* mibindex */
        NULL,
        NULL,
        NULL, /* mibcheck */
        NULL,
        };
        and the main programm:
        int SDKMain(struct command_line *commandLine, struct http_server *server)
        {
        (void)commandLine; /* To avoid compiler warning for unused variables. */
        (void)server;

        /*Add personnal MIB*/
        SnmpMibHandlerRegister(&mib_ltrx_oid, &mib_ltrx);

        return 0;
        }

        Comment


        • #5
          Customib.c Set problem: noAccess

          I was getting the very same behavior.

          Using Net-SNMP:

          SNMP_GET was working fine.
          Sending aSNMP_SET value would return "Error in packet" and "Reason: noAccess".

          I had set Read Community and Write Community with the string "public" (same for both. That was my mistake.

          After setting a different value to Write Community, SNMP_SET is working fine!

          Comment

          Working...
          X