Leila M | 1 Jan 2012 11:38
Picon

Re: SNMP request

Thank you so much for the answers
It was a problem with my agent; I reinstalled it and now it works well

2011/12/27, Leila M <mech.loulou <at> gmail.com>:
> hi,
>
> environment: gcc 4.5 under Ubuntu 11.04
> I'm trying to implement a C application that sends an snmp request
> (snmp get) to retrieve some information (variables) from the local MIB
> but when executing the program it seems that it is not able to get the
> response from the snmp agent
> any ideas? please help me
>
> thanks in advance
> leila
>

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

(Continue reading)

Leila M | 1 Jan 2012 11:50
Picon

adding MIBs

Hi,

I'm using net-snmp with gcc and I want to send requests to the snmp
agent to verify the value of some oid.
the problem is that the MIB containing those oids doesn't exist (in
the folder containing the MIB files i.e .../usr/share/mibs/).
how can I integrate mib files (other than the already existing ones)
to my application

thanks in advance
Leila

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Dave Shield | 1 Jan 2012 16:47
Picon
Favicon

Re: adding MIBs

On 1 January 2012 10:50, Leila M <mech.loulou <at> gmail.com> wrote:
> I'm using net-snmp with gcc and I want to send requests to the snmp
> agent to verify the value of some oid.
> the problem is that the MIB containing those oids doesn't exist (in
> the folder containing the MIB files i.e .../usr/share/mibs/).
> how can I integrate mib files (other than the already existing ones)
> to my application

Please see the FAQ entries
    How do I add a MIB to the tools?
and
    How do I add a MIB to the agent?

Note that if a given MIB file is not shipped at part of the Net-SNMP
distribution, then it is very likely that the Net-SNMP agent does not
implement this particular MIB.   Extending the agent to report this
information typically involves writing additional code to include within
the agent.
   See the FAQ and tutorials on the web site for more details.

Dave

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Net-snmp-users mailing list
(Continue reading)

Alasdair McWilliam | 2 Jan 2012 03:28

snmp_close on submitted requests

Hi list :)

I've been troubleshooting something for hours and can't quite put something together.

My app implements the net-snmp async API via the usual snmp_open / snmp_pdu_create / snmp_parse_oid /
snmp_add_var / snmp_async_send. I supply a callback to snmp_async_send() and an object containing data
that my callback needs to process the result.

In my scenario, I have an open session, and I've submitted a request via that session but it's not coming
back. In the normal flow of things, this request times out fine and my callback function is run, and it's
passed NETSNMP_CALLBACK_OP_TIMED_OUT. However, in certain circumstances I need to flush my app and
force it to dump data into it's backend data store. In these circumstances, I want to effectively "cancel"
the pending request as gracefully as possible, and free some objects (namely the data object that's been
passed to the SNMP API for callback).

>From what I understand I can just call snmp_close() and any requests waiting are freed up nicely. Looking
at the snmp_api.c code, snmp_close() should result in my callbacks being run immediately with
NETSNMP_CALLBACK_OP_TIMED_OUT. This is desirable because my app just treats it as an error and flushes
the whole request cleanly so I don't have any bad pointers.

The problem I'm having is that when I snmp_close() the sessions, my callback isn't triggering.
snmp_close() is returning OK, and it looks like the session is killed OK. However, because the callback
isn't triggered, the data object isn't getting dereferenced and I'm ultimately hitting my refcounter
logic telling me "you can't free this, it's referenced by something!"

Am I missing something? Perhaps I can't see the wood for the trees?! Or is there a better way to do what I want to
achieve without having to ignore my internal refcounting APIs??

SNMP lib version is 5.3.x (RHEL 5) - not had chance to test it against the latest and greatest upstream, but
need to target stock RHEL rpms.
(Continue reading)

Tao Zhou | 3 Jan 2012 15:31
Picon

compile net-snmp-5.7.1 under Cygwin reports error

'./configure' runs successful without problem, but when I try to 'make', it just reports below error message:
------------------------------------------------------------------------------------------------------------------------------------------------
making all in /home/Administrator/Studio/netsnmp/net-snmp-5.7.1/snmplib
make[1]: Entering directory `/home/Administrator/Studio/netsnmp/net-snmp-5.7.1/snmplib'
/bin/sh ../libtool  --mode=compile gcc -I../include -I.         -I../snmplib  -fno-strict-aliasing -g -O2 -Ucygwin -Dcygwin=cygwin  -c -o snmp_client.lo snmp_client.c
libtool: compile:  gcc -I../include -I. -I../snmplib -fno-strict-aliasing -g -O2 -Ucygwin -Dcygwin=cygwin -c snmp_client.c  -DDLL_EXPORT -DPIC -o .libs/snmp_client.o
snmp_client.c:839:17: operator '!=' has no left operand
snmp_client.c:850:47: operator '!=' has no left operand
snmp_client.c:863:46: operator '!=' has no left operand
snmp_client.c:874:18: operator '!=' has no left operand
Makefile:97: recipe for target `snmp_client.lo' failed
make[1]: *** [snmp_client.lo] Error 1
make[1]: Leaving directory `/home/Administrator/Studio/netsnmp/net-snmp-5.7.1/snmplib'
Makefile:651: recipe for target `subdirs' failed
make: *** [subdirs] Error 1

------------------------------------------------------------------------------------------------------------------------------------------------

I searched in Google without any luck, seems nobody has encountered the same problem, or no one is compiling net-snmp in Cygwin now?

my Cygwin setup is as below:
CYGWIN_NT-6.1 Cygwin 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin

gcc version:
$ gcc --version
gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)

If someone knows how to fix this problem, please kindly help me out of this problem, thanks!

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Dave Shield | 3 Jan 2012 17:55
Picon
Favicon

Re: snmptrap

    [ First - *please* don't mail me privately, without copying
any responses to the mailing list.  I don't have the time     or
inclination to offer private, unpaid, SNMP consultancy.     Keep
discussions to the list, where others can both learn     and offer
advice.  Thanks.   ]

On 3 January 2012 16:46, Simon Chamlian <simon.chamlian <at> gmail.com> wrote:
> I taught snmptrapd.conf is for snmptrapd (the trap daemon)?

Yes - that's quite correct.

But we have been discussing the use of "snmpinform" - i.e. sending
acknowledged SNMPv3 notifications to a trap receiver such as snmptrapd.

In this situation, the trap receiver (snmptrapd) is the "authoritative
SNMP engine",
so the SNMPv3 user must be known to that application.
   Hence if you're using snmptrapd, then you need to set up a 'createUser'
entry in the snmptrapd.conf file.

> Even if I don't use the trap daemon, I still need to configure the users in
> snmptrapd.conf?

If you are sending SNMPv3 informs to some receiving application,
then you need to configure the necessary users into that application.

If you're using snmptrapd, then this will be done using snmptrapd.conf
If you're using a different trap receiver, then you will need to consult the
documentation for that receiver to find out how to configure SNMPv3 users.

Dave

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Bart Van Assche | 3 Jan 2012 18:15
Picon
Favicon

Re: compile net-snmp-5.7.1 under Cygwin reports error

On Tue, Jan 3, 2012 at 2:31 PM, Tao Zhou <moonese <at> gmail.com> wrote:
'./configure' runs successful without problem, but when I try to 'make', it just reports below error message:
------------------------------------------------------------------------------------------------------------------------------------------------
making all in /home/Administrator/Studio/netsnmp/net-snmp-5.7.1/snmplib
make[1]: Entering directory `/home/Administrator/Studio/netsnmp/net-snmp-5.7.1/snmplib'
/bin/sh ../libtool  --mode=compile gcc -I../include -I.         -I../snmplib  -fno-strict-aliasing -g -O2 -Ucygwin -Dcygwin=cygwin  -c -o snmp_client.lo snmp_client.c
libtool: compile:  gcc -I../include -I. -I../snmplib -fno-strict-aliasing -g -O2 -Ucygwin -Dcygwin=cygwin -c snmp_client.c  -DDLL_EXPORT -DPIC -o .libs/snmp_client.o
snmp_client.c:839:17: operator '!=' has no left operand
snmp_client.c:850:47: operator '!=' has no left operand
snmp_client.c:863:46: operator '!=' has no left operand
snmp_client.c:874:18: operator '!=' has no left operand
Makefile:97: recipe for target `snmp_client.lo' failed
make[1]: *** [snmp_client.lo] Error 1
make[1]: Leaving directory `/home/Administrator/Studio/netsnmp/net-snmp-5.7.1/snmplib'
Makefile:651: recipe for target `subdirs' failed
make: *** [subdirs] Error 1

Looks the configure script failed to compute some of the SIZEOF_* constants, which is strange. Which result do you get for the command "grep SIZEOF_ config.status" ?

It should be something like this:

D["SIZEOF_SHORT"]=" 2"
D["SIZEOF_INT"]=" 4"
D["SIZEOF_LONG"]=" 8"
D["SIZEOF_LONG_LONG"]=" 8"
D["SIZEOF_INTMAX_T"]=" 8"
D["SIZEOF_SOCKADDR_UN_SUN_PATH"]=" 108"

Bart.
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Simon Chamlian | 3 Jan 2012 19:36
Picon

snmptrap/snmpinform port number

Hi,

snmpinform/snmptrap port number is set to 162 by default.

Is there any way we can change the port number through command line or it is hard coded?

If not possible in the command line, is it possible to change it in the code and re-compile (which file is it)?

Thanks,
Simon



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Dave Shield | 3 Jan 2012 20:04
Picon
Favicon

Re: snmptrap/snmpinform port number

On 3 January 2012 18:36, Simon Chamlian <simon.chamlian <at> gmail.com> wrote:
> snmpinform/snmptrap port number is set to 162 by default.
>
> Is there any way we can change the port number through command line or it is
> hard coded?

   $ man snmpcmd

   AGENT SPECIFICATION
       The string AGENT in the SYNOPSIS above specifies the remote SNMP entity
       with which to communicate.  This specification takes the form:

              [<transport-specifier>:]<transport-address>

           <transport-specifier>       <transport-address> format
           udp                         hostname[:port] or IPv4-address[:port]
           tcp                          hostname[:port] or IPv4-address[:port]

       Here are some examples, along with their interpretation:

       hostname:161            perform query using UDP/IPv4 datagrams to host-
                               name on port 161.  The ":161" is redundant here
                               since that is the  default  SNMP  port  in  any
                               case.

       udp:hostname            identical  to  the previous specification.  The
                               "udp:" is redundant here since UDP/IPv4 is  the
                               default transport.

       TCP:hostname:1161       connect to hostname on port 1161 using TCP/IPv4
                               and perform query over that connection.

Dave

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Lee | 4 Jan 2012 08:00
Picon

Re: compile net-snmp-5.7.1 under Cygwin reports error

On 1/3/12, Tao Zhou <moonese <at> gmail.com> wrote:
> './configure' runs successful without problem, but when I try to 'make', it
> just reports below error message:
     ... snip ...
> I searched in Google without any luck, seems nobody has encountered the
> same problem, or no one is compiling net-snmp in Cygwin now?

I just tried building net-snmp-5.7.1.tar.gz with cygwin & it works for me.

> my Cygwin setup is as below:
> CYGWIN_NT-6.1 Cygwin 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin

mine starts off with
  CYGWIN_NT-6.0-WOW64
but the rest is the same.

> gcc version:
> $ gcc --version
> gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)

same here

> If someone knows how to fix this problem, please kindly help me out of this
> problem, thanks!

There was a fairly recent thread on the cygwin mailing list for what
might be the same problem.  Turns out they used Winzip to unpack the
archive and that changed [some?] line endings to CRLF.  The suggested
fix on the mailing list was to use the cygwin command line tools to
unpack the archive but I used 7-Zip

Lee

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Gmane