[AGENT++] agent created with cmd_exe_mib doesnt' recognize the get request for OID 1.3.6.1.4.1.4976.6.1.2.2.2.1

Ravi Kanth Vanapalli vvnrk.vanapalli at gmail.com
Thu Dec 24 03:33:41 CET 2015


Dear Frank,
  Thanks for uploading the MIB docs on the site. They were quite helpful in
understanding  the code now.

My Goal was to run the 'date' command on the linux command line and get the
output back to the SNMP manager.

I tried initializing the MIB table cmdExecutionCmdEntry from the API as
below.

         MibTableRow* r =
cmdExecutionCmdEntry::instance->add_row("1.3.6.1.4.1.4976.6.1.2.2.2.1");
//got this from the MIB file
         OctetStr cmd="date";
         Vbx vb= new Vbx("1.3.6.1.4.1.4976.6.1.2.2.2.1.2","date");
         ((cmdExecutionCmdName*)r->get_nth(0))->set_value(vb);//setting the
variable binding with teh command name to be executed
        ((cmdExecutionCmdStatus*)r->get_nth(1))->set_state(1);//setting
state to be idle
        ((cmdExecutionCmdRunTime*)r->get_nth(2))->start();//initializing
teh start time
        ((cmdExecutionCmdRowStatus*)r->get_nth(3))->set_state(rowActive);

    When compiling I always get the error below.

agent.cpp:293:64: error: no matching function for call to
‘Agentpp::Vbx::Vbx(const char [31], const char [5])’
         Vbx vb= new Vbx("1.3.6.1.4.1.4976.6.1.2.2.2.1.2","date");

Query

1) Please help me construct the Variable Binding object to be passed for
initialing the row with respective values.

2) Can you help me with the command to set the same using SNMP SET request
without the use of API.
3) In your earlier reply you wanted me to set the RowStatus column. Should
the set be onto the entire row... and not just the column of the row ..??

Regards,
Ravi


On Wed, Dec 23, 2015 at 5:29 PM, Frank Fock <fock at agentpp.com> wrote:

> Hi Ravi,
>
> You can now download the AGENT++ MIB files also from the
> https://agentpp.com/download.html
> page.
>
> The next AGENT++ release will also contain the MIB files again.
>
> A table is not accessible object. So if you run a GET request on a table
> OID
> you will always get a noSuchName (SNMPv2c or later) error.
> You will have to access an instance of a row in the table (you can use
> GETNEXT to find
> one). I f there isn’t one - which is the default for new/generated tables
> then you
> either can create a row via SNMP SET using the RowStatus column or create
> the row programmatically in the agent.
>
> Best regards,
> Frank
>
>
> > On 23 Dec 2015, at 22:50, Ravi Kanth Vanapalli <
> vvnrk.vanapalli at gmail.com> wrote:
> >
> > Dear all,
> >
> > I did make on the examples/cmd_exe_mib  and ran the agent with teh
> command
> > './agent 8006' .  I also had net-snmp installed on my ubuntu.. which I am
> > using as a trigger to send a command to agentpp.
> >
> >
> > when i run the command
> >
> > "snmpget -v 1 -c public localhost:8006 1.3.6.1.4.1.4976.6.1.2.2.2.1"
> >
> > I get the response
> >
> > "Error in packet
> > Reason: (noSuchName) There is no such variable name in this MIB.
> > Failed object: SNMPv2-SMI::enterprises.4976.6.1.2.2.2.1"
> >
> > My MIB already have a table cmdExecutionCmdEntry with that OID.. Why is
> it
> > not being returned by agentpp
> >
> > Following is the agentpp output
> >
> >
> > root at ravikanth-ubuntu
> :/home/ravikanth/Downloads/agent++-4.0.4/examples/cmd_exe_mib/src#
> > ./agent 8006
> > 20151223.16:43:21:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (0)EVENT  : main: SNMP listen port: (8006)
> > 20151223.16:43:21:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (1)DEBUG  : TaskManager: thread started
> > 20151223.16:43:21:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (1)DEBUG  : TaskManager: thread started
> > 20151223.16:43:21:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (1)DEBUG  : TaskManager: thread started
> > 20151223.16:43:21:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (1)DEBUG  : TaskManager: thread started
> > 20151223.16:43:21:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (1)DEBUG  : TaskManager: thread started
> > 20151223.16:43:21:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (1)DEBUG  : TaskManager: thread started
> > 20151223.16:43:28:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (2)EVENT  : RequestList: request received
> (id)(siz)(fro)(ver)(com)(type):
> > (1414575044), (1), (127.0.0.1/57944), (SNMPv1), (public), (160)
> > 20151223.16:43:28:   80 27 13 75 58 7F 00 00
> > .'.uX...
> > : (1)DEBUG  : TaskManager: task manager found
> > 20151223.16:43:28:   00 F7 11 75 58 7F 00 00
> > ...uX...
> > : (0)EVENT  : Agent: starting thread execution (pduType)(subrequests):
> > (160), (1)
> > 20151223.16:43:28:   00 F7 11 75 58 7F 00 00
> > ...uX...
> > : (0)EVENT  : Mib: process request: get request, oid: (0),
> > (1.3.6.1.4.1.4976.6.1.2.2.2.1)
> > 20151223.16:43:28:   00 F7 11 75 58 7F 00 00
> > ...uX...
> > : (3)EVENT  : Mib: process subrequest: get request, oid: (0),
> > (1.3.6.1.4.1.4976.6.1.2.2.2.1)
> > 20151223.16:43:28:   00 F7 11 75 58 7F 00 00
> > ...uX...
> > : (3)EVENT  : RequestList: finished subrequest (ind)(oid)(val)(syn): (0),
> > (1.3.6.1.4.1.4976.6.1.2.2.2.1), (), (128)
> > 20151 223.16:43:28:   00 F7 11 75 58 7F 00 00
> > ...uX...
> > : (2)EVENT  : RequestList: request answered
> (rid)(tid)(to)(err)(send)(sz):
> > (1414575044), (0), (127.0.0.1/57944), (2), (0), (1)
> > 20151223.16:43:28:   00 F7 11 75 58 7F 00 00
> > ...uX...
> > : (0)EVENT  : Agent: finished thread execution
> >
> >
> >
> > ii) Can you please help me print the table .. cmdExecutionCmdEntry
> defined
> > in line 588
> > cmdExecutionCmdEntry::cmdExecutionCmdEntry():
> >   MibTable("1.3.6.1.4.1.4976.6.1.2.2.2.1", 1, FALSE)
> >
> > iii) Also can you please help me with a sample usage of the API's for
> > inserting a table entry into cmdExecutionCmdEntry table and printing its
> > contents.
> >
> > iv) Please provide mib files for the examples in the agentpp4.0.4. There
> > are only .cpp and .h files provided but no MIB files.
> >
> >
> >
> > --
> > Regards,
> > Venkata
> > _______________________________________________
> > AGENTPP mailing list
> > AGENTPP at agentpp.org
> > https://oosnmp.net/mailman/listinfo/agentpp
>
>


-- 
Regards,
Ravi


More information about the AGENTPP mailing list