Re: A question of net-snmp

2010-08-25 Thread Dave Shield
On 25 August 2010 03:02, AC. achuan...@gmail.com wrote:
 When I used snmptable to get the information of the table A, it will
 contact the handler of table A.
 But it will contact the handler of table B, too.

But only once, at the very end.
(I presume?)


 I see that the command snmptable use the getnext to retrive the
 information,
 but is that correct cause I don't need the information of table B?

Please consider the following question:
   - How does the snmptable command know when it has
 received the last row of table A?



 PS, if you need the source code that about these 2 tabls,
 please response to me and I will attached my code for you.
 But I think that the problem doesn't be relate to them.

No - you are quite correct.
The reason you are seeing this extra unnecessary request
is tied up with the fundamental design of SNMP.  It's not
specific to your particular code - you would see exactly the
same behaviour with any other table.

Dave

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
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: A question of net-snmp

2010-08-25 Thread AC.
2010/8/25 Dave Shield d.t.shi...@liverpool.ac.uk

 On 25 August 2010 03:02, AC. achuan...@gmail.com wrote:
  When I used snmptable to get the information of the table A, it will
  contact the handler of table A.
  But it will contact the handler of table B, too.

 But only once, at the very end.
 (I presume?)


Yes!



  I see that the command snmptable use the getnext to retrive the
  information,
  but is that correct cause I don't need the information of table B?

 Please consider the following question:
   - How does the snmptable command know when it has
 received the last row of table A?


I also think so, but It is a waste of resource, especilly in my condition.

There are 3 main contact function in my code.
1. handler
2. get_first_data_point: It wll get all the data of the table
3. get_next_data_point
When I typed snmptable to get table information, I find the handler was
contacted servel times,
and the get_first_data_point function was contacted the same times.
So it will get ALL data of the table servel times. (the waste of resource)
I want to improve it, and I think that I must know how the contact flow
works in it.
How can I get the information about contact flow?



  PS, if you need the source code that about these 2 tabls,
  please response to me and I will attached my code for you.
  But I think that the problem doesn't be relate to them.

 No - you are quite correct.
 The reason you are seeing this extra unnecessary request
 is tied up with the fundamental design of SNMP.  It's not
 specific to your particular code - you would see exactly the
 same behaviour with any other table.

 Dave

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d___
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: A question of net-snmp

2010-08-25 Thread Dave Shield
On 25 August 2010 09:40, AC. achuan...@gmail.com wrote:
  I see that the command snmptable use the getnext to retrive the
  information,
  but is that correct cause I don't need the information of table B?

 Please consider the following question:
   - How does the snmptable command know when it has
     received the last row of table A?

 I also think so, but It is a waste of resource, especilly in my condition.

It's not a question of waste of resources.
This is fundamental to how walking SNMP tables works.
You will *ALWAYS* run off the end of one table, and
on to the next.   That's the only way that the client command
knows that it has reached the end of the table.



 There are 3 main contact function in my code.
 1. handler
 2. get_first_data_point: It wll get all the data of the table
 3. get_next_data_point
 When I typed snmptable to get table information, I find the handler was
 contacted servel times,

Yes - once for GETNEXT request.
  (Which is typically once for each row of the table)
*ALL* table handlers work this way - they are inevitably
called once for each incoming request.   You cannot
get away from that.


But you've suddenly changed the question.
You are no longer talking about switching from the table A
helper to table B.   You now seem to be concerned about
how often the table A code is being called.


 and the get_first_data_point function was contacted the same times.

Yes - that's how the iterator works.
For each individual incoming request (GET or GETNEXT),
the 'get_first' hook routine will be called once,
and the 'get_next' hook routine will be called multiple times
(typically as many times as there are rows in the table).

We state very clearly in the documentation that the iterator
helper is not the most efficient mechanism for implementing
a table.   It's designed for relatively small tables, where the
data is naturally held in a random order.


 So it will get ALL data of the table servel times. (the waste of resource)

Which is why we repeatedly recommend that people use the cache
helper, which will save re-loading the table data multiple times
in quick succession.



 I want to improve it

a)  Look at using the cache helper
   (mib2c -S cache=1 -c mib2c.iterate.conf ...)

b)  Look at using one of the other table helpers
   (e.g. mib2c -S cache=1 -c mib2c.table_data.conf ...
 or the MfD framework)


But if you use one of the more inefficient helpers,
in a relatively inefficient way, then yes - you are going to
see performance implications.


Dave

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
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: A question of net-snmp

2010-08-25 Thread AC.
2010/8/25 Dave Shield d.t.shi...@liverpool.ac.uk

 On 25 August 2010 09:40, AC. achuan...@gmail.com wrote:
   I see that the command snmptable use the getnext to retrive the
   information,
   but is that correct cause I don't need the information of table B?
 
  Please consider the following question:
- How does the snmptable command know when it has
  received the last row of table A?
 
  I also think so, but It is a waste of resource, especilly in my
 condition.

 It's not a question of waste of resources.
 This is fundamental to how walking SNMP tables works.
 You will *ALWAYS* run off the end of one table, and
 on to the next.   That's the only way that the client command
 knows that it has reached the end of the table.



  There are 3 main contact function in my code.
  1. handler
  2. get_first_data_point: It wll get all the data of the table
  3. get_next_data_point
  When I typed snmptable to get table information, I find the handler was
  contacted servel times,

 Yes - once for GETNEXT request.
  (Which is typically once for each row of the table)
 *ALL* table handlers work this way - they are inevitably
 called once for each incoming request.   You cannot
 get away from that.


 But you've suddenly changed the question.
 You are no longer talking about switching from the table A
 helper to table B.   You now seem to be concerned about
 how often the table A code is being called.



The cause I change the question suddenly is
1. My tables are big sometimes.
(e.g. The table of disks, there are min. 0 to max. 192 disks in my system,
and there are 20 collumn in one row.)
2. When the table B was the big one and I wanna get table A,
it wastes time and resource to get a *BIG* table B that I don't neet it.
--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d___
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: A question of net-snmp

2010-08-25 Thread Dave Shield
On 25 August 2010 10:45, AC. achuan...@gmail.com wrote:
 The cause I change the question suddenly is
 1. My tables are big sometimes.
 2. When the table B was the big one and I wanna get table A,
     it wastes time and resource to get a *BIG* table B that I don't neet it.

If your tables are big, then I *strongly* suggest you use
a more efficient approach than the iterate helper.

Personally, I tend to go for the table_data helper,
together with a local cache.   Robert would probably
advise you to use the MfD framework.
(And although I don't like it myself, this should also
work more sensibly in this situation).


But bear in mind that although a walk of table A will trigger
a query for the next OID supported by the agent, this won't
involve walking the *whole* of table B.  There should only
ever be one value returned from table B (being the value
immediately following the last entry of the last column of
table A).
  So it should be a one-time overhead of loading the
data, plus a single pass through the get_first/next hooks,
and one invocation of the table B handler (for one column value).

If this continues to be an issue, you could always tweak
the MIB to define a scalar object lying in between the two tables.
So walking off the end of table A would retrieve this
buffering scalar value, rather than loading table B.


Dave

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
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: A question of net-snmp

2010-08-24 Thread AC.
Dear Dave,

Thanks for your help, I resolve my problems.
There is only one question about table having to be resolve and illustrate
as following.

net-snmp-5.5
2 tables, table A and table B, made by mib2c
When I used snmptable to get the information of the table A, it will
contact the handler of table A.
But it will contact the handler of table B, too.
I see that the command snmptable use the getnext to retrive the
information,
but is that correct cause I don't need the information of table B?

PS, if you need the source code that about these 2 tabls, please response to
me and I will attached my code for you.
But I think that the problem doesn't be relate to them.

Bluce
--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d___
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: A question of net-snmp

2010-08-18 Thread Dave Shield
On 18 August 2010 06:47, AC. achuan...@gmail.com wrote:
 How exactly are you retrieving the table.

 I used the snmptable command to retrive.

In which case, things are working as expected.

snmptable will send one GETNEXT request for each
row of the table, plus one additional request to discover
that it's reached the end.

Try working this through by hand - you should see why
things work that way.


Dave

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
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: A question of net-snmp

2010-08-18 Thread AC.

 On 18 August 2010 06:47, AC. achuan...@gmail.com wrote:
  How exactly are you retrieving the table.
 
  I used the snmptable command to retrive.

 In which case, things are working as expected.

 snmptable will send one GETNEXT request for each
 row of the table, plus one additional request to discover
 that it's reached the end.

 Try working this through by hand - you should see why
 things work that way.

I see that, but I have to follow two rules:
1. When receiving the request command that want to get table information,
it must ask the information from my kernel.
- So I remove the check, if(tlist == NULL), to let agent ask
information every request.

2. At the same request to retrive the table, I just want the agent to ask
the information one time only.
-- This is my problem. Because it used the command, getnext, to
retrive the table.
 I have only one idea to do it now.
 I can calculate the time to check it. (e.g. ask information per 30
seconds)
 Do you have better idea to resolve it?
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
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: A question of net-snmp

2010-08-18 Thread Dave Shield
On 18 August 2010 09:01, AC. achuan...@gmail.com wrote:
 I see that, but I have to follow two rules:
 1. When receiving the request command that want to get table information,
 it must ask the information from my kernel.
 - So I remove the check, if(tlist == NULL), to let agent ask
 information every request.

That description is essentially meaningless.
I've no idea what your code looks like, so giving me
one line in isolation is no use whatsoever.


 2. At the same request to retrive the table, I just want the agent to ask
 the information one time only.
 -- This is my problem. Because it used the command, getnext, to
 retrive the table.
  I have only one idea to do it now.
  I can calculate the time to check it. (e.g. ask information per 30
 seconds)
  Do you have better idea to resolve it?


That's the reason we suggest you use the cache handler.
This will allow you to query the kernel once, and keep the
information available for the next few seconds - typically
sufficient to serve a complete snmpwalk or snmptable.

Dave

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
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: A question of net-snmp

2010-08-17 Thread AC.
Dears,

I can get table information that I need by using mib browser, but I find two
questions when I do it.
Q1: If I use the command to get Table A, the agent will ask the inforation A
and information B.
  If I use the command to get Table B, the agent will ask the
inforation B and information C.
  If I use the command to get Table C, the agent will ask the
inforation B and information D.
  ...
  How can I do that let it only gets the needed information?

Q2: If I get a table Information only ONE time, but the agent will ask the
information more than one time.
  Why?

The structure of my system:

Usersnmp agent
(Net-SNMP-5.4)   My-Kernel

snmp command   request    receive command and ask the info. 
ask  get info. and return it

My code that about table:

/* ** Table A ** */
void
initialize_table_fanTable(void)
{
static oid tableA_oid[] = {1,3,6,1,4,1,3064,2,162,101,105};
netsnmp_table_data_set*table_set;
 netsnmp_table_registration_info *table_info;
 netsnmp_iterator_info   *it_info;
netsnmp_handler_registration*A_handler;
/* create the table structure itself */
table_set = netsnmp_create_table_data_set(tableA);
/* comment this out or delete if you don't support creation of new rows
*/
table_set-allow_creation = 1;
/***
 * Adding indexes
 */
netsnmp_table_set_add_indexes(table_set,ASN_OCTET_STR,0);
   netsnmp_table_set_multi_add_default_row(table_set,
COLUMN_NAME, ASN_OCTET_STR, 0,
NULL, 0,
COLUMN_STATUS, ASN_OCTET_STR, 0,
NULL, 0,
0);
 /** create the table registration information structures */
table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
it_info = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
 /** register emsFanTable handler */
fan_handler = netsnmp_create_handler_registration(
 tableA,
 A_handler,
 tableA_oid,
 OID_LENGTH(tableA_oid),
 HANDLER_CAN_RONLY);
if (!fan_handler || !table_info || !it_info) {
//snmp_log(LOG_ERR, malloc failed in
initialize_table_emsFanTable);
return; /** Serious error. */
}
 /***
 * Setting up the table's definition
 */
netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR,0);
/** Define the minimum and maximum accessible columns.  This
optimizes retrival. */
table_info-min_column = COLUMN_NAME;
table_info-max_column = COLUMN_STATUS;
/** iterator access routines */
it_info-get_first_data_point = tableA_get_first_data_point;
it_info-get_next_data_point = tableA_get_next_data_point;
 it_info-free_data_context = tableA_data_free;
 it_info-free_loop_context = tableA_loop_free;
it_info-free_loop_context_at_end = tableA_loop_free;
/** tie the two structures together */
it_info-table_reginfo = table_info;
/***
 * registering the table with the master agent
 */
   netsnmp_register_table_iterator(A_handler, it_info);
}
/** handles requests for the emsFanTable table, if anything else needs to be
done */
int
A_handler(
netsnmp_mib_handler   *handler,
netsnmp_handler_registration  *reginfo,
netsnmp_agent_request_info*reqinfo,
netsnmp_request_info  *requests) {
switch (reqinfo-mode)
 {
case MODE_GET:
  //DEBUGMSGTL((emsFanTable, MODE_GET CALLED\n));
  handle_a_table_get(requests);
  break;
 case MODE_SET_ACTION:
 case MODE_GETNEXT:
 default:
  //
  break;
 }
return SNMP_ERR_NOERROR;
}
void handle_a_table_get(netsnmp_request_info * requests)
{
 netsnmp_request_info  *request;
netsnmp_variable_list *requestvb;
netsnmp_table_request_info *table_info;
 llist_stats_fan* entry = NULL;
 oid subid;
for (request=requests; request; request=request-next)
 {
 requestvb = request-requestvb;
  entry = (llist_stats_fan*)netsnmp_extract_iterator_context(request);
if (entry == NULL) {
   continue;
}
  table_info = netsnmp_extract_table_info(request);
subid  = table_info-colnum;
  switch (subid)
  {
   case COLUMN_NAME:
snmp_set_var_typed_value(requestvb, ASN_OCTET_STR, entry-aName,
strlen(entry-aName));
break;
   case COLUMN_FAN_STATUS:
snmp_set_var_typed_value(requestvb, ASN_OCTET_STR, entry-aStatus,
strlen(entry-aStatus));
break;
   default:
//
break;
  }
 }
}
netsnmp_variable_list *

Re: A question of net-snmp

2010-08-17 Thread Dave Shield
On 17 August 2010 07:28, AC. achuan...@gmail.com wrote:
 I can get table information that I need by using mib browser, but I find two
 questions when I do it.
 Q1: If I use the command to get Table A, the agent will ask the
   inforation A and information B.

The command is a bit vague.
How exactly are you retrieving the table.

Remember that many SNMP clients typically work by issuing a series
of GETNEXT requests, starting at the beginning of the table, and
continuing until this runs off the end.   But the only way that the client
knows that it has reached the end of the table, is to issue a request
that returns something else (i.e. the next object in the MIB tree)
   This is normal - most clients would hide this from the network
administrator.



 Q2: If I get a table Information only ONE time, but the agent will ask the
 information more than one time.

Again - this question is really too vague to answer.
But it's probably the same underlying answer.
You are getting confused between a single command (snmpwalk
or snmptable), and the sequence of (many) SNMP requests that
are used to implement this command.


See any good book on SNMP for more details.

Dave

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
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: A question of net-snmp

2010-08-17 Thread AC.

 On 17 August 2010 07:28, AC. achuan...@gmail.com wrote:
  I can get table information that I need by using mib browser, but I
 find two
  questions when I do it.
  Q1: If I use the command to get Table A, the agent will ask the
inforation A and information B.

 The command is a bit vague.
 How exactly are you retrieving the table.


Sorry for the bit vague.
I used the snmptable command to retrive.
The full command line is snmptable -v 2c -t 30 -c publuc 192.168.3.211
1.3.6.1.4.1.3064.100.101



 Remember that many SNMP clients typically work by issuing a series
 of GETNEXT requests, starting at the beginning of the table, and
 continuing until this runs off the end.   But the only way that the client
 knows that it has reached the end of the table, is to issue a request
 that returns something else (i.e. the next object in the MIB tree)
   This is normal - most clients would hide this from the network
 administrator.



  Q2: If I get a table Information only ONE time, but the agent will ask
 the
  information more than one time.

 Again - this question is really too vague to answer.
 But it's probably the same underlying answer.
 You are getting confused between a single command (snmpwalk
 or snmptable), and the sequence of (many) SNMP requests that
 are used to implement this command.

 As the same, I used the command snmptable.


 See any good book on SNMP for more details.

 Dave

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
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: A question of net-snmp

2010-08-06 Thread AC.
Thank for your help.

I resolve my problem, although I don't know that is the true resolution.

the resoloved flow is as following:

1. use 64-bits linux os (centos)

2. unpacking the source tarball

3. use default parameter to configure (# ./configure)

4. make it, and it's no error message. (# make)

5. copy the directory, perl, to cover my net-snmp-5.4 directory

6. use my configure file to execute configure

7. make it, and it finish the job with no error.

I guess that it maybe need to use the 64-bits environment, and/or my
configure parameters were error.
Why do you think about it?

Bluce

2010/8/6 AC. achuan...@gmail.com

 The attached file, make-debug.log, is the result of the make command.
 (# make 21 make-debug.log)

  console print
 ==

 r...@bluce-desktop:~/work/net-snmp-5.4.3# make 21 make-debug.log

 snmpUDPDomain.c: In function '_sock_buffer_maximize':
 snmpUDPDomain.c:325: warning: passing argument 5 of 'getsockopt' from
 incompatible pointer type
 /opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
 note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
 snmpUDPDomain.c:362: warning: passing argument 5 of 'getsockopt' from
 incompatible pointer type
 /opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
 note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
 snmpUDPDomain.c: In function 'netsnmp_sock_buffer_set':
 snmpUDPDomain.c:507: warning: passing argument 5 of 'getsockopt' from
 incompatible pointer type
 /opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
 note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
 snmpUDPDomain.c:542: warning: passing argument 5 of 'getsockopt' from
 incompatible pointer type
 /opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
 note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
 util_funcs.c: In function 'get_exec_output':
 util_funcs.c:291: warning: passing argument 4 of 'run_exec_command' from
 incompatible pointer type
 utilities/execute.h:9: note: expected 'int *' but argument is of type
 'ssize_t *'
 util_funcs.c: In function 'restart_doit':
 util_funcs.c:719: warning: 'sigsetmask' is deprecated (declared at
 /opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/signal.h:199)
 if-mib/data_access/interface.c: In function '_free_interface_config':
 if-mib/data_access/interface.c:784: warning: passing argument 1 of 'free'
 discards qualifiers from pointer target type
 /opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/stdlib.h:488:
 note: expected 'void *' but argument is of type 'const char *'
 udp-mib/data_access/udp_endpoint_linux.c: In function
 '_process_line_udp_ep':
 udp-mib/data_access/udp_endpoint_linux.c:225: warning: cast from pointer to
 integer of different size
 udp-mib/data_access/udp_endpoint_linux.c:226: warning: cast from pointer to
 integer of different size
 udp-mib/data_access/udp_endpoint_linux.c:226: warning: cast to pointer from
 integer of different size
 snmpd.c: In function 'main':
 snmpd.c:963: warning: assignment discards qualifiers from pointer target
 type
 Warning: -L../../snmplib/.libs changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/default_store/../../snmplib/.libs

 Warning: -L../../snmplib/ changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/default_store/../../snmplib/
 Warning: -L../../snmplib/.libs changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/ASN/../../snmplib/.libs
 Warning: -L../../snmplib/ changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/ASN/../../snmplib/
 Warning: -L../../snmplib/.libs changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/OID/../../snmplib/.libs
 Warning: -L../../snmplib/ changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/OID/../../snmplib/
 Warning: -L../../snmplib/.libs changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../snmplib/.libs
 Warning: -L../../snmplib/ changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../snmplib/
 Warning: -L../../agent/.libs changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../agent/.libs

 Warning: -L../../agent/ changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../agent/
 Warning: -L../../agent/helpers/.libs changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../agent/helpers/.libs

 Warning: -L../../agent/helpers/ changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../agent/helpers/
 Warning: -L../../../snmplib/.libs changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/default_store/../../../snmplib/.libs
 Warning: -L../../../snmplib/ changed to
 -L/home/bluce/work/net-snmp-5.4.3/perl/agent/default_store/../../../snmplib/
 

Re: A question of net-snmp

2010-08-05 Thread AC.
Before this change, I make it success for the old system.

The imformation of the old embedded system is:
Kernel: linux-2.6.14
power pc
cross compile: powerpc-440-linux-gun

Now I have to change system for
Kernel: linux-2.6.32.9
x86_64
cross conpile-x86_64-unknow-linux-gun

I jsut modify the parameter of configure file with
--host=ppc-linux to --host=x86_64-linux,
--with-endianness=big to --with-endianness=little, and
the $CROSS_COMPILE is changed from powerpc-440-linux-gun-
to x86_64-unknow-linux-gun-.

After I executed the ./configure, I make it by typing make -j3 -s.
Then I got the perlmodules error!

More Information is as following:

1. my configure:
./configure \
--host=x86_64-linux \
--with-cc=$CROSS_COMPILEgcc \
--with-endianness=little \
--with-default-snmp-version=2 \
--with-sys-contact=Unknown \
--with-sys-location=Unknown \
--with-logfile=/var/log \
--with-persistent-directory=/var/net-snmp/ \
--disable-embedded-perl \
--disable-perl-cc-checks \
--disable-applications \
--disable-manuals \
--disable-scripts \
--disable-snmptrapd-subagent \
--without-opaque-special-types \
--with-out-mib-modules=disman/event disman/schedule notification
notification-log-mib target ucd_snmp host agentx \
--with-mib-modules=myScalar  myTable \
--without-kmem-usage \
--with-cflags=-Os \
--disable-debugging \
--without-openssl

2. uname -a
Linux bluce-desktop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC
2009 i686 GNU/Linux

3. perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
osname=linux, osvers=2.6.24-23-server,
archname=i486-linux-gnu-thread-multi
uname='linux vernadsky 2.6.24-23-server #1 smp wed apr 1 22:22:14 utc
2009 i686 gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5
-Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.10.0
-Dsitearch=/usr/local/lib/perl/5.10.0 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm
-DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.0
-Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2 -g',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe
-I/usr/local/include'
ccversion='', gccversion='4.4.1', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/lib64
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.10.1.so, so=so, useshrplib=true,
libperl=libperl.so.5.10.0
gnulibc_version='2.10.1'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib'
Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
  Built under linux
  Compiled at Oct  1 2009 22:19:26
  @INC:
/etc/perl
/usr/local/lib/perl/5.10.0
/usr/local/share/perl/5.10.0
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl

It perplexed me 3 days, please help me. _
Thanks.

2010/8/4 Dave Shield d.t.shi...@liverpool.ac.uk

 On 4 August 2010 03:22, AC. achuan...@gmail.com wrote:
  making all in
 /home/bluce/work/root/filesystem/packages/net-snmp-5.4/snmplib
  make[1]: *** No rule to make target
  `/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/Config.pm', needed by
 `Makefile'.  Stop.
  make: *** [perlmodules] Error 1
 
  Does that mean I must get and install the perl5 with 64-bit?

 You're getting this in the *snmplib* directory?!?
 I've seen something similar when compiling the perl modules,
 but never with snmplib.

 What I would suggest is that you start again with a fresh source
 tree.   Unpack the tarball from scratch and 

Re: A question of net-snmp

2010-08-05 Thread AC.
 I tried the method that you suggested yesterday.

 I downloaded net-snmp-5.4.3.tar.gz again, unpacked it, and then executed
 ./configure.

 the configure patameter is as following (the same as before)

--host=x86_64-linux \
   --with-cc=$CROSS_COMPILEgcc \
   --with-endianness=little \
   --with-default-snmp-version=2 \
   --with-sys-contact=Unknown \
   --with-sys-location=Unknown \
   --with-logfile=/var/log \
   --with-persistent-directory=/var/net-snmp/ \
   --disable-embedded-perl \
   --disable-perl-cc-checks \
   --disable-applications \
   --disable-manuals \
   --disable-scripts \
   --disable-snmptrapd-subagent \
   --without-opaque-special-types \
   --with-out-mib-modules=disman/event disman/schedule notification
 notification-log-mib target ucd_snmp host agentx \
   --without-kmem-usage \
   --with-cflags=-Os \
   --disable-debugging \
   --without-openssl

 The attached file, config.log, is the log of this configured.

 Then, I executed the make command. (# make -j3 -s 1make-out.log
 2make-err.log)

 The attached file, make-err.log, is the log about the error of this job.

 I don't know how to fix it, and please help me.

 Thanks.

 Bluce


=== make-err.log

Warning: -L../../snmplib/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/default_store/../../snmplib/
Warning: -L../../snmplib/.libs changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/ASN/../../snmplib/.libs
Warning: -L../../snmplib/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/ASN/../../snmplib/
Warning: -L../../snmplib/.libs changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/OID/../../snmplib/.libs
Warning: -L../../snmplib/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/OID/../../snmplib/
Warning: -L../../snmplib/.libs changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../snmplib/.libs
Warning: -L../../snmplib/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../snmplib/
Warning: -L../../agent/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../agent/
Warning: -L../../agent/helpers/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/agent/../../agent/helpers/
Warning: -L../../../snmplib/.libs changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/agent/default_store/../../../snmplib/.libs
Warning: -L../../../snmplib/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/agent/default_store/../../../snmplib/
Warning: -L../../snmplib/.libs changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/SNMP/../../snmplib/.libs
Warning: -L../../snmplib/ changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/SNMP/../../snmplib/
Warning: -L../../apps changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/TrapReceiver/../../apps
Warning: -L../../agent changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/TrapReceiver/../../agent
Warning: -L../../agent/helpers changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/TrapReceiver/../../agent/helpers
Warning: -L../../snmplib/.libs changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/TrapReceiver/../../snmplib/.libs
Warning: -L../../snmplib changed to
-L/home/bluce/work/net-snmp-5.4.3/perl/TrapReceiver/../../snmplib
snmpUDPDomain.c: In function '_sock_buffer_maximize':
snmpUDPDomain.c:325: warning: passing argument 5 of 'getsockopt' from
incompatible pointer type
/opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
snmpUDPDomain.c:362: warning: passing argument 5 of 'getsockopt' from
incompatible pointer type
/opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
snmpUDPDomain.c: In function 'netsnmp_sock_buffer_set':
snmpUDPDomain.c:507: warning: passing argument 5 of 'getsockopt' from
incompatible pointer type
/opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
snmpUDPDomain.c:542: warning: passing argument 5 of 'getsockopt' from
incompatible pointer type
/opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/sys/socket.h:190:
note: expected 'socklen_t * __restrict__' but argument is of type 'size_t *'
mibgroup/util_funcs.c: In function 'get_exec_output':
mibgroup/util_funcs.c:291: warning: passing argument 4 of 'run_exec_command'
from incompatible pointer type
mibgroup/utilities/execute.h:9: note: expected 'int *' but argument is of
type 'ssize_t *'
mibgroup/util_funcs.c: In function 'restart_doit':
mibgroup/util_funcs.c:719: warning: 'sigsetmask' is deprecated (declared at
/opt/x-tools/x86_64-unknown-linux-gnu/bin/../x86_64-unknown-linux-gnu//sys-root/usr/include/signal.h:199)
mibgroup/if-mib/data_access/interface.c: In function
'_free_interface_config':
mibgroup/if-mib/data_access/interface.c:784: warning: 

Re: A question of net-snmp

2010-08-05 Thread Dave Shield
On 5 August 2010 12:37, AC. achuan...@gmail.com wrote:
 I downloaded net-snmp-5.4.3.tar.gz again, unpacked it, and then executed
 ./configure.

   [snip]

 Then, I executed the make command. (# make -j3 -s 1make-out.log
 2make-err.log)

Can you try *without* the -j3 option.
It looks suspiciously as if one of the compilation jobs is trying to
use the target of one of the others, before that job has finished.

It would also be useful to redirect stdout and stderr to the same
file  (21), so that we can coordinate error messages with the
file that's being compiled at the time.

Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
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: A question of net-snmp

2010-08-04 Thread AC.
The error massage:
making all in /home/bluce/work/root/filesystem/packages/net-snmp-5.4/snmplib
make[1]: *** No rule to make target
`/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/Config.pm', needed by
`Makefile'.  Stop.
make: *** [perlmodules] Error 1

Does that mean I must get and install the perl5 with 64-bit?

2010/8/3 Dave Shield d.t.shi...@liverpool.ac.uk

 On 3 August 2010 05:18, AC. achuan...@gmail.com wrote:
  When I made the snmp server, I find that the execute file, snmpd,
  was not made by the code.

 Have a look at the output of the compilation.
 If the agent wasn't created, then there was probably
 an error somewhere in the compilation process.

 If you can find and fix that error, then you should be
 able to create an agent binary.

  PS, my net-snmp version is 5.4.

 It's probably worth grabbing a new version of the code.
 Either the latest release on the 5.4.x line (5.4.3),
 or the later 5.5 release.
  (Or possibly even have a look at the upcoming 5.6
 release - currently available as 5.6.pre3).

 All available from the project website.

 Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm___
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: A question of net-snmp

2010-08-04 Thread Dave Shield
On 4 August 2010 03:22, AC. achuan...@gmail.com wrote:
 making all in /home/bluce/work/root/filesystem/packages/net-snmp-5.4/snmplib
 make[1]: *** No rule to make target
 `/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/Config.pm', needed by 
 `Makefile'.  Stop.
 make: *** [perlmodules] Error 1

 Does that mean I must get and install the perl5 with 64-bit?

You're getting this in the *snmplib* directory?!?
I've seen something similar when compiling the perl modules,
but never with snmplib.

What I would suggest is that you start again with a fresh source
tree.   Unpack the tarball from scratch and run 'configure' and 'make'

Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
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: A question of net-snmp

2010-08-04 Thread Dave Shield
On 5 August 2010 04:32, AC. achuan...@gmail.com wrote:
 Before this change, I make it success for the old system.

 The imformation of the old embedded system is:
 [snip]

 Now I have to change system for
[snip]

 I jsut modify the parameter of configure file with
[snip]

Are you using the same source tree for the two compilations?
Have you tried unpacking the source tarball into a separate source
tree for the second run of configure, as I suggested yesterday?

If not, then please do so.

Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
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: A question of net-snmp

2010-08-03 Thread AC.
Thank for your answer very much.

Now I have to change my environment from power pc to x86_64.
When I made the snmp server, I find that the execute file, snmpd, was not
made by the code.
And I can't find any information about snmpd for x86_64 by using Google.
XD
Do you know where the snmpd for x86_64 I can get it, or how to make it by
the code?
Please teach me!
Thanks.

PS, my net-snmp version is 5.4.

Bluce
2010/8/3 Dave Shield d.t.shi...@liverpool.ac.uk

 On 28 July 2010 13:57, AC. achuan...@gmail.com wrote:
  I made a table for getting mibs information.
  The first time to get information, the function,
 encTable_get_first_data_point,
  is called and get my external information.
  But the second time to get information, I just only get the old
 information
  that got from the first time.
  Why?

 Judging by the code you posted, the getQuantaTableInfo() routine
 is only called if the 'tlist' pointer is NULL - i.e. the first time that
 the 'get_first' hook is invoked.   Every subsequent time that this
 get_first routine is called, it will re-use the same tlist data.


  If I have to get my external information every time,
  Please tell me how to do that.

 If you do need to reload the external information *every* time,
 then remove the  if (tlist == NULL)  check from the get_first
 routine.
   But be aware that this will probably be VERY inefficient,
 since you'll be re-loading the complete table data for *every*
 incoming request.   Not for each 'snmpwalk' command, but for
 every 'GETNEXT' request - i.e. each individual object.

 You might find it sensible to use the cache helper to handle
 loading (and re-loading) the table data.  That way, you can
 control how long the cache is kept valid, and balance the
 overheads involved with the up-to-dateness of the data.

 Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm___
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: A question of net-snmp

2010-08-03 Thread Dave Shield
On 3 August 2010 05:18, AC. achuan...@gmail.com wrote:
 When I made the snmp server, I find that the execute file, snmpd,
 was not made by the code.

Have a look at the output of the compilation.
If the agent wasn't created, then there was probably
an error somewhere in the compilation process.

If you can find and fix that error, then you should be
able to create an agent binary.

 PS, my net-snmp version is 5.4.

It's probably worth grabbing a new version of the code.
Either the latest release on the 5.4.x line (5.4.3),
or the later 5.5 release.
  (Or possibly even have a look at the upcoming 5.6
release - currently available as 5.6.pre3).

All available from the project website.

Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
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: A question of net-snmp

2010-08-02 Thread Dave Shield
On 28 July 2010 13:57, AC. achuan...@gmail.com wrote:
 I made a table for getting mibs information.
 The first time to get information, the function, 
 encTable_get_first_data_point,
 is called and get my external information.
 But the second time to get information, I just only get the old information
 that got from the first time.
 Why?

Judging by the code you posted, the getQuantaTableInfo() routine
is only called if the 'tlist' pointer is NULL - i.e. the first time that
the 'get_first' hook is invoked.   Every subsequent time that this
get_first routine is called, it will re-use the same tlist data.


 If I have to get my external information every time,
 Please tell me how to do that.

If you do need to reload the external information *every* time,
then remove the  if (tlist == NULL)  check from the get_first
routine.
   But be aware that this will probably be VERY inefficient,
since you'll be re-loading the complete table data for *every*
incoming request.   Not for each 'snmpwalk' command, but for
every 'GETNEXT' request - i.e. each individual object.

You might find it sensible to use the cache helper to handle
loading (and re-loading) the table data.  That way, you can
control how long the cache is kept valid, and balance the
overheads involved with the up-to-dateness of the data.

Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
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: A question of net-snmp

2010-07-28 Thread AC.
  Dear sir(s),

I made a table for getting mibs information.
After my machine finished booting (the initial function was executed and was
finish),
I use snmptable function to get information.
The first time to get information, the
function,encTable_get_first_data_point, is called and get my external
information.
But the second time to get information, I just only get the old information
that got from the first time.
Why?
If I have to get my external information every time, Please tell me how to
do that.
Thanks.

Best regards,

Bluce.
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
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: A question about net-snmp agent extension

2009-09-22 Thread Wes Hardaker
 On Thu, 17 Sep 2009 10:17:35 +0800, albens...@gdnt.com.cn said:

A And I think, if I want to use the default subhandler (e.g. use
A netsnmp_instance_int_handler for my integer object), only write the MIB
A file is OK, and no need to write the C/header file for registration.
A Because I don't want to register a custom subhandler. Am I right?

We actually have a bunch of tutorials online that show how to write code
for the agent.  You should start by reading them:

http://www.net-snmp.org/wiki/index.php/Tutorials
-- 
Wes Hardaker
Cobham Analytic Solutions

--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
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: A question about net-snmp agent extension

2009-09-17 Thread AlbenShao
Not sure if it’s sent successfully. Just re-send it for help.

 

Alben Shao

 

Guangdong Nortel 4G Design

ESN: 6-554-5301

 



From: Alben Shao 
Sent: 2009年9月17日 10:18
To: 'net-snmp-users@lists.sourceforge.net'
Subject: A question about net-snmp agent extension

 

Hi,

 

I want to write a custom extension to the core net-snmp agent. As the tutorial 
said, usually I need to 1) write a MIB file 2)Write the related C file 3) Write 
a header file.

And I think, if I want to use the default subhandler (e.g. use 
netsnmp_instance_int_handler for my integer object), only write the MIB file is 
OK, and no need to write the C/header file for registration. Because I don’t 
want to register a custom subhandler. Am I right?

Thanks!

 

Alben

 

--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf___
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: One question about net-snmp

2008-01-30 Thread Dave Shield
On 25/01/2008, Mike Ayers [EMAIL PROTECTED] wrote:
  We want to support duplicate attribute name in different
  table with different OID.

   You can have the same relative name for a column (attribute)
 in two different tables.

Just as long as the two tables are defined in different MIBs.
You can *no*t have the same MIB object name defined
twice within the same MIB.

In  general, it's probably best to try and avoid duplicating names
wherever possible.  (Unless you have good reason to do so).

  The usual convention is to have a common prefix for all the
column objects in a table - so it's immediately clear which
objects belong together.

For example -  if you had two tables (table1 and table2) with essentially
the same columns in each, the MIB object names might be something
like:

   -  t1index
   -  t1name
   -  t1rank
   -  t1serialNo
   -  t2index
   -  t2name
   -  t2rank
   -  t2serialNo

No problems with name clashes, it's clear which table a given column
belongs to, but the meaning of the various columns is still clear.

Dave

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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: One question about net-snmp

2008-01-25 Thread Mike Ayers
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Shang Linda-q19362
 Sent: Thursday, January 24, 2008 7:44 PM

 We want to support duplicate attribute name in different 
 table with different OID.

Yes, and no, depending on what you want.  You can have the same 
relative name for a column (attribute) in two different tables.  You can also 
use the column name from one table to index a second table, which is equivalent 
to a foreign key in database terms.  In both cases, the column number of the 
OID need not be the same.


HTH,

Mike

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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