Re: SNMPTRAP doesn't work
On 24 July 2012 01:24, mohamad hosein jafari smhjafar...@gmail.com wrote: I set snmptrap configure and then I change these conf file but I can't fine /etc/default/snmptrap.conf First thing - are you talking about snmptrap or snmptrapd? These are very different! Secondly, /etc/default is typically provided by a vendor installation (rather than when using a setup compiled from source), and is used to configure the settings used for *starting* a service (i.e. the command line options). It's not normally a place to put the run-time configuration file. So when I run a snmptrap instruction on my agent this instruction run but I don't have anything in my log file What exactly do you mean by run a snmptrap instruction? What command(s) are you running here? 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
I run snmp trap demon and I get answer like this ]# snmptrapd -f -C -c /tmp/snmptrapd.conf -Le You are explicitly telling the trap receiver to use the configuration file '/tmp/snmptrapd.conf' (That's the meaning of the -c option) Have you created this file? /tmp/snmptrapd.conf: No such file or directory Probably not :-) - but about I think I have problem in snmptrapd.conf because when I run snmptrap I don't have any error Again - are you talking about snmptrap, or snmptrapd? What exactly do you mean by run snmptrap If you run the command snmptrap with no options, then you *will* get an error, because that's not valid. What is the *exact* command(s) that you are running? I set my snmptrapd.conf like this : logOption f /var/log/snmptraps.log authCommunity log,execute,net public And where is this file located? and in this path : /etc/sysconfig/snmpd.options I set like this : OPTIONS=-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a -x (MY IP) That file, and those options are relating to the SNMP agent ('snmpd'). They are nothing to do with either the trap receiver ('snmptrapd') or the trap sender ('snmptrap'). Please don't confuse the various elements - they are different commands used for different purposes, and controlled by different files. and also I turnd my IPtable off for test but I dont have anything in my log file after I run snmptrap . I TEST my request in debian and I get true answer but in CentOS I didn't get any answer Please report *exactly* what you are doing. There's simply not enough detail in what you have said so far. 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: problem with get_next when ipAddress as table index
On 24 July 2012 06:45, Naama Bar Menachem naama.barmenac...@novelsat.com wrote: I took your advice and tried a single getnext. No matter what index I write, it always receives 0,0,0,what-i-insert (the first 3 are received as 0, only the fourth is received properly). First of all - an apology. I've had a closer look at the library code, and build_oid_noalloc() does encode the whole index varbind list - not just a single value. (I must have been looking at build_oid_segment() instead!) Is my index read wrong? Does ipAddress saved in idx-val.integer ? Strictly speaking - no. It's saved as the first four octets of 'idx-val.string' Those two buffers actually overlap, so this may or may not be the same. But given that you're getting the wrong results, that would tend to indicate that they're not! One possibility springs to mind - are you working with a 64-bit system? It may be that you are settings the IP address as octets 5-8 of a 64-bit long variable, while the code that retrieves it is looking at octets 1-4. That would certainly explain the response OID that's generated. Try using 'snmp_set_var' to set the index varbind values for the three IP addresses. Have a look at agent/mibgroup/mibII/tcpTable.c for an example of working with IP Address values. 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
Thanks my friend I want to use snmptrap but I think first of all I should config snmptrapd on my server to receive snmp information on server .Am I Right??? Or Please tell me true thing I run snmp trap demon and I get answer like this ]# snmptrapd -f -C -c /tmp/snmptrapd.conf -Le You are explicitly telling the trap receiver to use the configuration file '/tmp/snmptrapd.conf' (That's the meaning of the -c option) Ok what is this problem? Have you created this file? /tmp/snmptrapd.conf: No such file or directory Probably not :-) No I can't find this file in this path . my snmptrapd.conf is in /etc/snmp/snmptrapd.conf . how I can make it in the path that you say? - but about I think I have problem in snmptrapd.conf because when I run snmptrap I don't have any error Again - are you talking about snmptrap, or snmptrapd? What exactly do you mean by run snmptrap If you run the command snmptrap with no options, then you *will* get an error, because that's not valid. What is the *exact* command(s) that you are running? I want to run snmp . I want to send information from agent to manager . I run this sample snmptrap -v 1 -c public 192.168.150.227 NET-SNMP-EXAMPLES-MIB::netSnmpExampleNotification 6 17 \netSnmpExampleInteger i 123456 I set my snmptrapd.conf like this : logOption f /var/log/snmptraps.log authCommunity log,execute,net public And where is this file located? in /etc/snmp/snmptrapd.conf I set this lines and in this path : /etc/sysconfig/snmpd.options I set like this : OPTIONS=-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a -x (MY IP) That file, and those options are relating to the SNMP agent ('snmpd'). They are nothing to do with either the trap receiver ('snmptrapd') or the trap sender ('snmptrap'). Please don't confuse the various elements - they are different commands used for different purposes, and controlled by different files. but I read in conf instruction level to set this line for agent and also I turnd my IPtable off for test but I dont have anything in my log file after I run snmptrap . I TEST my request in debian and I get true answer but in CentOS I didn't get any answer Please report *exactly* what you are doing. There's simply not enough detail in what you have said so far. I used this command for this work # /etc/init.d/iptables stop # chkconfig iptables off thanks for your help -- 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
On 24 July 2012 08:58, mohamad hosein jafari smhjafar...@gmail.com wrote: I want to use snmptrap but I think first of all I should config snmptrapd on my server to receive snmp information on server .Am I Right??? Correct my snmptrapd.conf is in /etc/snmp/snmptrapd.conf So why were you telling snmptrapd to look in /tmp ? If your snmptrapd.conf file is under /etc/snmp then try running snmptrapd -f -Le If that complains about no access control (and *only* if it complains) then try snmptrapd -c /etc/snmp/snmptrapd.conf -f -Le instead Run those command(s) - and please report back what it says. 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
I use these command and I get this answer: NET-SNMP version 5.3.2.2 couldn't open udp:162 -- errno 98 (Address already in use) On Tue, Jul 24, 2012 at 12:36 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote: On 24 July 2012 08:58, mohamad hosein jafari smhjafar...@gmail.com wrote: I want to use snmptrap but I think first of all I should config snmptrapd on my server to receive snmp information on server .Am I Right??? Correct my snmptrapd.conf is in /etc/snmp/snmptrapd.conf So why were you telling snmptrapd to look in /tmp ? If your snmptrapd.conf file is under /etc/snmp then try running snmptrapd -f -Le If that complains about no access control (and *only* if it complains) then try snmptrapd -c /etc/snmp/snmptrapd.conf -f -Le instead Run those command(s) - and please report back what it says. 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
On 24 July 2012 09:10, mohamad hosein jafari smhjafar...@gmail.com wrote: I use these command and I get this answer: NET-SNMP version 5.3.2.2 couldn't open udp:162 -- errno 98 (Address already in use) OK - that shows you've already got a trap receiver running. Shut that down, and try again 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
you means I use Killall snmptrap command? On Tue, Jul 24, 2012 at 12:41 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote: On 24 July 2012 09:10, mohamad hosein jafari smhjafar...@gmail.com wrote: I use these command and I get this answer: NET-SNMP version 5.3.2.2 couldn't open udp:162 -- errno 98 (Address already in use) OK - that shows you've already got a trap receiver running. Shut that down, and try again 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
and why I can't find /etc/default/snmptrap.conf ??? can you help me? On Tue, Jul 24, 2012 at 12:46 PM, mohamad hosein jafari smhjafar...@gmail.com wrote: you means I use Killall snmptrap command? On Tue, Jul 24, 2012 at 12:41 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote: On 24 July 2012 09:10, mohamad hosein jafari smhjafar...@gmail.com wrote: I use these command and I get this answer: NET-SNMP version 5.3.2.2 couldn't open udp:162 -- errno 98 (Address already in use) OK - that shows you've already got a trap receiver running. Shut that down, and try again 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Traphandler problem when snmptrapd runs a service
Following my query http://www.mail-archive.com/net-snmp-users@lists.sourceforge.net/msg29840.html I've discovered that 'execute' trap handling works fine if I start snmptrapd on the command line. If snmptrapd is running as a service however the 'execute' trap handling doesn't work (logging does still work). I would prefer to run it as a service. Any ideas why it doesn't work? Thanks Stuart Matson This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. -- 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
On 24 July 2012 09:16, mohamad hosein jafari smhjafar...@gmail.com wrote: you means I use Killall snmptrap command? No You are still getting confused between snmptrap and snmptrapd snmptrapd is the trap receiver - the program that runs all the time, listening for incoming traps and processing/logging them. snmptrap is used for generating traps - a command-line tool that is run individually. snmptrap sends the trap to snmptrapd Note the 'd' at the end of the name - this stands for daemon. It's the daemon (snmptrapd) that's running all the time, which is blocking the (new) daemon that you are trying to start. So it's the daemon that you need to shut down. Try killall snmptrapd Please try to keep these two clear in your mind (and in your messages). The potential for confusion if you mix them up is immense! 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: Traphandler problem when snmptrapd runs a service
On 24 July 2012 09:43, Matson, Stuart (UK) stuart.mat...@baesystems.com wrote: I’ve discovered that ‘execute’ trap handling works fine if I start snmptrapd on the command line. If snmptrapd is running as a service however the ‘execute’ trap handling doesn’t work (logging does still work). I would prefer to run it as a service. Any ideas why it doesn’t work? What are the permissions on the command(s) that you are trying to run? What user is the snmptrapd daemon running as? Your original message referred to running the 'reboot' command. Have you tried this with something simpler? (E.g. a shell script that simply logs the incoming data to a file) 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
RE: problem with get_next when ipAddress as table index
Hi Dave The problem was indeed solved when I got the indices from string as separated characters - (idx-val.string)[0], (idx-val.string)[1],... The set method stayed as it was and it works great! *(idx-val.integer) = key_pointer-dest_ip; Thank you! -Original Message- From: dave.shi...@gmail.com [mailto:dave.shi...@gmail.com] On Behalf Of Dave Shield Sent: Tuesday, July 24, 2012 10:51 AM To: Naama Bar Menachem Cc: net-snmp-users@lists.sourceforge.net Subject: Re: problem with get_next when ipAddress as table index On 24 July 2012 06:45, Naama Bar Menachem naama.barmenac...@novelsat.com wrote: I took your advice and tried a single getnext. No matter what index I write, it always receives 0,0,0,what-i-insert (the first 3 are received as 0, only the fourth is received properly). First of all - an apology. I've had a closer look at the library code, and build_oid_noalloc() does encode the whole index varbind list - not just a single value. (I must have been looking at build_oid_segment() instead!) Is my index read wrong? Does ipAddress saved in idx-val.integer ? Strictly speaking - no. It's saved as the first four octets of 'idx-val.string' Those two buffers actually overlap, so this may or may not be the same. But given that you're getting the wrong results, that would tend to indicate that they're not! One possibility springs to mind - are you working with a 64-bit system? It may be that you are settings the IP address as octets 5-8 of a 64-bit long variable, while the code that retrieves it is looking at octets 1-4. That would certainly explain the response OID that's generated. Try using 'snmp_set_var' to set the index varbind values for the three IP addresses. Have a look at agent/mibgroup/mibII/tcpTable.c for an example of working with IP Address values. 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
Thank yes I think because my agent and server is on 1 system I do your instruction to kill snmptrapd and then I rewrite that instruction snmptrapd -f -Le but my output take long time and I didn't receive anything so I stopped it this is my output NET-SNMP version 5.3.2.2 2012-07-23 17:26:38 NET-SNMP version 5.3.2.2 Stopped. -- On Tue, Jul 24, 2012 at 1:10 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote: On 24 July 2012 09:16, mohamad hosein jafari smhjafar...@gmail.com wrote: you means I use Killall snmptrap command? No You are still getting confused between snmptrap and snmptrapd snmptrapd is the trap receiver - the program that runs all the time, listening for incoming traps and processing/logging them. snmptrap is used for generating traps - a command-line tool that is run individually. snmptrap sends the trap to snmptrapd Note the 'd' at the end of the name - this stands for daemon. It's the daemon (snmptrapd) that's running all the time, which is blocking the (new) daemon that you are trying to start. So it's the daemon that you need to shut down. Try killall snmptrapd Please try to keep these two clear in your mind (and in your messages). The potential for confusion if you mix them up is immense! 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
On 24 July 2012 12:19, mohamad hosein jafari smhjafar...@gmail.com wrote: yes I think because my agent and server is on 1 system No - ther's absolutely no problem about running an SNMP agent and a trap receiver on the same system.They are different services, and listen on different network ports. They shouldn't interfere with each other in the slightest. I do your instruction to kill snmptrapd and then I rewrite that instruction snmptrapd -f -Le this is my output NET-SNMP version 5.3.2.2 Good - that seems to be working. but my output take long time and I didn't receive anything so I stopped it sigh No - please don't do that. You are quite correct - it's running for a long time. In fact it will keep running for ever, until you explicitly stop it. That's the whole point - you are running this as a trap receiver. It's expected to keep running - waiting to receive incoming traps, and logging them. It will do that for as long as the system is up. Eventually we'll look at having this run in the background, but for the time being - let's concentrate on checking that the basic sending/receiving of traps is working. Please re-start the 'snmptrapd' command again, and make sure it gives the same NET-SNMP version 5.3.2.2 output. (With no mention of access control) Assuming that works, and while it is still running in one terminal window. try running the snmptrap -v 1 -c public 192.168.150.227 NET-SNMP-EXAMPLES-MIB::netSnmpExampleNotification 6 17 \netSnmpExampleInteger i 123456 command you mentioned, in a different terminal window. Do you see anything in the first window? 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: SNMPTRAP doesn't work
yes I did it and in the first window I got Log of my snmptrap instruction thanks But excuse me I have another question : How I can senf snmptrap by windows Agent? can you help me? Thanks On Tue, Jul 24, 2012 at 4:40 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote: On 24 July 2012 12:19, mohamad hosein jafari smhjafar...@gmail.com wrote: yes I think because my agent and server is on 1 system No - ther's absolutely no problem about running an SNMP agent and a trap receiver on the same system.They are different services, and listen on different network ports. They shouldn't interfere with each other in the slightest. I do your instruction to kill snmptrapd and then I rewrite that instruction snmptrapd -f -Le this is my output NET-SNMP version 5.3.2.2 Good - that seems to be working. but my output take long time and I didn't receive anything so I stopped it sigh No - please don't do that. You are quite correct - it's running for a long time. In fact it will keep running for ever, until you explicitly stop it. That's the whole point - you are running this as a trap receiver. It's expected to keep running - waiting to receive incoming traps, and logging them. It will do that for as long as the system is up. Eventually we'll look at having this run in the background, but for the time being - let's concentrate on checking that the basic sending/receiving of traps is working. Please re-start the 'snmptrapd' command again, and make sure it gives the same NET-SNMP version 5.3.2.2 output. (With no mention of access control) Assuming that works, and while it is still running in one terminal window. try running the snmptrap -v 1 -c public 192.168.150.227 NET-SNMP-EXAMPLES-MIB::netSnmpExampleNotification 6 17 \netSnmpExampleInteger i 123456 command you mentioned, in a different terminal window. Do you see anything in the first window? 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@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users