Regarding System Mib get/set on SysLocation, and SysContact

2012-03-28 Thread Suresh kumar

Hello All,
I using net-snmp 7.1,we have get/set operation on system mib like sysName, 
sysContact and sysLocation.i know that get/set working fine for sysName. and 
Set operation only work for sysContact and sysLocation if is not configure in 
snmpd.conf. My Requirement is that .1. What we set sysContact/SysLocation using 
snmpset its should also reflect our GUI and some other component.Because of 
above Requirement we have to call some external API for getting 
SysContact/SysLocation and have to pass it net-snmp for snmpget.and also when 
we do snmpset operation to call some external API to refelect the change in GUI 
and some other component .
I was trying to debug this in net-snmp and found that 
system_parse_config_sysloc(const char *token, char *cptr)  and 
system_parse_config_syscon(const char *token, char *cptr) is fill up value in 
global variable   sysLocation, sysContact in system_Mib.c files  at the time 
net-snmp launching not at time of snmpget/snmpset. But unable find that how its 
pass for snmpget and how this value are set when we do snmpset operationthis is 
important for overwrite this functionality using some our external API for 
getting/setting sysContact/sysLoaction for some other component. 
Can any help me..
  

  --
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: Regarding System Mib get/set on SysLocation, and SysContact

2012-03-28 Thread Dave Shield
On 28 March 2012 19:44, Suresh kumar skjaiswa...@hotmail.com wrote:
 But unable find that how its pass for snmpget and how this value are set
 when we do snmpset operation

Both SET and GET requests are handled by a generic watched scalar
mechanism.   This specifies an internal buffer which represents the value
MIB object in question.
   When a GET (or GETNEXT) request is received, then the watched scalar
code will return the current value of this buffer.   When a SET request is
received,  the watched scalar code will update the value stored in this
buffer.

I'm not sure that this watched scalar helper provides the option to call
some additional code as well.   The whole point of this helper is that
it can handle the processing internally, so you *don't* need your own code.

In your case, I suspect that the easiest approach will be to re-implement
a separate scalar handler for these particular objects, and comment out
the watched_scalar registrations.
  I.e. replace the standard implementation with your own.

Dave

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users