Hi all,

Hi Dave,
Thanks for your reply.

I have checked the source code (mibgroup/target/snmpTargetAddrEntry.c, 
snmpTargetParamEntry.c and snmpNotifyTable.c).
Now I know them more clearly, but I still have many questions.

Question 1:
All these three tables are used to store *trap* destination and 
configuration information, which table is used to store *manager's* ip and 
configuration information (manager means the NMS which send get/set requests 
to agent)?

Question 2:
In targetAddrTable_struct, there is an entry *sess*, but I can't find code 
to fill it in  mibgroup/target/snmpTargetAddrEntry.c. So it is filled by 
agent automatically?

Question 3:
So there is not a *global* community table to store community name and 
privilege(rw/ro) both for trap receivers and managers?

Question 4:
So I need a *thread* to keep checking (while(1) {...}) incoming messages 
from external application(CLI) to know when to read new configure? Or 
snmp_alarm_registaer will be a better choice? Which one will affect the 
performance of agent *less*?

Question 5:
Is read/write snmpd.conf better than manipulate the data structures 
directly? But how can I make agent reload snmpd.conf after I modify trap 
destination and configuration information (manager's ip and configuration 
information ) without restart agent?



In my past implementation, there are three snmp related CLI commands:

Command 1:
get/create/delete snmp comm community community [access ro | rw]
This command access the community table like following:
column 1                               column2 
column3
community index                   community name 
access
1                                           public 
ro



Command 2:
get/create/delete snmp host ip ip community community
This command access the snmp host table like following:
column 1                               column2
host ip                                  community index
192.168.100.1                     public


Command 3:
get/create/delete snmp traphost ip ip community community [port port] 
[version v1 | v2c]
This command access the snmp traphost table like following:
column 1                               column2 
column3                                      column4
traphost ip                            community index 
port                                             version
192.168.100.2                     public 
162                                              v1
















永鈦鑫   iTAS Corporation
新竹市水源街75號
NO. 75,Shuiyuan St., Hsinchu City, Taiwan, R.O.C.
Tel:03-5716099 Ext.1208
E-mail:[EMAIL PROTECTED]
----- Original Message ----- 
From: "Dave Shield" <[EMAIL PROTECTED]>
To: "Tewen Hsieh" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Wednesday, July 02, 2008 7:23 PM
Subject: Re: configure manager's ip, trap receiver's ip and community at 
runtime via external application


> 2008/7/2 Tewen Hsieh <[EMAIL PROTECTED]>:
>> My thought is that there must be a data structure(s) in net-snmp to
>> store  manager's ip/port, trap receiver's ip/port and community/privilege
>> parsed from snmpd.conf.
>
> The Net-SNMP agent uses the standard MIB tables to store
> trap destination and configuration information.
>
> Try configuring a trapsink via the config file, and then walk the
> tables  SNMP-NOTIFICATION-MIB::snmpNotifyTable
> SNMP-TARGET-MIB::snmpTargetAddrTable and
> SNMP-TARGET-MIB::snmpTargetParamsTable.
>
> Experimenting with different trapsink/trap2sink entries
> should show you how these are reflected in these tables.
>
>
>> I try to allocate a share memory to store these information, and my 
>> external
>> CLI application can also read/write this structure(s).
>
> Your external application would simply have to construct
> appropriate rows in these three tables.
>
> Dave
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to