Re: Sending traps using Perl

2011-10-14 Thread Ali . Bruce
I can send SNMPv2 traps succesfully and am now trying to send SNMPv3 traps using Authentication and No Privac y with SHA being used for Authentication. My code looks like the following: my $host = '127.0.0.1'; my $agent = new NetSNMP::agent(); my $session = new

Re: Sending traps using Perl

2011-10-05 Thread Bart Van Assche
On Tue, Oct 4, 2011 at 3:57 PM, ali.br...@selex-comms.com wrote: From Bart's statement below it is suggested that I can directly obtain the value of sysUpTime from my SubAgent - How do I obtain this from my Perl module? What the Perl SNMP module does is to include the time elapsed since

Re: Sending traps using Perl

2011-10-05 Thread Ali . Bruce
Bart, Thanks for that. The sysUpTime seems to be OK now. Do you know if the two patches that you have sent to me will be contained in any forthcoming releases? Regards, Ali Please consider the environment before printing this email --- This

Re: Sending traps using Perl

2011-10-05 Thread Bart Van Assche
On Wed, Oct 5, 2011 at 3:49 PM, ali.br...@selex-comms.com wrote: Thanks for that. The sysUpTime seems to be OK now. Do you know if the two patches that you have sent to me will be contained in any forthcoming releases? These patches will be included in all future 5.7 and 6.0 releases. And

Re: Sending traps using Perl

2011-10-05 Thread Bart Van Assche
On Wed, Oct 5, 2011 at 5:12 PM, Bart Van Assche bvanass...@acm.org wrote: On Wed, Oct 5, 2011 at 3:49 PM, ali.br...@selex-comms.com wrote: Thanks for that. The sysUpTime seems to be OK now. Do you know if the two patches that you have sent to me will be contained in any forthcoming

Re: Sending traps using Perl

2011-10-04 Thread Ali . Bruce
Dave, Sorry - Just realised that I've responded to your private e-mail address by mistake and not the net-snmp-users list Regards, Ali Please consider the environment before printing this email - Forwarded by Ali Bruce/UKMAIN/MM1 on 04/10/2011 14:55 - From: Ali Bruce/UKMAIN/MM1

Re: Sending traps using Perl

2011-10-02 Thread Dave Shield
On 29 September 2011 16:41, ali.br...@selex-comms.com wrote: The odd thing is that if I do an snmp Get request on my Agent on sysUpTime the correct time ticks value is returned i.e how long my Master Agent has been running. The unusual timeticks value seems to be only occurring when sending

Re: Sending traps using Perl

2011-09-30 Thread Ali . Bruce
Bart, Thanks for the patch. It seems to have solved the problem in sending SNMPv2 traps which do not have any additional var-binds. Only problem left is the sysUpTime issue. Regards, Ali Please consider the environment before printing this email

Re: Sending traps using Perl

2011-09-29 Thread Ali . Bruce
I have some further questions/observations on this subject. The reason that I have not been able to send my own Enterprise specific trap is that it does not have any additional var-binds associated with the trap i.e I want to send the trap with an empty associated var-bind list. e.g Bart in

Re: Sending traps using Perl

2011-09-29 Thread Fulko Hew
On Thu, Sep 29, 2011 at 5:26 AM, ali.br...@selex-comms.com wrote: I have some further questions/observations on this subject. The reason that I have not been able to send my own Enterprise specific trap is that it does not have any additional var-binds associated with the trap i.e I want to

Re: Sending traps using Perl

2011-09-29 Thread Ali . Bruce
Fulko, I understand your point that a LinkUp trap needs the additional ifIndex varbind. I didn't understand why the example I had been given by Bart also contained a sysDescr var-bind. My point is that I wish to send an enterprise specific trap that contains no additional var-binds. How do I

Re: Sending traps using Perl

2011-09-29 Thread Fulko Hew
On Thu, Sep 29, 2011 at 8:56 AM, ali.br...@selex-comms.com wrote: Fulko, I understand your point that a LinkUp trap needs the additional ifIndex varbind. I didn't understand why the example I had been given by Bart also contained a sysDescr var-bind. My point is that I wish to send an

Re: Sending traps using Perl

2011-09-29 Thread Ali . Bruce
Fulko, I also tried to send my trap (oid 1.3.6.1.4.1.2257.11.1.1.0.0.9) without any additional var-binds as an SNMPv1 trap and it worked. The problem seems to be sending it as an SNMPv2 trap, SNMPv1 is OK. As for the sysUpTime, each time I run the command the timeticks value has incremented

Re: Sending traps using Perl

2011-09-29 Thread Fulko Hew
On Thu, Sep 29, 2011 at 10:20 AM, ali.br...@selex-comms.com wrote: Fulko, I also tried to send my trap (oid 1.3.6.1.4.1.2257.11.1.1.0.0.9) without any additional var-binds as an SNMPv1 trap and it worked. The problem seems to be sending it as an SNMPv2 trap, SNMPv1 is OK. As for the

Re: Sending traps using Perl

2011-09-29 Thread Bart Van Assche
On Wed, Sep 28, 2011 at 6:23 PM, ali.br...@selex-comms.com wrote: DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (3384772387) 391 days, 18:08:43.87 SNMPv2-MIB::snmpTrapOID.0 = OID: IF-MIB::linkUp IF-MIB::ifIndex.1 = INTEGER: 1 SNMPv2-MIB::sysLocation.0 = STRING: Here The timeticks

Re: Sending traps using Perl

2011-09-29 Thread Ali . Bruce
Bart, I don't believe that is the problem. The actual amount that the timeticks increases between sending commands is correct, it's as if it's just not been initialised correctly. It doesn't seem to be a case of dividing the value by ten. Also, even rebooting my PC doesn't seem to have reset

Re: Sending traps using Perl

2011-09-29 Thread Bart Van Assche
On Thu, Sep 29, 2011 at 5:41 PM, ali.br...@selex-comms.com wrote: I don't believe that is the problem. The actual amount that the timeticks increases between sending commands is correct, it's as if it's just not been initialised correctly. It doesn't seem to be a case of dividing the value

Re: Sending traps using Perl

2011-09-28 Thread Ali . Bruce
I have now managed to send out an SNMPv1 trap correctly using the following code: my $host = '10.50.80.197'; my $comm = 'public'; my $session= new SNMP::TrapSession(DestHost = $host, Community = $comm, Port = 162, Version = 1);

Re: Sending traps using Perl

2011-09-28 Thread Bart Van Assche
On Wed, Sep 28, 2011 at 4:36 PM, ali.br...@selex-comms.com wrote: However I am still unable to send out an SNMP v2 trap. Also is there a way of obtaining the value for uptime from the Master Agent which is used for the SysUpTime field in the trap?? Have you already tried to leave out the

Re: Sending traps using Perl

2011-09-28 Thread Ali . Bruce
Bart, I'm definitely getting closer now. I can now send a linkUp trap from my software using SNMPv2. My code looks like this: my $host = '10.50.80.197'; my $session= new SNMP::TrapSession(DestHost = $host, Community = public, Port = 162, Version = '2c'); $session-trap(oid = linkUp,

RE: sending traps

2009-03-30 Thread sazid.mahammad
Conductor and Peripheral IPG); net-snmp-users@lists.sourceforge.net Subject: RE: sending traps Actually there are a lot of APIs provided by the net-snmp and I cant figure out the difference between them Some APIs start with the keyword netsnmp eg: netsnmp_send_traps, some start with the keyword

Re: sending traps

2009-03-30 Thread Dave Shield
2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: My sole purpose is to actually make an agent which would implement a get/set request on a MIB object and would also implement sending traps. OK - in that case Sazid is quite correct. You should use one of the agent trap API calls. Please

RE: sending traps

2009-03-30 Thread Tanisha Kashyap
] On Behalf Of Dave Shield Sent: Monday, March 30, 2009 4:01 PM To: Tanisha Kashyap Cc: sazid.maham...@wipro.com; net-snmp-users@lists.sourceforge.net Subject: Re: sending traps 2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: My sole purpose is to actually make an agent which would

Re: sending traps

2009-03-30 Thread Dave Shield
2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: What's the difference between a dynamically loaded module and a subagent. Whenever you're working with SNMP, you'll always have an agent - a process that is running all of the time, and will respond to requests for information. The question

RE: sending traps

2009-03-30 Thread Tanisha Kashyap
Subject: Re: sending traps 2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: What's the difference between a dynamically loaded module and a subagent. Whenever you're working with SNMP, you'll always have an agent - a process that is running all of the time, and will respond to requests

RE: sending traps

2009-03-30 Thread Tanisha Kashyap
-Original Message- From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf Of Dave Shield Sent: Monday, March 30, 2009 5:10 PM To: Tanisha Kashyap Cc: net-snmp-users@lists.sourceforge.net Subject: Re: sending traps 2009/3/30 Tanisha Kashyap tanisha.kash

RE: sending traps

2009-03-30 Thread Tanisha Kashyap
: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf Of Dave Shield Sent: Monday, March 30, 2009 5:26 PM To: Tanisha Kashyap Cc: net-snmp-users@lists.sourceforge.net Subject: Re: sending traps 2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: If I develop a subagent

RE: sending traps

2009-03-30 Thread Tanisha Kashyap
...@wipro.com Cc: net-snmp-users@lists.sourceforge.net Subject: Re: sending traps 2009/3/30 sazid.maham...@wipro.com: It depends upon you. You can send TRAP in same or write different . I would agree - you could either send the trap from within your application, or invoke the snmptrap command to do

Re: sending traps

2009-03-30 Thread Dave Shield
2009/3/30 sazid.maham...@wipro.com:  It depends upon you. You can send TRAP in same or write different . I would agree - you could either send the trap from within your application, or invoke the snmptrap command to do this. Coding this yourself is cleaner, while forking off snmptrap is

Re: sending traps

2009-03-30 Thread Dave Shield
2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: Whenever you're working with SNMP, you'll always have an agent - a process that is running all of the time, and will respond to requests for information. This agent is the net-snmp daemon snmpd? The Net-SNMP daemon snmpd is an example

Re: sending traps

2009-03-30 Thread Dave Shield
2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: If I develop a subagent then that would run independent of the master agent i.e. snmpd? It would run as a separate process to the master agent, yes. But it would be dependent on the master agent for being given requests to process. Will

RE: sending traps

2009-03-30 Thread Tanisha Kashyap
@lists.sourceforge.net Subject: Re: sending traps 2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com: Can you refer some reading material (apart from the net-snmp site) or some sample agent (preferable) so that I can go through it and finalize what approach to take and document it. No. I don't have any

Re: sending traps

2009-03-30 Thread Dave Shield
2009/3/30 Tanisha Kashyap tanisha.kash...@aricent.com:  Can you refer some reading material (apart from the net-snmp site) or some sample agent (preferable) so that I can go through it and finalize what approach to take and document it. No. I don't have any documentation I can point you

Re: Sending Traps for different destinations at the same time

2009-02-06 Thread Wes Hardaker
On Fri, 30 Jan 2009 13:52:01 -, Angela Lazaro angela.laz...@edisoft.pt said: AL I'm using net-snmp 5.3.2 and I'm trying to find a way to send traps to AL different destinations at the same time. So far I've tried to defined AL different trapsess in the snmpd.conf file (the configuration

Re: Sending Traps for different destinations at the same time

2009-01-31 Thread Dave Shield
2009/1/30 Angela Lazaro angela.laz...@edisoft.pt: ... if I want to use only SNMPv3, how can I send a multi destination trap? Use two trapsess directives. Each such line (be it trapsess, trapsink, etc) will configure a separate trap destination. If you have 28 such lines in your config file,

RE: Sending Traps for different destinations at the same time

2009-01-31 Thread Angela Lazaro
again, Ângela -Original Message- From: dave.shi...@googlemail.com on behalf of Dave Shield Sent: Sat 1/31/2009 10:50 AM To: Angela Lazaro Cc: net-snmp-users@lists.sourceforge.net; net-snmp-cod...@lists.sourceforge.net Subject: Re: Sending Traps for different destinations at the same time

Re: Sending Traps for different destinations at the same time

2009-01-30 Thread m.zeeshan
Hi everyone! I'm using net-snmp 5.3.2 and I'm trying to find a way to send traps to different destinations at the same time. So far I've tried to defined different trapsess in the snmpd.conf file (the configuration file for the agent) or pass multi destinations in the same trapsess in the

Re: sending traps

2008-06-13 Thread Dave Shield
2008/6/13 dan anderson [EMAIL PROTECTED]: In an attempt to send traps from a standalone, I've done the following: create_trap_session(localhost, 0, public, 1, SNMP_MSG_TRAP2); init_traps(); [ populate notification_vars ] send_v2trap(notification_vars); It's not clear what you mean by a

Re: sending traps

2008-06-13 Thread dan anderson
It's not clear what you mean by a standalone. The 'send_v2trap' routine is part of the agent API. If you're working with a standalone application, then this won't work. You'll need to use 'snmptrap.c' as a template in this case. Ah, thanks. I didn't realize that API calls would require a

RE: sending traps to NNM

2007-07-16 Thread [EMAIL PROTECTED]
further to my earlier request I can add that if I also use a -Ci option (inform) this is the response I receive... bash-3.00# snmptrap -v 2c -c public -Ci localhost ucdStart sysContact.0 s Dave snmpinform: Timeout (Sub-id not found: (top) - sysContact) Presumably this means the sent traps do

Re: Sending traps with dynamic destinations

2007-02-12 Thread Dave Shield
On 12/02/07, jin zhou [EMAIL PROTECTED] wrote: But I am afraid simply using : snmp_send( ss1, pdu ); snmp_send( ss2, pdu ); snmp_send( ss3, pdu ); can't send a trap with content pdu to different destinations ,because the routine snmp_send will free pdu automaticlly if succeed. Good point.

Re: Sending traps with dynamic destinations

2007-02-12 Thread jin zhou
Yes, it is a good idea of using snmp_clone_pdu to improve the efficiency of the codes.And because the num of trap receivers is not certain, so I use struct netsnmp_session *ss_head as a head of linked list,which is built before sending a series of traps and free at last.It seems like that

Re: Sending traps with dynamic destinations

2007-02-11 Thread jin zhou
Dear Dave, Thank you for your suggestions.But I am afraid simply using : snmp_send( ss1, pdu ); snmp_send( ss2, pdu ); snmp_send( ss3, pdu ); can't send a trap with content pdu to different destinations ,because the routine snmp_send will free pdu automaticlly if succeed.I have

Re: Sending traps with dynamic destinations

2007-02-09 Thread Dave Shield
[ 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

Re: Sending traps with dynamic destinations

2007-02-08 Thread Thomas Anders
jin zhou wrote: I choose using API routines snmp_pdu_create(SNMP_MSG_TRAP2) and snmp_send(ss,pdu) to send traps,while the session peername and port can be specified.But i meet the troulbe:it always send traps on port 161,even through i use the codesession.remote_port= SNMP_TRAP_PORT;,while

Re: Sending traps with dynamic destinations

2007-02-08 Thread jin zhou
net-snmp 5.2.3 ,working on Linux,thank you! Thomas Anders [EMAIL PROTECTED] 写道: jin zhou wrote: I choose using API routines snmp_pdu_create(SNMP_MSG_TRAP2) and snmp_send(ss,pdu) to send traps,while the session peername and port can be specified.But i meet the troulbe:it always send traps

Re: Sending traps with dynamic destinations

2007-02-08 Thread Dave Shield
On 08/02/07, jin zhou [EMAIL PROTECTED] wrote: I choose using API routines snmp_pdu_create(SNMP_MSG_TRAP2) and snmp_send(ss,pdu) to send traps,while the session peername and port can be specified.But i meet the troulbe:it always send traps on port 161 Specify the destination as

Re: Sending traps with dynamic destinations

2007-02-08 Thread jin zhou
Cleared~! OMG,it is so easy to you,but i can't think about it,thank you very much! And is the method I use the best way of resolving the problem of dynamic trap receiver?If I meet these questiones of API using angain,how can I find out the error quickly by myself? Dave Shield [EMAIL

Re: Sending traps with dynamic destinations

2007-02-08 Thread Dave Shield
On 08/02/07, jin zhou [EMAIL PROTECTED] wrote: And is the method I use the best way of resolving the problem of dynamic trap receiver? Probably, yes. The alternative would be to manipulate the contents of the snmpNotifyTable and snmpTargetTable - but that would affect *all* traps sent by the

Re: sending traps from embedded AgentX subagent

2007-01-15 Thread Dave Shield
On 20/12/06, Srivastava, Namburi (IE10) [EMAIL PROTECTED] wrote: These are the packet dumps I got even after changing the socket through which the master and sub-agent communicate. Hmmm... Looking back at the previous conversation, you were talking about configuring the Master and subagent to

Re: sending traps from embedded AgentX subagent

2006-12-19 Thread Dave Shield
On 18/12/06, Srivastava, Namburi (IE10) [EMAIL PROTECTED] wrote: Okay, so in that case if I add the following line of code in my Subagent before init_subagent() netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET, /var/agentx/master); Does

RE: sending traps from embedded AgentX subagent

2006-12-19 Thread Srivastava, Namburi (IE10)
: sending traps from embedded AgentX subagent On 18/12/06, Srivastava, Namburi (IE10) [EMAIL PROTECTED] wrote: Okay, so in that case if I add the following line of code in my Subagent before init_subagent() netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID

RE: sending traps from embedded AgentX subagent

2006-12-19 Thread Srivastava, Namburi (IE10)
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Shield Sent: Tuesday, December 19, 2006 2:53 AM To: Srivastava, Namburi (IE10) Cc: David Arthur; net-snmp-users@lists.sourceforge.net Subject: Re: sending traps from embedded AgentX subagent On 18/12/06, Srivastava, Namburi (IE10

RE: sending traps from embedded AgentX subagent

2006-12-18 Thread David Arthur
to use the /var/agentx/master route.) Thanks again, David Arthur -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Shield Sent: Thursday, December 14, 2006 5:15 PM To: David Arthur Cc: net-snmp-users@lists.sourceforge.net Subject: Re: sending traps from

RE: sending traps from embedded AgentX subagent

2006-12-18 Thread Srivastava, Namburi (IE10)
PROTECTED] On Behalf Of David Arthur Sent: Monday, December 18, 2006 2:40 PM To: net-snmp-users@lists.sourceforge.net Subject: RE: sending traps from embedded AgentX subagent Dave, Thank you for the help debugging this AgentX connection. For the benefit of other list members: Be sure that both ends

Re: sending traps from embedded AgentX subagent

2006-12-18 Thread Dave Shield
On 18/12/06, Srivastava, Namburi (IE10) [EMAIL PROTECTED] wrote: How do I find to which socket does the sub-agent is trying to connect??? The easiest way is probably to turn on packet dumps in the subagent. Then you can check the header line of the dump (Sending N bytes to {somewhere}) Try

RE: sending traps from embedded AgentX subagent

2006-12-18 Thread Srivastava, Namburi (IE10)
. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Shield Sent: Monday, December 18, 2006 3:10 PM To: Srivastava, Namburi (IE10) Cc: David Arthur; net-snmp-users@lists.sourceforge.net Subject: Re: sending traps from embedded AgentX subagent On 18/12/06, Srivastava

Re: sending traps from embedded AgentX subagent

2006-12-18 Thread Dave Shield
On 18/12/06, Srivastava, Namburi (IE10) [EMAIL PROTECTED] wrote: I have tried doing that... This is the output I got after agentx/master initialization was done Sending 46 bytes to 192.168.254.1 Then this is the socket to which the subagent is trying to send AgentX requests. I.e. a network

RE: sending traps from embedded AgentX subagent

2006-12-18 Thread Srivastava, Namburi (IE10)
to? Regards, Sri. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Shield Sent: Monday, December 18, 2006 4:50 PM To: Srivastava, Namburi (IE10) Cc: David Arthur; net-snmp-users@lists.sourceforge.net Subject: Re: sending traps from embedded AgentX subagent

Re: sending traps from embedded AgentX subagent

2006-12-14 Thread Dave Shield
On 14/12/06, David Arthur [EMAIL PROTECTED] wrote: I am unable to get traps from an embedded subagent. init_agent(agentSNMPAlert); // init agent library init_agentSNMPAlert();// run MIB module init init_snmp(agentSNMPAlert); // init

RE: sending traps from embedded AgentX subagent

2006-12-14 Thread David Arthur
Arthur Cc: net-snmp-users@lists.sourceforge.net Subject: Re: sending traps from embedded AgentX subagent On 14/12/06, David Arthur [EMAIL PROTECTED] wrote: I am unable to get traps from an embedded subagent. init_agent(agentSNMPAlert); // init agent library init_agentSNMPAlert

Re: sending traps from embedded AgentX subagent

2006-12-14 Thread Dave Shield
On 14/12/06, David Arthur [EMAIL PROTECTED] wrote: The send_easy_trap(5, 0) call is made after the init_xxx() calls and the agent processing loop is started. In the code fragment you posted, the send_easy_trap(5, 0) call is only made after the agent processing loop has *finished*. At which

Re: sending traps from embedded AgentX subagent

2006-12-14 Thread Dave Shield
[ 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

RE: sending traps from embedded AgentX subagent

2006-12-14 Thread David Arthur
Dave, My apologies for the private email a bit ago, was unintentional reply button haste...won't happen again! OK - try running the master agent with the '-d' flag. Does it see the trap request coming from the subagent? This is what I get if I start with snmpd -d -Dagentx -mall: No log

Re: sending traps from embedded AgentX subagent

2006-12-14 Thread Dave Shield
On 14/12/06, David Arthur [EMAIL PROTECTED] wrote: OK - try running the master agent with the '-d' flag. Does it see the trap request coming from the subagent? This is what I get if I start with snmpd -d -Dagentx -mall: Just to check - this is the master agent you are running here, yes?

Re: Sending traps

2005-05-03 Thread Dave Shield
On Mon, 2005-05-02 at 16:20, Mauricio Reyes wrote: I need to calculate the network utilization that my agent uses when sending notification traps to the manager. Is there a way to calculate the amount of bytes used by a trap? That depends on what's in the trap! The simplest way to calculate

Re: Sending traps from an agentX subagent, and snmpd robustness

2004-11-22 Thread Users
On Mon, 22 Nov 2004 13:27:02 +1100 Russell wrote: RB I couldn't use agent_check_and_process() to wait for events because RB it ignores fd's registered with register_readfd(). Only receive() RB in snmpd.c uses external_readfd[]. Gack. We need to fix that... RB A separate question. The main

Re: Sending traps from an agentX subagent, and snmpd robustness

2004-11-21 Thread Russell Bell
I asked last week how best to send traps from an agentX subagent, where the trap originates in a separate thread from the main SNMP thread. With Rob Storey's help I've arrived at the the following solution, which works fine so far. In summary, the main thread creates a pipe, and the main loop

Re: Sending traps from an agentX subagent

2004-11-17 Thread Users
First of all, please post a new message, instead of replying to the digest and quoting the entire (unrelated!) digest. On Wed, 17 Nov 2004 18:30:04 +1100 Russell wrote: RB The subagent process is multi-threaded. Raising a trap works fine if I do RB it in the main thread [...] RB But, if I call

Re: Sending traps in another thread

2004-10-28 Thread Dave Shield
Robert Ok, lets see if I got this right. You have the main agent thread, Robert and two worker threads. The worker threads don't do any SNMP other Robert than to call send_v2trap. Is that right? Gary Yep you got it. Urk! I'm not sure that's safe. As far as I remember, doesn't the

Re: Sending traps in another thread

2004-10-28 Thread Vili Germic
Hi, Thanks to all, I'm also using Redhat9, pthread an mutex locking, anyway.. I create single session in thread for sending traps (not in main thread whrere sub agent is running). I'm using "Single session API" functions: snmp_sess_open(), snmp_sess_send() and snmp_sess_close() to manage

Re: Sending traps in another thread

2004-10-28 Thread Dave Shield
I couldn't find function to create pdu for Single API use, so I asumed that snmp_pdu_create() function is thread safe!? Correct. Creating a PDU structure is safe enough. It's what you then *do* with it that needs care Dave PS: Please - no HTML mail.

Re: Sending traps in another thread

2004-10-28 Thread Users
On Thu, 28 Oct 2004 12:06:06 +0200 Vili wrote: VG if (pPdu != NULL) VG snmp_free_pdu(pPdu); //Here is the problem (segmentation fault)! VG (if I comment this line, works fine!) That's the problem. You are unconditionally deleting the PDU. You should only delete the PDU if you get an

Re: Sending traps in another thread

2004-10-28 Thread Users
On Thu, 28 Oct 2004 09:39:43 +0100 Dave wrote: DS Robert Ok, lets see if I got this right. You have the main agent thread, DS Robert and two worker threads. The worker threads don't do any SNMP other DS Robert than to call send_v2trap. Is that right? DS DS Gary Yep you got it. DS DS Urk! I'm

Re: Sending traps in another thread

2004-10-28 Thread Gary Clark
(Users) [EMAIL PROTECTED] Cc: Gary Clark [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, October 28, 2004 8:06 AM Subject: Re: Sending traps in another thread On Thu, 28 Oct 2004 09:39:43 +0100 Dave wrote: DS Robert Ok, lets see if I got this right. You have the main agent thread, DS Robert

Re: Sending traps in another thread

2004-10-28 Thread Gary Clark
Clark [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, October 28, 2004 3:39 AM Subject: Re: Sending traps in another thread Robert Ok, lets see if I got this right. You have the main agent thread, Robert and two worker threads. The worker threads don't do any SNMP other Robert than to call

Re: Sending traps in another thread

2004-10-27 Thread Users
On Wed, 27 Oct 2004 13:08:30 +0200 Vili wrote: VG Has anybody tried to send traps in other thread that in main thread of VG sub agent? VG I'm having problems when snmp_free_pdu() is called. (segmentation fault). VG Any ideas on this? Has anybody do something like this? Using any SNMP calls other

Re: Sending traps in another thread

2004-10-27 Thread Gary Clark
Yes, I have sent traps in using a pthread. No problem. Are you trying to free a PDU that has not been malloc? Segmentation faults are usual candidates (using the the political term) for bad memory accesses. So your pointer may be invalid? Can you dump out what you allocate and what you free?

Re: Sending traps in another thread

2004-10-27 Thread Users
On Wed, 27 Oct 2004 08:47:42 -0500 Gary wrote: GC I have sent traps in using a pthread. Hi Gary, Do you mind if I ask a few questions about how your app works? We need to gather information to help identify what does and doesn't work. Even if you can only answer briefly, like 'yes/no', that

Re: Sending traps in another thread

2004-10-27 Thread Gary Clark
on. send_v2trap is what I am using. Much appreciated, Garyc - Original Message - From: Robert Story (Users) [EMAIL PROTECTED] To: Gary Clark [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 10:23 AM Subject: Re: Sending traps in another thread On Wed, 27 Oct 2004

Re: Sending traps in another thread

2004-10-27 Thread Users
On Wed, 27 Oct 2004 12:24:17 -0500 Gary wrote: GC GC Have you implemented any locking mechanism? GC GC GC GC Standard pthread mutexs were used. GC GC Can you elaborate on that? Where are they used? Who blocks who, and when? GC GC The download to the hardware device or upload can take time

Re: Sending traps in another thread

2004-10-27 Thread Gary Clark
. Once complete the lock is disabled. The thread resources are removed once the thread exits. Thanks, Garyc - Original Message - From: Robert Story (Users) [EMAIL PROTECTED] To: Gary Clark [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 1:28 PM Subject: Re: Sending

Re: Sending traps from GNU/Linux server to NMS

2004-08-17 Thread Dave Shield
Is there no way to send traps through the snmpd agent, Yes. Please see the FAQ entries What traps are sent by the agent? Where are these traps sent to? Im trying to send the following traps from my GNU/Linux Box: - Coldstart - Warmstart A coldstart trap will be sent

Re: Sending Traps

2004-08-17 Thread Dave Shield
hi all, do anybody know how to sent traps via snmp. How to configure our agent to sent traps for our oid? Have a look at using mib2c with the 'mib2c.notify.conf' file. That will generate a suitable template routine for generating a given trap. Then you just need to call this routine

Re: sending traps automatically via the agent

2004-08-09 Thread Dave Shield
The net-snmp daemon can be configured to check processes/disks. for example: disk / 1 many people think that if the above mount point grow up above 10M size , the net-snmp daemon should send trap to the trap server(NMS, trapd). but it's not. Probably because those people