[AGENT++] how to send a set request to a table by using MIB Explorer Lite

Rajesh Bansal bansal.rajeshkr at gmail.com
Sat Feb 3 15:08:31 CET 2007


Thanks Frank,
now it is working. I want some more help i want to know how to generate
traps.Where i have to add logic in <MIBNAME>.cpp file so that on basis of
that logic my code can generate traps.
i have copy most parts of my MIB related to notification here i want to add
logic on basis of two integer variables testno and testno2. so plz tell me
where i have to change in code. and if there should be some changes in
agent.cpp then plz tell me these also.

testno OBJECT-TYPE
  SYNTAX  Integer32
  MAX-ACCESS read-write
  STATUS  current
  DESCRIPTION
    "hi"
  DEFVAL { 8 }
  -- 1.3.6.1.4.1.1.1.6
  ::= { testObjects 6 }


testno2 OBJECT-TYPE
  SYNTAX  Integer32
  MAX-ACCESS read-create
  STATUS  current
  DESCRIPTION ""
  DEFVAL { 9 }
  -- 1.3.6.1.4.1.1.1.7
  ::= { testObjects 7 }

-- Notification Types
--

testEvents OBJECT IDENTIFIER
  -- 1.3.6.1.4.1.1.2
  ::= { testRegMIB 2 }

-- Conformance
--

testConf OBJECT IDENTIFIER
  -- 1.3.6.1.4.1.1.3
  ::= { testRegMIB 3 }

-- Groups
--

testGroups OBJECT IDENTIFIER
  -- 1.3.6.1.4.1.1.3.1
  ::= { testConf 1 }


testNotif NOTIFICATION-TYPE
  OBJECTS {
    testno,
    testno2}
  STATUS  current
  DESCRIPTION
    ""
  -- 1.3.6.1.4.1.1.1.5
  ::= { testObjects 5 }

testBasicGroup OBJECT-GROUP
  OBJECTS {
    testno,
    testno2 }
  STATUS  current
  DESCRIPTION
    "Basic objects."
  -- 1.3.6.1.4.1.1.3.1.1
  ::= { testGroups 1 }

testBasicEvents NOTIFICATION-GROUP
  NOTIFICATIONS {
    testNotif }
  STATUS  current
  DESCRIPTION
    "Basic notifications."
  -- 1.3.6.1.4.1.1.3.1.2
  ::= { testGroups 2 }

Regards,
Rajesh Bansal

On 2/3/07, Frank Fock <fock at agentpp.com> wrote:
>
> Hi Rajesh,
>
> Your columns have MAX-ACCESS "read-write". So, if
> the row you are trying to set does not exists,
> you will have no chance to create it. That's what
> the agent tries to explain "unable to create object".
>
> Set maximum access to "read-create" for all modifiable
> columns and it will work.
>
> Best regards,
> Frank
>
> Rajesh Bansal wrote:
> > Hi Frank,
> > I have changed table definition but after this also i am not able to
> send a
> > set request to table .
> > i am trying to send following values
> > testEntryIndex   0 and 1
> > testEntryStatus   5 or any numeric +ve value
> > testEntryPortNo  6667 or any numeric +ve value
> >
> > MibExplorer gives following error "Unable to create Object "
> > and error no on agent secreen is "11"
> >
> > so plz suggest me that where is error.
> >
> >
> > one more thing i want to know how to communicate with agent from any C++
> > application on Linux Platform. I want to set values in agent from my C++
> > application , means i want to send SET request from my application. What
> > are
> > steps for this.
> >
> > Regards and Thanks,
> > RAjesh Bansal
> >
> > On 2/2/07, Frank Fock <fock at agentpp.com> wrote:
> >>
> >> Hi Rajesh,
> >>
> >> First, your table definition is problematic because
> >> the table's index is read-only (must be not-accessible).
> >>
> >> In order to be able to help you, we would need more
> >> information. What do you mean with "is not taking these
> >> values"? Who is not accepting which values?
> >>
> >> Best regards,
> >> Frank
> >>
> >> Rajesh Bansal wrote:
> >> > Hi all,
> >> > I have a table in MIB with following defination .
> >> >
> >> > testTable OBJECT-TYPE
> >> >  SYNTAX  SEQUENCE OF TestEntry
> >> >  MAX-ACCESS not-accessible
> >> >  STATUS  current
> >> >  DESCRIPTION ""
> >> >  -- 1.3.6.1.4.1.1.1.4
> >> >  ::= { testObjects 4 }
> >> >
> >> >
> >> > testEntry OBJECT-TYPE
> >> >  SYNTAX  TestEntry
> >> >  MAX-ACCESS not-accessible
> >> >  STATUS  current
> >> >  DESCRIPTION ""
> >> >  INDEX {
> >> >    testEntryIndex }
> >> >  -- 1.3.6.1.4.1.1.1.4.1
> >> >  ::= { testTable 1 }
> >> >
> >> >
> >> > TestEntry ::= SEQUENCE {
> >> >
> >> >  testEntryPortNo Integer32,
> >> >  testEntryStatus Integer32,
> >> >  testEntryIndex  Unsigned32 }
> >> >
> >> >
> >> > testEntryPortNo OBJECT-TYPE
> >> >  SYNTAX  Integer32
> >> >  MAX-ACCESS read-write
> >> >  STATUS  current
> >> >  DESCRIPTION ""
> >> >  DEFVAL { 0 }
> >> >  -- 1.3.6.1.4.1.1.1.4.1.1
> >> >  ::= { testEntry 1 }
> >> >
> >> >
> >> > testEntryStatus OBJECT-TYPE
> >> >  SYNTAX  Integer32
> >> >  MAX-ACCESS read-write
> >> >  STATUS  current
> >> >  DESCRIPTION ""
> >> >  -- 1.3.6.1.4.1.1.1.4.1.2
> >> >  ::= { testEntry 2 }
> >> >
> >> >
> >> > testEntryIndex OBJECT-TYPE
> >> >  SYNTAX  Unsigned32
> >> >  MAX-ACCESS read-only
> >> >  STATUS  current
> >> >  DESCRIPTION ""
> >> >  -- 1.3.6.1.4.1.1.1.4.1.3
> >> >  ::= { testEntry 3 }
> >> >
> >> >
> >> >
> >> > here testEntryIndex using as a index for this table. I am tring to
> send
> >> a
> >> > set request to this table from MIB Explorer Lite but it is not taking
> >> these
> >> > values so plz tell me that if i have to change something there.
> >> > _______________________________________________
> >> > AGENTPP mailing list
> >> > AGENTPP at agentpp.org
> >> > http://lists.agentpp.org/mailman/listinfo/agentpp
> >>
> >> --
> >> AGENT++
> >> http://www.agentpp.com
> >> http://www.mibexplorer.com
> >> http://www.mibdesigner.com
> >>
> >>
> > _______________________________________________
> > AGENTPP mailing list
> > AGENTPP at agentpp.org
> > http://lists.agentpp.org/mailman/listinfo/agentpp
>
> --
> AGENT++
> http://www.agentpp.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
>
>



More information about the AGENTPP mailing list