James Gosnell | 1 May 2012 19:42
Picon
Gravatar

Best practice for 'net-snmp-config --base-cflags' returning multiple instances of Net-SNMP?

Hello,

I have multiple versions of Net-SNMP on my Mac OS X it seems. One install comes with the Mac OS X and another install is one from the Homebrew port system.

The deeper issue is where when i run 'make -f myTable_Makefile', everything compiles without errors, but I get runtime issues, like no return values on an snmp get request. Along with a dev, I found the problem was that `net-snmp-config --base-cflags' returns multiple values to my Makefile and that I have something like this when I run `net-snmp-config --base-cflags':

net-snmp-config --base-cflags
-DNETSNMP_ENABLE_IPV6 -g -Os -pipe -DBUILD=132 -DMACOSX_DEPLOYMENT_TARGET=10.7 -F/System/Library/PrivateFrameworks/ -F/System/Library/Frameworks/ -Udarwin11 -Ddarwin11=darwin11 -I/usr/local/include

When I do a search 'sudo find / -name net-snmp-config.h' I get returned the multiple instances of the header:

new-host-4:mib james$ sudo find / -name net-snmp-config.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/net-snmp/net-snmp-config.h
/Developer/SDKs/MacOSX10.7.sdk/usr/include/net-snmp/net-snmp-config.h
/usr/include/net-snmp/net-snmp-config.h

Is there a best practice for returning the most recent library on a system that has multiple instances of Net-SNMP installed? I think the lib binary might also have a similar issue, but I'm not sure.
--
James Gosnell, ACP
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
boers7 | 2 May 2012 13:29
Picon

INFORMS via netsnmpagent library

Hi,

I'm trying to send an INFORM via netsnmpagent library but it doesn't work as
expected.
If I run a snmptrapd I get the INFORM and everything looks good.
If I don't run the snmptrapd I would expect that the INFORM is sent multiple
times (until it gets acknowledged) but this is not the case.

I have the following setup:
- standalone C++ app linking libnetsnmpagent libnetsnmp libnetsnmphelpers
- init is done with: init_snmp, init_traps, snmp_enable_filelog,
netsnmp_set_agent_starttime
- a trap session is created with: create_trap_session(hostAndPort, 0 ,
communityStr, SNMP_VERSION_2c, SNMP_MSG_INFORM);
- the inform is sent with: send_v2trap(netsnmp_variable_list);
- cleanup: snmpd_free_trapsinks, snmp_shutdown

What am I doing wrong?

Best regards,
Boers

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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

Stéphane Charette | 3 May 2012 07:34
Picon
Gravatar

snmpd listening on a random UDP port

Any idea why snmpd would listen on a different UDP port every time it is restarted?

Things are working for us on Ubuntu, but on our Debian Lenny devices running net-snmp v5.4.1 the same configuration results in snmpd opening 2 udp listening ports instead of the single port we'd expect.

For example, if the IP address of the box is 192.168.1.111, this is what we see:

# netstat -lnup | grep snmp
udp        0      0 0.0.0.0:63493           0.0.0.0:*                           5031/snmpd     
udp        0      0 192.168.1.111:161       0.0.0.0:*                           5031/snmpd     
udp        0      0 127.0.0.1:162           0.0.0.0:*                           5035/snmptrapd 

Having snmpd on port 161 and snmptrapd on port 162 is expected.  What I cannot figure out is why snmpd is also listening on all interfaces on port 63493.  Every time I run "/etc/init.d/snmpd restart" that stray UDP port keeps changing to some seemingly random value.

Here are parts of what I think are the relevant configuration files:

# cat /etc/default/snmpd
export MIBDIRS=/usr/share/snmp/mibs
SNMPDRUN=yes
SNMPDOPTS='-Lf /dev/null -u snmp -g snmp -I-smux -p /var/run/snmpd.pid'
TRAPDRUN=yes
TRAPDOPTS='-Lf /dev/null -u snmp -g snmp -p /var/run/snmptrapd.pid'
SNMPDCOMPAT=yes

# head -7 /etc/snmp/snmpd.conf
file /var/log/snmp.log 1
agentuser      snmp
agentgroup     snmp
agentaddress   udp:192.168.1.111:161,tcp:192.168.1.111:161
# agentxsocket tcp:localhost:705
master         agentx
agentxtimeout  2

Thanks in advance for any pointers.

Stéphane Charette

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
Geoffrey Fournier | 3 May 2012 08:46
Picon
Favicon

Snmp agent process

Hi!
 
Thanks to the example i have write one integer in a MIB (nstAgentPluginBoject). This one is a dynamically loadable object. One host (unbuntu 10.04 with net-snmp 5.7) change the variable of the target MIB (for the moment another computer with the same configuration as previously).  I want to display on the target a message in the consol each time the value has been modified. I am not sure about the way. I have reuse the simple example (given in the net-snmp website) launched on the target in order to be connected locally and try to observe when there is a change. I am not sure it's efficient or not. Is there another way?
 
Moreover, i have another question if i want to read an important amout of data and i have a table is it possible to recover all the table or a part of the table in one command?
 
Thanks you.
 
Best regards
Fournier Geoffrey (sorry for my english :s)
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
Nigam, Sandeep | 2 May 2012 19:23

Master Agent mibs

Hi,

 

We are using some agentx sub agents with a central master agent. This question is about the mibs that master agent knows about. Do we have to tell snmpd about mibs that sub agents use? I have tried using mibfile command in snmp.conf to list all the mibs and it works fine. Since sub agents register their respective mibs using Register_mib function call, does master still need access to actual mib files? Any pros or cons appreciated.

 

Thanks.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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 May 2012 11:00
Picon
Favicon

Re: snmpd listening on a random UDP port

On 3 May 2012 06:34, Stéphane Charette <stephanecharette <at> gmail.com> wrote:
> Any idea why snmpd would listen on a different UDP port every time it is
> restarted?

Have you got any trap destinations set up in the snmpd.conf file?
I have a feeling that these will each open a socket for communicating
with the remote trap receiver.   It's possible that this is what you are seeing.

Dave

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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

Markus Gaugusch | 3 May 2012 11:07
Picon
Favicon

Re: snmpd listening on a random UDP port

Hi Dave!

I'm also experiencing this "problem". Is there a way to configure the 
source port in order to avoid the changes?
(I'm using seccheck scripts from openSUSE, and they report changed 
listening ports, which leads to unnecessary mails every now and then).

thanks!
Markus

On May 3, Dave Shield <D.T.Shield <at> liverpool.ac.uk> wrote:

> On 3 May 2012 06:34, Stéphane Charette <stephanecharette <at> gmail.com> wrote:
>> Any idea why snmpd would listen on a different UDP port every time it is
>> restarted?
>
> Have you got any trap destinations set up in the snmpd.conf file?
> I have a feeling that these will each open a socket for communicating
> with the remote trap receiver.   It's possible that this is what you are seeing.
>
> Dave
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> 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
>
>
>

--

-- 
__________________    /"\
Markus Gaugusch       \ /    ASCII Ribbon Campaign
markus(at)gaugusch.at  X     Against HTML Mail
                       / \
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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 May 2012 11:08
Picon
Favicon

Re: Master Agent mibs

On 2 May 2012 18:23, Nigam, Sandeep <SNigam <at> enghouse.com> wrote:
> We are using some agentx sub agents with a central master agent. This
> question is about the mibs that master agent knows about. Do we have to tell
> snmpd about mibs that sub agents use?

When the sub-agent connects, it will tell the master agent which portions
of the OID tree it wishes to be responsible for.   This is all that the master
agent needs to know.
   Any request for one of those OIDs will be passed to the subagent.  The
master agent doesn't need any more details about the structure, syntax or
semantics about that particular MIB (or MIB fragment).

>                                I have tried using mibfile command in
> snmp.conf to list all the mibs and it works fine.

Note that 'snmp.conf' is really concerned with how clients work - in particular
MIB files are used for translating between names and numbers.   (Almost)
everything will work fine without them - you just don't get "meaningful" names
in the output.

>                                                     Since sub agents register
> their respective mibs using Register_mib function call, does master still
> need access to actual mib files?

The master agent doesn't need MIB files at all - not even for MIBs that it
implements internally.
   See the FAQ entry
         Do I actually need the MIB files?
                 for more info

Dave

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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

James Gosnell | 3 May 2012 21:56
Picon
Gravatar

Re: Mib for dummies

What did you use for your 'mib2c' command before this?

On Thu, Apr 26, 2012 at 3:20 AM, Geoffrey Fournier <fournier <at> ece.fr> wrote:
Hi,

After to well configured my snmp, now i try to create a table of data used by my target to write some data float or integer. I am following the tutorial at this address http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/if-mib/ifTable/structures.html.
 
Everything goes fine until the make command:

make -f ifTable_Makefile
gcc -I. `net-snmp-config --base-cflags` -Wall -Wstrict-prototypes   -c -o ifTable_data_access.o ifTable_data_access.c
ifTable_data_access.c: In function `ifTable_container_load':
ifTable_data_access.c:316: error: `ifDescr_len' undeclared (first use in this function)
ifTable_data_access.c:316: error: (Each undeclared identifier is reported only once
ifTable_data_access.c:316: error: for each function it appears in.)
ifTable_data_access.c:316: error: `ifDescr' undeclared (first use in this function)
ifTable_data_access.c:328: error: `ifType' undeclared (first use in this function)
.

I couldn't find anything in the FAQ. Have i missed something? I am on ubuntu 10.04 and work with the v5.7.1 net-snmp.
 
Moreover i want to be sure how to load the program. On my target i need to modify the snmpd.conf and fill a line with proc or exec and the path to the program? Will it possible for my host computer to access to this data and modify it?
 
Thanks for your answer
 
The newbie n°1 ;)
 
Best regards
Fournier Geoffrey

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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




--
James Gosnell, ACP
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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
James Gosnell | 3 May 2012 22:24
Picon
Gravatar

using external data source with a structure with mib2c

I have separate program that will be serializing a struct and sending it to my mib2c generated agent. Since my structure is already in the MIB, I would think I could generate my C Struct for my separate program. Is there a best practice for this or is there a way you would recommend this to be done?

--
James Gosnell, ACP
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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