Re: How can I set a string

This is a discussion on Re: How can I set a string within the SNMP Coders forums, part of the Networking and Network Related category; On Wed, 2005-06-15 at 03:49, flyeagers wrote: > I'm a beginner in SNMP.And I follow ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-15-2005
Dave Shield
 
Posts: n/a
Default Re: How can I set a string

On Wed, 2005-06-15 at 03:49, flyeagers wrote:
> I'm a beginner in SNMP.And I follow the examples of NET-SNMP-5.2.1


If you're just starting out (rather than maintaining existing code),
we'd strongly suggest that you use the new "handler-based" MIB API
mechanism, rather than the old v4 REGISTER_MIB approach.

> I can get string of the target snmpd from remote host and I can
> also send a command to make target snmpd run a command.
> Now I can use snmpget to get the string,but I can not set the string.


The command

mib2c -c mib2c.scalar.conf MY-MIB::cmdstr

should generate a suitable template structure for you,
including basic SET support.

> Once I run snmpset command in remote host, the target snmpd will
> terminate automatically.


That would probably indicate a coding error - possibly following
a NULL pointer without checking it first.

> Who can tell the error in my codes and tell what does these
> mean such as RESERVE1,RESERVE2,UNDO,COMMIT,FREE,ACTION
> in write method?


Please read the file 'AGENT.txt' (which still covers the old v4
mechanism that you've been working with - but the multi-pass SET
processing is still used in the v5 APIs too).

> And how can I run a command such as "ls -l" ?


"run_shell_command"

> Here's the MIB:
> MY-MIB DEFINITIONS ::=
> BEGIN
>
> IMPORTS
> enterprises FROM RFC1155-SMI
> OBJECT-TYPE FROM RFC-1212
> DisplayString FROM RFC1213-MIB;


You're missing the "MODULE-IDENTITY" definition.

Dave



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0