RE: Building snmpdemoapp error

2015-07-13 Thread Chetcuti, Christian
Hi I am running this on a 64-bit Windows 7, with gcc 4.8.1 using MinGW and 
net-snmp version 5.5.

Any help would be appreciated.



-Original Message-
From: Taylor, Ben [mailto:ben.tay...@sap.com]
Sent: Monday, July 13, 2015 5:16 PM
To: Chetcuti, Christian
Subject: RE: Building snmpdemoapp error


You might update the list by telling them what OS/revision/compiler toolchain 
you're using, as well as which netsnmp source you're using.  Your message makes 
an assumption that someone would understand the problem with the limited 
information.

Regards,

Ben

-Original Message-
From: Chetcuti, Christian [mailto:cchetc...@hobsoft.com.mt]
Sent: Monday, July 13, 2015 10:29 AM
To: 'Coders List'
Subject: RE: Building snmpdemoapp error

Dear all,

I've installed net-snmp successfully on my system.  I am now trying to 
understand snmp communication through the use of the simple demo application 
found on the website.  I've added the source file and the respective makefile.  
When I pass the make command the following is the returned response:

C:\usr\includemake snmpdemoapp
gcc -I. `net-snmp-config --cflags`   -c -o snmpdemoapp.o snmpdemoapp.c
/bin/sh: net-snmp-config: command not found In file included from 
snmpdemoapp.c:1:0:
./net-snmp/net-snmp-config.h:1555:26: error: expected '=', ',', ';', 'asm' or 
'_ _attribute__' before 'uint32_t'
 typedef unsigned __int32 uint32_t;
  ^
./net-snmp/net-snmp-config.h:1557:26: error: expected '=', ',', ';', 'asm' or 
'_ _attribute__' before 'uint64_t'
 typedef unsigned __int64 uint64_t;
  ^
./net-snmp/net-snmp-config.h:1558:1: error: unknown type name '__int64'
 typedef __int64 int64_t;
 ^
./net-snmp/net-snmp-config.h:1559:26: error: expected '=', ',', ';', 'asm' or 
'_ _attribute__' before 'uintmax_t'
 typedef unsigned __int64 uintmax_t;
  ^
./net-snmp/net-snmp-config.h:1560:1: error: unknown type name '__int64'
 typedef __int64 intmax_t;
 ^
In file included from ./net-snmp/session_api.h:265:0,
 from ./net-snmp/library/snmp_client.h:32,
 from ./net-snmp/varbind_api.h:79,
 from ./net-snmp/library/snmp_api.h:28,
 from ./net-snmp/types.h:387,
 from ./net-snmp/definitions.h:22,
 from ./net-snmp/net-snmp-includes.h:71,
 from snmpdemoapp.c:2:
./net-snmp/library/snmpUDPIPv6Domain.h:20:40: warning: 'struct sockaddr_in6' 
dec lared inside parameter list [enabled by default]
int local);
^
./net-snmp/library/snmpUDPIPv6Domain.h:20:40: warning: its scope is only this 
de finition or declaration, which is probably not what you want [enabled by 
default ]
./net-snmp/library/snmpUDPIPv6Domain.h:31:38: warning: 'struct sockaddr_in6' 
dec lared inside parameter list [enabled by default]
  int remote_port);
  ^
In file included from ./net-snmp/session_api.h:268:0,
 from ./net-snmp/library/snmp_client.h:32,
 from ./net-snmp/varbind_api.h:79,
 from ./net-snmp/library/snmp_api.h:28,
 from ./net-snmp/types.h:387,
 from ./net-snmp/definitions.h:22,
 from ./net-snmp/net-snmp-includes.h:71,
 from snmpdemoapp.c:2:
./net-snmp/library/snmpTCPIPv6Domain.h:20:8: warning: 'struct sockaddr_in6' 
decl ared inside parameter list [enabled by default]
int local);
^
In file included from ./net-snmp/utilities.h:39:0,
 from ./net-snmp/net-snmp-includes.h:74,
 from snmpdemoapp.c:2:
./net-snmp/library/system.h:85:59: warning: 'struct timezone' declared inside 
pa rameter list [enabled by default]
 int gettimeofday(struct timeval *, struct timezone *tz);
   ^
make: *** [snmpdemoapp.o] Error 1

Does anyone know how I can solve this problem?

Thanks in anticipation.

Regards,
Chris

-Original Message-
From: Robert Story [mailto:rst...@freesnmp.com]
Sent: Friday, July 10, 2015 6:55 PM
To: SHAIK, Sofiya Parvin (Sofiya Parvin); Coders List
Subject: Re: Need some Help to understand get_first and get_next methos calls.

On Fri, 10 Jul 2015 05:27:56 + Sofiya Parvin (Sofiya Parvin) wrote:
SSPP Could you please help me. How snmptable command will internally
SSPP calling get_first and get_next method. What is the exact code flow.

snmptable doesn't call get_first and get_next. Thos are part of the 
handler/helper you are using in the agent. snmptable uses snmp GETNEXT commands 
to walk a table.

SSPP Because in one of our project we are using this snmptable command
SSPP and we are writing our own sub agent to store the data snmptable.
SSPP If I see the trace files whenever there is a snmptable command is
SSPP triggered it is sequentially 

Re: Need some Help to understand get_first and get_next methos calls.

2015-07-13 Thread Robert Story
On Mon, 13 Jul 2015 09:17:28 + Sofiya Parvin (Sofiya Parvin)
 Thanks for the information can u please suggest us better way of
 sorting large table data.

You didn't answer my question about which helper you are using. If
it is the iterator helper or the create-dataset helper, then you
should consider one of the helps which uses net-snmp containers
(and optionally a cache). The table_data helper would be fairly
similar in style, while the mfd helper is much more verbose and
does a lot of hand-holding and behind-the-scenes work for you.

How you use a container and whether or not you use a cache depends
heavily on your data source. Is all data kept in the agent process,
or is it external (file, internal API)? Is the data already in the
order needed by the MIB module?


Robert

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


RE: Building snmpdemoapp error

2015-07-13 Thread Chetcuti, Christian
Dear all,

I've installed net-snmp successfully on my system.  I am now trying to 
understand snmp communication through the use of the simple demo application 
found on the website.  I've added the source file and the respective makefile.  
When I pass the make command the following is the returned response:

C:\usr\includemake snmpdemoapp
gcc -I. `net-snmp-config --cflags`   -c -o snmpdemoapp.o snmpdemoapp.c
/bin/sh: net-snmp-config: command not found
In file included from snmpdemoapp.c:1:0:
./net-snmp/net-snmp-config.h:1555:26: error: expected '=', ',', ';', 'asm' or '_
_attribute__' before 'uint32_t'
 typedef unsigned __int32 uint32_t;
  ^
./net-snmp/net-snmp-config.h:1557:26: error: expected '=', ',', ';', 'asm' or '_
_attribute__' before 'uint64_t'
 typedef unsigned __int64 uint64_t;
  ^
./net-snmp/net-snmp-config.h:1558:1: error: unknown type name '__int64'
 typedef __int64 int64_t;
 ^
./net-snmp/net-snmp-config.h:1559:26: error: expected '=', ',', ';', 'asm' or '_
_attribute__' before 'uintmax_t'
 typedef unsigned __int64 uintmax_t;
  ^
./net-snmp/net-snmp-config.h:1560:1: error: unknown type name '__int64'
 typedef __int64 intmax_t;
 ^
In file included from ./net-snmp/session_api.h:265:0,
 from ./net-snmp/library/snmp_client.h:32,
 from ./net-snmp/varbind_api.h:79,
 from ./net-snmp/library/snmp_api.h:28,
 from ./net-snmp/types.h:387,
 from ./net-snmp/definitions.h:22,
 from ./net-snmp/net-snmp-includes.h:71,
 from snmpdemoapp.c:2:
./net-snmp/library/snmpUDPIPv6Domain.h:20:40: warning: 'struct sockaddr_in6' dec
lared inside parameter list [enabled by default]
int local);
^
./net-snmp/library/snmpUDPIPv6Domain.h:20:40: warning: its scope is only this de
finition or declaration, which is probably not what you want [enabled by default
]
./net-snmp/library/snmpUDPIPv6Domain.h:31:38: warning: 'struct sockaddr_in6' dec
lared inside parameter list [enabled by default]
  int remote_port);
  ^
In file included from ./net-snmp/session_api.h:268:0,
 from ./net-snmp/library/snmp_client.h:32,
 from ./net-snmp/varbind_api.h:79,
 from ./net-snmp/library/snmp_api.h:28,
 from ./net-snmp/types.h:387,
 from ./net-snmp/definitions.h:22,
 from ./net-snmp/net-snmp-includes.h:71,
 from snmpdemoapp.c:2:
./net-snmp/library/snmpTCPIPv6Domain.h:20:8: warning: 'struct sockaddr_in6' decl
ared inside parameter list [enabled by default]
int local);
^
In file included from ./net-snmp/utilities.h:39:0,
 from ./net-snmp/net-snmp-includes.h:74,
 from snmpdemoapp.c:2:
./net-snmp/library/system.h:85:59: warning: 'struct timezone' declared inside pa
rameter list [enabled by default]
 int gettimeofday(struct timeval *, struct timezone *tz);
   ^
make: *** [snmpdemoapp.o] Error 1

Does anyone know how I can solve this problem?

Thanks in anticipation.

Regards,
Chris

-Original Message-
From: Robert Story [mailto:rst...@freesnmp.com]
Sent: Friday, July 10, 2015 6:55 PM
To: SHAIK, Sofiya Parvin (Sofiya Parvin); Coders List
Subject: Re: Need some Help to understand get_first and get_next methos calls.

On Fri, 10 Jul 2015 05:27:56 + Sofiya Parvin (Sofiya Parvin) wrote:
SSPP Could you please help me. How snmptable command will internally
SSPP calling get_first and get_next method. What is the exact code flow.

snmptable doesn't call get_first and get_next. Thos are part of the 
handler/helper you are using in the agent. snmptable uses snmp GETNEXT commands 
to walk a table.

SSPP Because in one of our project we are using this snmptable command
SSPP and we are writing our own sub agent to store the data snmptable.
SSPP If I see the trace files whenever there is a snmptable command is
SSPP triggered it is sequentially calling
SSPP
SSPP getFirst , getNext.;
SSPP getfirst,getNext.;
SSPP getfirst,getNext.;
SSPP
SSPP we are not understanding what is the purpose of calling this

Is your table using the iterator helper? The iterator help is for unsorted 
data, which means the help has to search through all the data, starting at the 
beginning, to find the data needed to respond to a request.

SSPP could u please help us why. Because this getFirst and getNext  are
SSPP making performance issue when the table is Huge ...example some
SSPP 10,000 entries.

Yes, the iterator helper is a poor choice for a large table. You should look at 
some of the other helpers which will sort the data, make it much faster to find 

Re: making the cache timeout for container_load to be configurable

2015-07-13 Thread Robert Story
On Fri, 10 Jul 2015 07:14:47 +0100 Tim wrote:
TC I've no problem giving it a shout.
TC 
TC If you could give me some guideance that would really help.

Ok, first the config token to specify the timeout. Take a look
at  ./agent/mibgroup/mibII/vacm_conf.c and search on
vacm_parse_view. You should see code to register a config token
(view), and to parse the view line (including parsing an OID,
which will be the OID of the table). Register a new token
(myTableCacheTimeout) int your table's init routine, with a new
parse routine that parses an OID and an integer timeout.

Once you have an OID, netsnmp_cache_find_by_oid should find the
cache. Then set cache_entry-timeout to the timeout value you
parsed, and you should be all set.

Hopefully that will get you started. Ask questions when you get
stuck.

Robert

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: pass_persist and session information

2015-07-13 Thread Robert Story
 I am using version 5.4.2.1 that services SNMP version 3
 requests [..and..] the application needs to know the
 user (securityName) associated with the SNMP request [...]

 The process of obtaining and releasing write control are both
 performed via separate  SNMP requests.

Are those also pass_persist requests?

 I have looked for the session information in pass_persist.c but
 it does not appear to be available.

That's correct, it isn't. Pass persist uses the old-style api,
which pre-dates snmp v3.  

RS Does anyone know a way I can get the securityName from within
RS pass_persist.c? If this is not possible, then modifying the
RS code may be the way to go. Any pointers or suggestions as to
RS what I would need to change would be highly appreciated.

The only way I can think of is with a global variable. You can
register a handler (above the old_api handler) that can pull the
user from reqinfo-asp-orig_pdu-securityName and save it,
clearing it again after lower handlers have been called. Not
pretty, but it might work.

Robert

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: How to capture ipv6 address from a snmp trap

2015-07-13 Thread Robert Story
On Thu, 28 May 2015 18:41:04 +0530 Ajit wrote:
AA I have successfully configured and run snmptrapd to capture
AA snmp v2 and v3 traps. But, the agent_addr field from snmp_pdu
AA doesn't contain ip address in case of ipv6. So, How can I get
AA the ip address ?

What release are you using?

AA Also, is there any way to capture the traps whithout using
AA engine id ?. It gives me Unknown USM username until I add a
AA usmUser along with its engineId to the snmptrapd.conf file.

The only way around this is to disable authorization and allow all
traps.


Robert

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Integer64 for UCD-SNMP-MIB::Memory

2015-07-13 Thread Niels Baggesen
Den 16-05-2015 kl. 12:29 skrev Philipp Helo Rehs:
 Hello,
 i am running NetSNMP (version 5.5 Redhat 6.6) on a big shared memory
 system by SGI (UV2000 with 8 TB ram) but the memory counters of
 UCD-SNMP-MIB are just 32bit so it is not possible to get correct results.

Thanks for raising this. I have created a patch for this, and as I do
not have the HW to test this, I hope you will test it for me :-)

Please see https://sourceforge.net/p/net-snmp/patches/1305/

/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders