Fwd: sending traps and perl plugin

2019-10-10 Thread Александр Малюков
Good day!

I use snmpd with perl plugin. Plugin code - http://paste.debian.net/1105734
snmpd config - http://paste.debian.net/1105733

snmpwalk works fine.

But i try to add monitor (sending traps) feature.
and add monitor section:

monitor -S -I -r 20 toHot 1.3.6.1.4.1.9.2.1.1 > 15

In tcpdump i see json response every 20 seconds. Value of OID
1.3.6.1.4.1.9.2.1.1 is still 20.
But snmpd not send traps. I not see traps traffic in tcpdump and traps
in snmptrapd.

Whats wrong in my setup?
___
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: How to specify the source address for sending traps

2019-07-26 Thread Bart Van Assche

  
  
On 7/26/19 1:06 PM, David Moriconi
  (dmoricon) via Net-snmp-users wrote:


  
  
  
  
  
Hi,
I am using
Net-SNMP 5.8 on CentOS 7 with AgentX enabled. My AgentX
subagent is implemented using SNMP4J-AgentX.

 
I want to
tell Net-SNMP on which interface to send traps. I look at
the SNMPD configuration manpage (http://www.net-snmp.org/docs/man/snmpd.conf.html)
and don’t see anything like it. The trap2sink directive only
takes the target host as argument along with a community and
port. From what I can see, trapsess also only takes the
target address and not the source address.

 
Can someone
please let me know if this is possible? If so, how can I
achieve it?
 
Thank you
  

Hi David,

Please have a look at commit e56699f5e2ef ("Add the ability to
  set the source address with "-s" for trapsess").
Bart.

  


___
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


How to specify the source address for sending traps

2019-07-26 Thread David Moriconi (dmoricon) via Net-snmp-users
Hi,
I am using Net-SNMP 5.8 on CentOS 7 with AgentX enabled. My AgentX subagent is 
implemented using SNMP4J-AgentX.

I want to tell Net-SNMP on which interface to send traps. I look at the SNMPD 
configuration manpage (http://www.net-snmp.org/docs/man/snmpd.conf.html) and 
don’t see anything like it. The trap2sink directive only takes the target host 
as argument along with a community and port. From what I can see, trapsess also 
only takes the target address and not the source address.

Can someone please let me know if this is possible? If so, how can I achieve it?

Thank you

[http://www.cisco.com/c/dam/m/en_us/signaturetool/images/banners/standard/09_standard_graphic.png]
David Moriconi
Software Engineer
dmori...@cisco.com
Tel: 514808
Cisco Systems Canada Co. / Les Systemes Cisco Canada CIE
Cisco.com
[http://www.cisco.com/assets/swa/img/thinkbeforeyouprint.gif]
Think before you print.
This email may contain confidential and privileged material for the sole use of 
the intended recipient. Any review, use, distribution or disclosure by others 
is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete 
all copies of this message.
Please click 
here
 for Company Registration Information.


___
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


Problem sending traps

2019-02-11 Thread Mostafa Kassem
Greetings,
Our trap sink parameters are modified per 2 MIB entries, one for the IP address 
and one for the port.

We would like to set the trap sink programmatically on powerup and when we 
receive an snmp request.
On powerup and every time we receive a request to change the trap sink IP 
address or port, we parse the snmpd.conf file to get the username, 
authentication and privacy protocols and passwords.  Our snmpd.conf file looks 
like this:

# setup authorization
CreateUser myUserName SHA "myAuthenticationPassword" AES " myPrivacyPassword "
rwuser myUserName authPriv

# include Agentx setup
master agentx
authtrapenable  1

And our code to set the trap session on power up, is written in C++ and is as 
follows:

bool TrapSession::createSnmpV3TrapSession()
{
std::stringstream connectingString;
netsnmp_session session, *sesp;
memset(, 0, sizeof(netsnmp_session));
snmp_sess_init ();   // Set up defaults

 session.version = SNMP_VERSION_3;

// Peer name
std::stringstream connectionString;
connectionString << "udp6:[" << ipV6AddressAsString << "]:" << sinkPort;
session.peername = strdup(connectionString.str().c_str());

// set the SNMPV3 user name
session.securityName = strdup( userName.c_str());
session.securityNameLen = strlen(userName.c_str());

// Security
session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
session.securityModel = SNMP_SEC_MODEL_USM;

// Authentication Protocol
session.securityAuthKeyLen = USM_AUTH_KU_LEN;
session.securityAuthProto = snmp_duplicate_objid(usmHMACSHA1AuthProtocol, 
USM_AUTH_PROTO_SHA_LEN);
session.securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;

if (generate_Ku(session.securityAuthProto,
  session.securityAuthProtoLen,
  (const uint8_t *) authenticationPassword.c_str(),
  authenticationPassword.length(),
  session.securityAuthKey,
  ) != SNMPERR_SUCCESS)
{
LOG_ERROR("Error generating authentication KU for authentication 
password: " << authenticationPassword);
return false;
}

// Privacy Protocol
session.securityPrivKeyLen = USM_PRIV_KU_LEN;
session.securityPrivProto = snmp_duplicate_objid(usmAESPrivProtocol, 
USM_PRIV_PROTO_AES_LEN);
session.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;

if (generate_Ku(session.securityAuthProto,
  session.securityAuthProtoLen,
  (const uint8_t *)privacyPassword.c_str(), 
privacyPassword.length(),
  session.securityPrivKey,
  ) != SNMPERR_SUCCESS)
{
LOG_ERROR("Error generating privacy KU for privacy password: " << 
privacyPassword);
return false;
}

// open the session
sesp = snmp_open();
if (!sesp) {
LOG_ERROR("Unable to open a trap session to: " << session.peername << " 
with user: " << userName);
throw std::runtime_error("Unable to open SNMP session!");
return false;
}

add_trap_session(sesp, SNMP_MSG_TRAP2, FALSE, SNMP_VERSION_3);
return true;
}

However, we are getting this error: [SNMP 3] : snmpd: send_trap: USM unknown 
security name (no such user exists)

What are we doing wrong?

If we add this line to the snmpd.conf and not use the above-mentioned code, we 
have no problem sending traps.

trapsess -v 3 -u myUserName -l authPriv -a SHA -A " myAuthenticationPassword " 
-x AES -X " myPrivacyPassword " udp6:[2001:bb::f8]:162

Thanks,

Mostafa
___
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


How to configure sending traps

2015-04-20 Thread James McGuire
Hi there,

I've been trying to configure net-snmp to send a trap when the disk utilisation 
on any mount point reaches a certain threshold, say 80% of total capacity.

I've read the documentation here:

https://access.redhat.com/documentation ... 
eving.htmlhttps://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sect-System_Monitoring_Tools-Net-SNMP-Retrieving.html

but when I attempt to review the available parameters in 
HOST-RESOURCES-MIB::hrStorage by issuing the following command, I get an error 
suggesting the table is not recognised:

 snmptable -Cb localhost HOST-RESOURCES-MIB::hrStorage
Was that a table? HOST-RESOURCES-MIB::hrStorage

Can anyone advise how I go about doing this with a 'monitor' statement inside 
of /etc/snmp/snmpd.conf? I also read the wiki here:

http://www.net-snmp.org/wiki/index.php/ ... 
Monitoringhttp://www.net-snmp.org/wiki/index.php/TUT:DisMan_Monitoring

But although there is a subsection on disk montioring, there is no related 
content to explain how to do this!

Eventually I need to get traps working for:


· memory utilisation (send trap when memory utilisation  80%)

· cpu load averages (send trap when 5 minute load average is = 100%)

· process not running (send trap when httpd is no longer running).

· Disk utilisation (send trap when any mount point is utilised  80%)

Would appreciate some advice on how to do this as information online appears to 
be surprisingly scant and I'd expect this would be a very common requirement?

Many thanks,

James


Versions:

CentOS Linux release 7.1.1503 (Core)

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
net-snmp.x86_64 1:5.7.2-20.el7 @0-base
net-snmp-agent-libs.x86_64 1:5.7.2-20.el7 @0-base
net-snmp-libs.x86_64 1:5.7.2-20.el7 @0-base
net-snmp-utils.x86_64 1:5.7.2-20.el7 @0-base
Available Packages
net-snmp-agent-libs.i686 1:5.7.2-20.el7 0-base
net-snmp-devel.i686 1:5.7.2-20.el7 0-base
net-snmp-devel.x86_64 1:5.7.2-20.el7 0-base
net-snmp-gui.x86_64 1:5.7.2-20.el7 0-base
net-snmp-libs.i686 1:5.7.2-20.el7 0-base
net-snmp-perl.x86_64 1:5.7.2-20.el7 0-base
net-snmp-python.x86_64 1:5.7.2-20.el7 0-base
net-snmp-sysvinit.x86_64 1:5.7.2-20.el7 0-base

James McGuire
Infrastructure Support Engineer

redcentric
business technology. managed

Support: 0345 120 7070 or +44 1189 711582 from abroad
Email: james.mcgu...@redcentricplc.com
Website: www.redcentricplc.comhttp://www.redcentricplc.com
Blog: www.redcentricplc.com/bloghttp://www.redcentricplc.com/blog

Redcentric, Central House, Beckwith Knowle, Harrogate, HG3 1UG.
Main Switchboard: 01423 85 00 00


http://www.redcentricplc.com



DISCLAIMER:
This message is intended only for the use of the person(s) (the intended 
recipient(s)) to whom it is addressed. 
It may contain information which is privileged, proprietary and/or confidential 
within the meaning of applicable law. 
If you are not the intended recipient, be advised that you have received this 
email in error and that any use, dissemination, forwarding, printing or copying 
of this message (including any attachments) is strictly prohibited. 
If you have received this message in error, please contact the sender of this 
message as soon as possible. 
The views or opinions expressed in this message are those of the author and may 
not necessarily be the views held by Redcentric.

Redcentric Solutions Limited trading as Redcentric. Registered office: Central 
House, Beckwith Knowle, Harrogate, HG3 1UG.
Registered in England no. 08322856.
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
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


Sending traps from subagent results either in deadlock(tcp recvQ issue) or SIGPIPE

2013-05-07 Thread Usha Kodali
I am running net-snmp 5.4.2.1
Have a subagent sending traps to the master snmpd daemon.

After about (depending on the size of trap buffer) 200 or 500 traps,
either the subagent and snmpd deadlock in sendto or
subagent receives a SIGPIPE.

Observations:

1.   The core problem is that snmpd agent doesn't seem to drain it's recvQ 
(using tcp:localhost:705)

2.   If the subagent is implemented as a library call, there is no way to 
clean up the session and reinit.

The following sequence doesn't seem to work

init_agent

init_snmp(daemon_name);

..

// Lets say inorder to avoid the deadlock, I will close the session(subagent) 
after sending x traps and reinit

snmp_shutdown(daemon_name);

shutdown_agent();



// Reinit

Init_agent

Init_snmp


I have read through all the forum posts, but didn't find any solution.
I did read that 5.7.2 does resolve the SIGPIPE, unfortunately I cannot risk 
snmp hijacking SIGPIPE since the daemon sending the traps needs to handle this 
signal for other reasons. Besides that, I have also read that 5.7.2 doesn't 
solve the deadlock (main cause the recvQ on the snmpd socket doesn't get 
drained)
Appreciate any help or insights into this.

Thanks,
-Usha




--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may___
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: 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 SNMP::TrapSession(DestHost = $host, SecName = 
guest1, SecLevel = authNoPriv, AuthProto = SHA, AuthPass = 
password, Port = 162, Version = '3');
$session-trap(oid = $trapoid, uptime = $agent-uptime());

In the above code $session is not created. Does anyone know what I'm doing 
wrong with the call to   new SNMP::TrapSession??
Is there any other configuration I have to set up to send an SNMPv3 trap?

Regards,

Ali


Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct___
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: 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 system
 startup in a trap if the uptime has not been specified explicitly. If you
 want that value to match the sysUptime of the SNMP agent on the same
 system,
 I propose that you query that value before sending a trap.


Does the function uptime() defined in the attached patch help (not tested) ?
It can be used e.g. as follows:

C:\Perl\bin\perl -e use SNMP; use NetSNMP::agent; $SNMP::dump_packet=1; my
$agent = new NetSNMP::agent(); my $session = new SNMP::TrapSession(Community
= \trap\, Port = 162, Version = \2c\); $session-trap(oid =
\warmStart\, uptime = $agent-uptime());


[PATCH] CHANGES: perl: Add agent::uptime()

---
 perl/agent/agent.pm |6 ++
 perl/agent/agent.xs |7 +++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/perl/agent/agent.pm b/perl/agent/agent.pm
index 6135443..4ffd3ea 100644
--- a/perl/agent/agent.pm
+++ b/perl/agent/agent.pm
@@ -199,6 +199,12 @@ sub agent_check_and_process {
 __agent_check_and_process($blocking || 0);
 }

+sub uptime {
+my ($self) = @_;
+$self-maybe_init_lib();
+return _uptime();
+}
+
 bootstrap NetSNMP::agent $VERSION;

 # Preloaded methods go here.
diff --git a/perl/agent/agent.xs b/perl/agent/agent.xs
index ee77d50..b81886f 100644
--- a/perl/agent/agent.xs
+++ b/perl/agent/agent.xs
@@ -239,6 +239,13 @@ __agent_check_and_process(block = 1)
 OUTPUT:
RETVAL

+int
+_uptime()
+CODE:
+RETVAL = netsnmp_get_agent_uptime();
+OUTPUT:
+   RETVAL
+
 void
 init_mib()
 CODE:
--
1.7.5.1


0001-CHANGES-perl-Add-agent-uptime.patch
Description: Binary data
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 if
someone (maybe me) has the time, these patches will be backported to the
5.4, 5.5 and 5.6 branches too.

Bart.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 releases?


 These patches will be included in all future 5.7 and 6.0 releases. And if
 someone (maybe me) has the time, these patches will be backported to the
 5.4, 5.5 and 5.6 branches too.


(replying to my own e-mail)

At least, if no one objects against any of these patches of course. The
reason I had included both patches inline in my replies was to make review
easier.

Bart.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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
To:
Dave Shield d.t.shi...@liverpool.ac.uk@MEXT
Date:
04/10/2011 10:22
Subject:
net-snmp-users


Bart, Dave,

I'm still a bit confused! In this case I am generating my trap from my 
Perl Sub Agent which is registered with the Master Agent via the Agent X 
protocol and responds to SNMP Get, Set and Get Next requests and will also 
be responsible for generating traps. My interpretation of Dave's statement 
below, is that in this situation the Agent should automatically generate 
the correct sysUpTime value :

If you are generating a trap from within the agent, then the SNMP engine 
that
generates the notification is the same engine that responds to GET 
requests.
So the sysUpTime value within the trap ought to match the value returned 
from
querying the agent.

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 system
startup in a trap if the uptime has not been specified explicitly. If you
want that value to match the sysUptime of the SNMP agent on the same 
system,
I propose that you query that value before sending a trap.

Regards, 

Ali






Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gifimage/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 Traps.
 I'm a bit confused that the two values are so different.

Remember that the sysUpTime value included in the notification is the length
of time that the SNMP engine sending the trap has been running.
That last bit is significant - the uptime is associated with a running process,
not the host as a whole.


If you are generating a trap from within the agent, then the SNMP engine that
generates the notification is the same engine that responds to GET requests.
So the sysUpTime value within the trap ought to match the value returned from
querying the agent.

But if you are generating a trap from within a separate application -
particularly
a one-shot application (such as snmptrap),  then it's much less clear what
the sysUpTime value should be.   Strictly speaking, it should probably be the
length of time that this particular application has been running -
which may well
be a fraction of a second.   But that's not really very useful
(particularly since it
also implies that the engine ID and/or boot count should be updated every time).
So an alternative, pragmatic approach, would be to designate the whole host
as the generating SNMP engine), and use the host uptime.

But it's certainly not automatic that sending traps from a
separate application
will necessarily use the same sysUpTime as that of an SNMP agent running on
the same host.

Dave

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
___
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: 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



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
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: 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 your example if I send a LinkUp trap as follows the trap is 
not sent. 

C:\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2; 
$SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community = 
\public\, Port = 162, Version = \2c\); $session-trap(oid = 
\linkUp\);

I can send my trap like so, but I have ahad at add on an optional var-bind 
the SysLocation field to make it work!:

C:\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2; 
$SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community = 
\public\, Port = 162, Version = \2c\); $session-trap(oid = 
\1.3.6.1.4.1.2257.11.1.1.0.0.9\, [[sysLocation,0,\Here\]]);

In response to your earlier question about omitting the uptime field the 
SNMP.pm perl module seems to be making the following call at line 1191:

   my $uptime = $param{uptime} || SNMP::_sys_uptime();

The call to SNMP::sys_uptime() seems to be returning a negative value and 
not the correct sysUpTime. Note the correct sysUptime is obtained when 
performing a get-request on my agent.

Regards,

Ali


Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 send the trap with an empty associated var-bind list. e.g
 Bart in your example if I send a LinkUp trap as follows the trap is not
 sent.

 C:\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2;
 $SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community =
 \public\, Port = 162, Version = \2c\); $session-trap(oid =
 \linkUp\);

 I can send my trap like so, but I have ahad at add on an optional var-bind
 the SysLocation field to make it work!:


a) You should not be adding 'sysLocation to the varbind.
b) The linkup trap is defined to have a non-optional varbind
c) The varbind must contain the the value of ifIndex (of the interface that
went up).



 C:\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2;
 $SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community =
 \public\, Port = 162, Version = \2c\); $session-trap(oid =
 \1.3.6.1.4.1.2257.11.1.1.0.0.9\, [[sysLocation,0,\Here\]]);

 In response to your earlier question about omitting the uptime field the
 SNMP.pm perl module seems to be making the following call at line 1191:

my $uptime = $param{uptime} || SNMP::_sys_uptime();

 The call to SNMP::sys_uptime() seems to be returning a negative value and
 not the correct sysUpTime. Note the correct sysUptime is obtained when
 performing a get-request on my agent.


SysUpTime is defined as a 'TimeTicks' which is defined as an  INTEGER
(0..4294967295),
so what I think you are seeing is a signed interpretation of the value and
not the unsigned
interpretation that it really is.  Ie. DON'T print the 32 bit value as a
signed integer!
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 
do this? The following line is unsuccessful:

:\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2; 
$SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community = 
\public\, Port = 162, Version = \2c\); $session-trap(oid = 
\1.3.6.1.4.1.2257.11.1.1.0.0.9\ ); 

This line results in a trap being sent - Why do I need to put in some 
var-bind when I don't want to ???

:\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2; 
$SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community = 
\public\, Port = 162, Version = \2c\); $session-trap(oid = 
\1.3.6.1.4.1.2257.11.1.1.0.0.9\, [[sysLocation,0,\Here\]]  ); 


My other point is that the call to SNMP::sys_uptime() is actually coming 
from the trap subroutine in the SNMP.pm perl module not from my own code. 
This does not seem to be obtaining the correct value of sysUpTime. e.g. 
After running my agent for only a minute, the snmptrapd output displays 
this as 391 days or so.

Regards,

Ali


Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 enterprise
 specific trap that contains no additional var-binds. How do I do this? The
 following line is unsuccessful:

 :\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2;
 $SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community =
 \public\, Port = 162, Version = \2c\); $session-trap(oid =
 \1.3.6.1.4.1.2257.11.1.1.0.0.9\ );

 This line results in a trap being sent - Why do I need to put in some
 var-bind when I don't want to ???


hm... I don't know, perhaps someone else can answer this one.  Just for
laughs I tried sending it as a
V1 trap with no varbind, and it worked.


  :\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2;
 $SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community =
 \public\, Port = 162, Version = \2c\); $session-trap(oid =
 \1.3.6.1.4.1.2257.11.1.1.0.0.9\, [[sysLocation,0,\Here\]]  );


 My other point is that the call to SNMP::sys_uptime() is actually coming
 from the trap subroutine in the SNMP.pm perl module not from my own code.
 This does not seem to be obtaining the correct value of sysUpTime. e.g.
 After running my agent for only a minute, the snmptrapd output displays this
 as 391 days or so.


I tried your example on my system, and it provided me an up-time value of
47796740
which (because its in hundreths of a second works out to be 5.5 days, which
when I check
is how long my Net-SNMP master agent has been running.  Not _my_ sub-agent,
but the master agent.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 by the correct amount. However it is not being reset when my 
Master-Agent is stopped and started. It's as if it's taking the sysUpTIme 
from somewhere else!

Ali


Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 sysUpTime, each time I run the command the timeticks value has
 incremented by the correct amount. However it is not being reset when my
 Master-Agent is stopped and started. It's as if it's taking the sysUpTIme
 from somewhere else!



You are right.  I never looked at it that closely before.

It seems that the value is based on the up time of the OS, and not the up
time
of the master agent. (I'm not about to reboot my machine to prove it, or to
dive into the source code to find out.)

Technically thats against the specification of sysUpTime that says:

 The time (in hundredths of a second) since the
 network management portion of the system was last
 re-initialized.

Perhaps you should file a bug report.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 value does not seem to be a sensible value unfortunately as I
 have certainly not been running my agent for 391 days!


This might explain the large value you see for the uptime:
http://www.mail-archive.com/net-snmp-users@lists.sourceforge.net/msg23470.html
.

Bart.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 the 
value.

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 Traps. I'm a bit confused that the two values are so different.

Also, Do you know why when sending an SNMPv2 trap without any additional 
var-binds it fails but  as an  SNMPv1 trap it works.

Regards,

Ali


Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 by ten. Also, even rebooting my
 PC doesn't seem to have reset the value.

 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 Traps. I'm a
 bit confused that the two values are so different.

I'll have a closer look at this.

 Also, Do you know why when sending an SNMPv2 trap without any additional 
 var-binds it fails but  as an  SNMPv1 trap it works.

Does the attached patch help ?

Bart.

diff --git a/perl/SNMP/SNMP.xs b/perl/SNMP/SNMP.xs
index a0cfe69..459ac87 100644
--- a/perl/SNMP/SNMP.xs
+++ b/perl/SNMP/SNMP.xs
@@ -4437,7 +4437,7 @@ snmp_trapV2(sess_ref,uptime,trap_oid,varlist_ref)

New (0, oid_arr, MAX_OID_LEN, oid);

-   if (oid_arr  SvROK(sess_ref)  SvROK(varlist_ref)) {
+   if (oid_arr  SvROK(sess_ref)) {

   sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), SessPtr, 7, 1);
  ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
@@ -4451,8 +4451,13 @@ snmp_trapV2(sess_ref,uptime,trap_oid,varlist_ref)

   pdu = snmp_pdu_create(SNMP_MSG_TRAP2);

-  varlist = (AV*) SvRV(varlist_ref);
-  varlist_len = av_len(varlist);
+  if (SvROK(varlist_ref)) {
+  varlist = (AV*) SvRV(varlist_ref);
+  varlist_len = av_len(varlist);
+  } else {
+  varlist = NULL;
+  varlist_len = -1;
+  }
  //
   res = __add_var_val_str(pdu, sysUpTime, SYS_UPTIME_OID_LEN,
uptime, strlen(uptime), TYPE_TIMETICKS);
From a12a18bf389835b058557ce6f30ed7363dc231be Mon Sep 17 00:00:00 2001
From: Bart Van Assche bvanass...@acm.org
Date: Thu, 29 Sep 2011 19:03:02 +0200
Subject: [PATCH] CHANGES: perl: Support sending SNMPv2 traps with an empty 
varbind list

An example:
perl -e 'use SNMP; my $session = new SNMP::TrapSession(Version = 2c); 
$session-trap(oid = warmStart)'
---
 perl/SNMP/SNMP.xs |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/perl/SNMP/SNMP.xs b/perl/SNMP/SNMP.xs
index a0cfe69..459ac87 100644
--- a/perl/SNMP/SNMP.xs
+++ b/perl/SNMP/SNMP.xs
@@ -4437,7 +4437,7 @@ snmp_trapV2(sess_ref,uptime,trap_oid,varlist_ref)
   
New (0, oid_arr, MAX_OID_LEN, oid);
 
-   if (oid_arr  SvROK(sess_ref)  SvROK(varlist_ref)) {
+   if (oid_arr  SvROK(sess_ref)) {
 
   sess_ptr_sv = hv_fetch((HV*)SvRV(sess_ref), SessPtr, 7, 1);
  ss = (SnmpSession *)SvIV((SV*)SvRV(*sess_ptr_sv));
@@ -4451,8 +4451,13 @@ snmp_trapV2(sess_ref,uptime,trap_oid,varlist_ref)
  
   pdu = snmp_pdu_create(SNMP_MSG_TRAP2);
 
-  varlist = (AV*) SvRV(varlist_ref);
-  varlist_len = av_len(varlist);
+  if (SvROK(varlist_ref)) {
+  varlist = (AV*) SvRV(varlist_ref);
+  varlist_len = av_len(varlist);
+  } else {
+  varlist = NULL;
+  varlist_len = -1;
+  }
  //
   res = __add_var_val_str(pdu, sysUpTime, SYS_UPTIME_OID_LEN,
uptime, strlen(uptime), TYPE_TIMETICKS);
-- 
1.7.3.4

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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


Sending traps using Perl

2011-09-28 Thread Ali . Bruce
I am trying to send an SNMPv2 trap from my SubAgent  which can communicate 
with an SNMP Manager via the Agent X master agent. I am running version 
5.7.1 pre2 on Windows and trying to send traps to the snmptrapd daemon. 

My code for sending the trap is as follows:

my $host = '127.0.0.1';
my $comm = 'public';

my $session = new SNMP::TrapSession(HostName = $host, Community = 
$comm, Port = 162, Version = 1);
$session-trap(oid = '1.3.6.1.4.1.2257.11.1.1.0.0.9',
   uptime = 1234);

The trap that I am sending is an enterprise specific trap and is defined 
as follows:

ssaSwitchStopped   NOTIFICATION-TYPE
STATUS  current
DESCRIPTION
The Sentinel Switch is no-longer running
::= { ssaEvents 9 }

I am running snmptrapd as follows:
snmptrapd -f -Le -d

The output is as follows:

Received 42 byte packet from UDP: [127.0.0.1]:4151-[0.0.0.0]:0
: 30 28 02 01  00 04 06 70  75 62 6C 69  63 A4 1B 06 0(.public¤..
0016: 07 2B 06 01  04 01 8F 65  40 04 0A 32  50 C5 02 01 .+.e@..2PÅ..
0032: 06 02 01 00  43 02 04 D2  30 00   C..Ò0.

2011-09-28 10:37:31 LWPC211.uksecure.uk.mobile.marconi.com [10.50.80.197] 
(via UDP: [127.0.0.1]:4151-[0.0.0.0]:0) TRAP,
 SNMP v1, community public
UCD-SNMP-MIB::ucdavis Enterprise Specific Trap (0) Uptime: 
0:00:12.34

Does anyone know why its displaying the trap as UCD-SNMP-MIB::ucdavis 
Enterprise Specific Trap (0) and not as my specific trap?

Also if I change the Version variable from 1 to 2 in my SNMP::TrapSession 
no trap seems to be getting sent.

Any help would be appreciated.

Regards,

Ali


Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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);

 $session-trap(enterprise='.1.3.6.1.4.1.2257.11.1.1.0.0.9',
agent = '127.0.0.1',
generic = 0,
specific = 0);
uptime = 1234);

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??

Any help would be appreciated.

Regards,

Ali


Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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 uptime argument ?

This command allowed me to send an SNMPv2 trap, and at the same time to
observe what happens internally in Net-SNMP while sending a trap:

C:\Perl\bin\perl -e use SNMP; $SNMP::verbose=1; $SNMP::debugging=2;
$SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community =
\trap\, Port = 162, Version = \2c\); $session-trap(oid = \linkUp\,
[[ifIndex,1,1], [sysLocation,0,\Here\]]);

Bart.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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: 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, [[ifIndex,1,1], 
[sysLocation,0,Here]]);

Why do you include  the sysLocation.0 mib item when sending the LinkUp 
trap?

As you can see I have omitted the uptime field in the call to the trap 
function. 

This results in the following output from snmptrapd:

Received 106 byte packet from UDP: [10.50.80.197]:1366-[0.0.0.0]:0
: 30 68 02 01  01 04 06 70  75 62 6C 69  63 A7 5B 02 0h.public§[.
0016: 02 1D 73 02  01 00 02 01  00 30 4F 30  11 06 08 2B ..s..0O0...+
0032: 06 01 02 01  01 03 00 43  05 00 C9 BF  87 23 30 17...C..É¿╬
#0.
0048: 06 0A 2B 06  01 06 03 01  01 04 01 00  06 09 2B 06..+..  
+.
0064: 01 06 03 01  01 05 04 30  0F 06 0A 2B  06 01 02 01 ...0...+
0080: 02 02 01 01  01 02 01 01  30 10 06 08  2B 06 01 02 0...+...
0096: 01 01 06 00  04 04 48 65  72 65   ..Here

2011-09-28 17:01:24 LWPC211.uksecure.uk.mobile.marconi.com [UDP: 
[10.50.80.197]:1366-[0.0.0.0]:0]:
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 value does not seem to be a sensible value unfortunately as 
I have certainly not been running my agent for 391 days!

I have changed my code to try and send my user defined trap as follows but 
without any success so far i.e. no trap is received by snmptrapd:

my $host = '10.50.80.197';
my $session= new SNMP::TrapSession(DestHost = $host, Community = 
public, Port = 162, Version = '2c');
  $session-trap(oid = ssaSwitchStopped);

The ssaSwitchStopped trap has no additional varbinds associated with it.

Regards,

Ali



Please consider the environment before printing this email



---
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.
image/gif--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
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


seg fault while sending traps

2011-03-02 Thread Malathi Panyam
Sent before through my personal  mail ID

Hi,
   We experienced a seg fault (only one known occurrence so far) while sending 
the V2 traps out.
I found the following link with exact location where I see the crash on our 
device.
http://sourceforge.net/tracker/index.php?func=detailaid=3078424group_id=12694atid=112694

As explained there, though our application is multi threaded, all the 
interaction with NetSNMP agent happens through only one thread and that 
shouldn't be a problem as per
http://net-snmp.sourceforge.net/wiki/index.php/FAQ:Agent_43

I dont see any solution suggested in the link above for the seg fault.

Anyone has any idea or suggestion how we can go about this?

Here is the trace
Program terminated with signal 11, Segmentation fault.
[New process 2631]
[New process 2765]
[New process 2764]
#0  0x401322a4 in snmp_sess_async_send (sessp=0x36ebd0, pdu=0x48c160, 
callback=0x4001d680 send_trap_to_sess+272, cb_data=0x0) at snmp_api.c:4914
4914isp-requestsEnd-next_request = rp;
Current language:  auto; currently c
(gdb) bt full
#0  0x401322a4 in snmp_sess_async_send (sessp=0x36ebd0, pdu=0x48c160, 
callback=0x4001d680 send_trap_to_sess+272, cb_data=0x0) at snmp_api.c:4914
tv = {tv_sec = 0x0, tv_usec = 0x36ebe8}
rc = value optimized out
#1  0x4001d62c in send_trap_to_sess (sess=0x36ebe8, template_pdu=0x47f418) at 
agent_trap.c:919
pdu = (netsnmp_pdu *) 0xe25cf
result = value optimized out
tmp = '\0' repeats 133 times, 
\024\032@X\006\177¾Ø~J@X\006\177¾\000\024\032@h\006\177¾\000\024\032@p\006\177¾Ø~J@p\006\177¾\006\000\000\\a\177¾4\a\177¾$\000\000\0004\a\177¾è~J@°RK@¨\022\031@\001\000\000\000À\006\177¾ôñ\030@
  H\000P§K@\000\000\000\000\210nJ@(G\231\000ø`\002@@I\231\000\, '\0' repeats 
11 times, h\022\031@ 
aK@\000\000\000\000ô\006\177¾°RK@¨\022\031@\001\000\000\000ô\006\177¾ôñ\030@  
H\0004\000\000\000`ÁH\000\214oJ@h\022\031@ 
aK@\000\000\000\000\000\000\000\000...
#2  0x4001dda8 in netsnmp_send_traps (trap=0x, specific=value 
optimized out, enterprise=0x40033930, enterprise_length=0xa, vars=0x1a094, 
context=0x0,
flags=0x0) at agent_trap.c:813
template_v1pdu = (netsnmp_pdu *) 0x0
template_v2pdu = (netsnmp_pdu *) 0x4d6c414f
vblist = value optimized out
trap_vb = value optimized out
var = (netsnmp_variable_list *) 0x400330fc
uptime = 0xbe7f11c8
sink = (struct trap_sink *) 0x36e960
#3  0x4001e0d0 in send_enterprise_trap_vars (trap=0xe25cf, specific=0x4d6c414f, 
enterprise=0x0, enterprise_length=0x4f87b784, vars=0x466840) at agent_trap.c:838
No locals.
#4  0x4001e10c in send_trap_vars (trap=0xe25cf, specific=0x4d6c414f, 
vars=0x4001e10c) at agent_trap.c:950
No locals.
#5  0x0001a094 in send_uxNewAlarmTrap1_trap (pActAlm=value optimized out) at 
UXTraps.c:207
nTrapID = value optimized out
var_list = (netsnmp_variable_list *) 0xe59d0384
uxNewAlarmTrap1_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 0x2, 
0x30005}
uxAlarmActiveIndex_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 0x1, 
0x3, 0x1, 0x1}
uxAlarmConfigIndex_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 0x1, 
0x3, 0x1, 0x2}
uxAlarmActiveID_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 0x1, 
0x3, 0x1, 0x3}
uxAlarmActiveSubID_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 0x1, 
0x3, 0x1, 0x4}
uxAlarmActiveCondition_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0x5}
uxAlarmActiveSeverity_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0x6}
uxAlarmActiveCategory_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0x7}
uxAlarmActiveCancelType_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0x8}
uxAlarmActiveDecodeKey_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0xc}
uxAlarmActiveCount_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 0x1, 
0x3, 0x1, 0xb}
uxAlarmActiveState_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 0x1, 
0x3, 0x1, 0xe}
uxAlarmActiveSourceInstance_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 
0xf, 0x1, 0x3, 0x1, 0xd}
uxAlarmActiveFirstOccur_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0x9}
uxAlarmActiveLastOccur_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0xa}
uxAlarmActiveClrEvtID_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 0xf, 
0x1, 0x3, 0x1, 0xf}
uxAlarmActiveClrEvtSubID_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 
0xf, 0x1, 0x3, 0x1, 0x10}
uxAlarmActiveDescription_oid = {0x1, 0x3, 0x6, 0x1, 0x4, 0x1, 0xb1, 
0xf, 0x1, 0x3, 0x1, 0x11}
---Type return to continue, or q return to quit---
#6  0x00010840 in SNMPApplication::SNMPServerHandler (this=0x41519008, 
cb=@0xbe7f154c) at snmp.cpp:643
pAlmIE = (IE_LIST *) 0x48a058
pActAlarmRcv = (class ALM_ACTIVE_SEND_NORTH_IE *) 0x47ebb8
pAlmEvtEntry = (class 

Facing problems while sending traps using snmp api's

2010-11-12 Thread Sampige, Sahana Prabhakar (STSD)
Hi,
I am using net-snmp version 5.5. I am trying to send traps using the net-snmp 
library api's, but I am unsuccessful. But sending the trap using snmptrap 
command is successful with the same credentials. Below are the steps I have 
followed.

1. service snmptrapd stop
2. service snmpd stop
3. added the following lines to /etc/snmp/snmpd.conf
# VACM configuration entries
rwuser wes
# USM configuration entries
createUser wes MD5 setup_passphrase DES
4. service snmpd start
An entry for user wes was created in the /var/-net-snmp/snmpd.conf of the 
following form :
usmUser 1 3 0x80001f8880654ceb30a484dc4c 0x77657300 0x77657300 NULL 
.1.3.6.1.6.3.10.1.1.2 0x12317a58c0ccd9e67374456e228cdb3c .1.3.6.1.6.3.10.1.2.2 
0x12317a58c0ccd9e67374456e228cdb3c 
5. I added the following entry to /var/net-snmp/snmptrapd.conf
createuser -e 0x80001f8880654ceb30a484dc4c wes MD5 setup_passphrase DES
6. /usr/sbin/snmptrapd -f -Lf /tmp/trapLogFile -d
7. snmptrap -v 3 -n  -a MD5 -A setup_passphrase -l authNoPriv -u wes -e 
0x80001f8880654ceb30a484dc4c localhost 0 coldStart.0
Trap is received.
8. I wrote the following code to send the trap using net-snmp api's :
netsnmp_session session, *ss;
netsnmp_pdu *pdu;

oid anOID[MAX_OID_LEN];
size_t anOID_len;

init_snmp(snmpdemoapp);
snmp_sess_init( session );   /* set up defaults */
session.peername = strdup(mella.ind.hp.com:162);

session.version=SNMP_VERSION_3;

/* set the SNMPv3 user name */
session.securityName = strdup(wes);
session.securityNameLen = strlen(session.securityName);
session.securityEngineIDLen = strlen(0x80001f8880654ceb30a484dc4c);
session.securityEngineID = (u_char*)malloc(session.securityEngineIDLen);

memcpy(session.securityEngineID,0x80001f8880654ceb30a484dc4c,session.securityEngineIDLen);
session.securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;

/* set the authentication method to MD5 */
session.securityAuthProto = usmHMACMD5AuthProtocol;
session.securityAuthProtoLen = sizeof(usmHMACMD5AuthProtocol)/sizeof(oid);
session.securityAuthKeyLen = USM_AUTH_KU_LEN;

/* set the authentication key to a MD5 hashed version of our
   passphrase The Net-SNMP Demo Password (which must be at least 8
   characters long) */
if (generate_Ku(session.securityAuthProto,
session.securityAuthProtoLen,
(u_char *) our_v3_passphrase, strlen(our_v3_passphrase),
session.securityAuthKey,
session.securityAuthKeyLen) != SNMPERR_SUCCESS) {
snmp_perror(argv[0]);
snmp_log(LOG_ERR,
 Error generating Ku from authentication pass phrase. \n);
exit(1);
}

ss = snmp_open(session); /* establish the session */

if (!ss) {
  snmp_sess_perror(ack, session);
  SOCK_CLEANUP;

/*
 * Create the PDU for the data for our request.
 *   1) We're going to TRAP the system.sysDescr.0 node.
 */
pdu = snmp_pdu_create(SNMP_MSG_TRAP2);
anOID_len = MAX_OID_LEN;
if (!snmp_parse_oid(.1.3.6.1.2.1.1.1.0, anOID, anOID_len)) {
  snmp_perror(.1.3.6.1.2.1.1.1.0);
  SOCK_CLEANUP;
  exit(1);
}

status = snmp_send(ss, pdu);

9. I get the following error in the logfile : 
snmp_parse: snmp_parse: Parsed SNMPv3 message (secName:wes, 
secLevel:authNoPriv): USM unknown security name (no such user exists)
Parsed SNMPv3 message (secName:wes, secLevel:authNoPriv): USM unknown security 
name (no such user exists)

10. I debugged net-snmp I saw that the engine id stored in snmpusm.c does not 
match with the request engineid.The comparison of the engine id at line 
snmpusm.c:3011 fails. Dump from gdb as below :
(gdb) p engineID
$11 = (u_char *) 0x9f765b8 0x80001f8880654ceb30a484dc4c
(gdb) p engineIDLen
$12 = 28
(gdb) p ptr-engineIDLen
$13 = 13
(gdb) p ptr-engineID
$14 = (u_char *) 0x9f8b698 \200

Am I missing something. Can somebody help me.

Rgds,
Sahana
--
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
___
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: Facing problems while sending traps using snmp api's

2010-11-12 Thread Dave Shield
On 12 November 2010 11:16, Sampige, Sahana Prabhakar (STSD)
sah...@hp.com wrote:
    session.securityEngineIDLen = strlen(0x80001f8880654ceb30a484dc4c);
    session.securityEngineID = (u_char*)malloc(session.securityEngineIDLen);
    
 memcpy(session.securityEngineID,0x80001f8880654ceb30a484dc4c,session.securityEngineIDLen);

The securityEngineID should be a 13-octet *binary* value, not an ascii string.
   Try using snmp_hex_to_binary() to convert this string into the
appropriate value.
(See 'snmplib/snmp_parse_args.c' for an example)


Dave

--
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
___
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


Is there NetSNMP::agent support for sending Traps?

2010-09-27 Thread Fulko Hew
I just needed to coble up a test sub-agent (in Perl) that acts as an
AgentX based sub-agent. All went well for what I needed to test, but...

I see support for gets and sets, but what I didn't see was any support
for forwarding traps to an AgentX master from Perl sub-agents.

Is it missing, or am I blind as usual?

TIA
Fulko
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
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: Perl API for sending traps

2010-05-26 Thread Wes Hardaker
 On Mon, 24 May 2010 16:17:03 +0100, Joao Ferreira gmail 
 joao.miguel.c.ferre...@gmail.com said:

JF I'dd like to know if there is an API accessible from the Perl modules to
JF send a trap to the currently configured trap destinations in snmpd.conf

JF I now this exists in C but I can figure out how to do it from the Perl
JF API.

If you read perldoc SNMP on the SNMP::TrapSession section it shows
how to send traps using perl...
-- 
Wes Hardaker
Cobham Analytic Solutions

--

___
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


Perl API for sending traps

2010-05-24 Thread Joao Ferreira gmail
Hello,

I'dd like to know if there is an API accessible from the Perl modules to
send a trap to the currently configured trap destinations in snmpd.conf

I now this exists in C but I can figure out how to do it from the Perl
API.

Thank you
Joao



--

___
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


Problem sending traps using snmptrap from Windows

2009-10-20 Thread Hal Rottenberg
Hi,
I am using Net-SNMP 5.4.2 on Windows XP and 2003 Server. We've not had any
problems with the agent, nor snmpwalk and some other utility commands.
However, what I recently found is that I'm unable to send a trap using the
snmptrap command. Regardless of what I put on the command-line, I get no
output to the screen--even if the command-line is invalid. I'm also watching
all outbound traffic using Wireshark, and no SNMP packets are ever sent.

Here is an example command which is working fine from my Linux systems, but
not from Windows:

snmptrap -v1 -ctestit manager 1.3.6.1.4.1.15597 hostname 0 0 111

Let me reinforce that I'm getting *no* output--not even the standard help
screen when you type any net-snmp command by itself.

Any clues here?  It looks like a very straightforward bug internal to this
one command to me.

-- 
Hal Rottenberg / h...@halr9000.com / halr9000.com
Microsoft MVP (PowerShell) / VMware vExpert
Co-Host, PowerScripting Podcast (http://powerscripting.net)

Managing VMware Infrastructure with PowerShell: TFM, now shipping!

Follow me on Twitter: http://twitter.com/halr9000
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
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 sending traps using snmptrap from Windows

2009-10-20 Thread Alex Burger
Hi.

It sounds like you're running the built-in Windows snmptrap.exe which is 
in c:\windows\system32.  The Net-SNMP installer puts the bin folder at 
the end of the path so the Windows version will come first.

Try running it directly from the installed Net-SNMP bin folder.

Alex


Hal Rottenberg wrote:
 Hi,
 I am using Net-SNMP 5.4.2 on Windows XP and 2003 Server. We've not had any
 problems with the agent, nor snmpwalk and some other utility commands.
 However, what I recently found is that I'm unable to send a trap using the
 snmptrap command. Regardless of what I put on the command-line, I get no
 output to the screen--even if the command-line is invalid. I'm also watching
 all outbound traffic using Wireshark, and no SNMP packets are ever sent.


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
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 sending traps using snmptrap from Windows

2009-10-20 Thread Hal Rottenberg
I think the expression I'm looking for is, if it had been a snake...
Thanks, Alex.

On Tue, Oct 20, 2009 at 7:39 PM, Alex Burger
ale...@users.sourceforge.netwrote:

 Hi.

 It sounds like you're running the built-in Windows snmptrap.exe which is in
 c:\windows\system32.  The Net-SNMP installer puts the bin folder at the end
 of the path so the Windows version will come first.

 Try running it directly from the installed Net-SNMP bin folder.

 Alex



 Hal Rottenberg wrote:

 Hi,
 I am using Net-SNMP 5.4.2 on Windows XP and 2003 Server. We've not had any
 problems with the agent, nor snmpwalk and some other utility commands.
 However, what I recently found is that I'm unable to send a trap using the
 snmptrap command. Regardless of what I put on the command-line, I get no
 output to the screen--even if the command-line is invalid. I'm also
 watching
 all outbound traffic using Wireshark, and no SNMP packets are ever sent.





-- 
Hal Rottenberg / h...@halr9000.com / halr9000.com
Microsoft MVP (PowerShell) / VMware vExpert
Co-Host, PowerScripting Podcast (http://powerscripting.net)

Managing VMware Infrastructure with PowerShell: TFM, now shipping!

Follow me on Twitter: http://twitter.com/halr9000
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
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


sending traps

2009-03-30 Thread Tanisha Kashyap
Hi,

I have written a small c program which parses data received extracts some 
information and stores it in some variables.
Using this information I need to be able to make SNMP traps and forward them to 
the NMS.

Should I use the SNMP trap from within this program or write another c program 
which would create SNMP traps and send them to the NMS

Tanisha

No task is so humble that it does not offer an outlet for individuality



DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus.
--
___
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: sending traps

2009-03-30 Thread sazid.mahammad
Again its as per you use the API.  Infact snmp_send* APIs internally
calls the netsnmp_send* APIs.

Go through  agent_trap.c 

 

 

Thanks and Regards,

Sazid 

 

From: Tanisha Kashyap [mailto:tanisha.kash...@aricent.com] 
Sent: Monday, March 30, 2009 3:34 PM
To: Sazid Mahammad (WT01 - Semi 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 snmp eg: snmp_send

And there are APIs like send_traps.

 

I am confused as to what to go ahead with.

 

No task is so humble that it does not offer an outlet for
individuality



From: sazid.maham...@wipro.com [mailto:sazid.maham...@wipro.com] 
Sent: Monday, March 30, 2009 3:27 PM
To: Tanisha Kashyap; net-snmp-users@lists.sourceforge.net
Subject: RE: sending traps

 

Hi,

 It depends upon you. You can send TRAP in same or write different .
Please go throught 

 

http://www.net-snmp.org/dev/agent/group__agent__trap.html

 

and use appropriate API.

 

 

Thanks and Regards,

Sazid 

 

From: Tanisha Kashyap [mailto:tanisha.kash...@aricent.com] 
Sent: Monday, March 30, 2009 3:02 PM
To: net-snmp-users@lists.sourceforge.net
Subject: sending traps

 

Hi,

 

I have written a small c program which parses data received extracts
some information and stores it in some variables.

Using this information I need to be able to make SNMP traps and forward
them to the NMS.

 

Should I use the SNMP trap from within this program or write another c
program which would create SNMP traps and send them to the NMS

 

Tanisha

 

No task is so humble that it does not offer an outlet for
individuality

 

 



DISCLAIMER: This message is proprietary to Aricent and is intended
solely for the use of the individual to whom it is addressed. It may
contain privileged or confidential information and should not be
circulated or used for any purpose other than for what it is intended.
If you have received this message in error,please notify the originator
immediately. If you are not the intended recipient, you are notified
that you are strictly prohibited from using, copying, altering, or
disclosing the contents of this message. Aricent accepts no
responsibility for loss or damage arising from the use of the
information transmitted by this email including damage from virus.

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email. 

www.wipro.com 

 



DISCLAIMER: This message is proprietary to Aricent and is intended
solely for the use of the individual to whom it is addressed. It may
contain privileged or confidential information and should not be
circulated or used for any purpose other than for what it is intended.
If you have received this message in error,please notify the originator
immediately. If you are not the intended recipient, you are notified
that you are strictly prohibited from using, copying, altering, or
disclosing the contents of this message. Aricent accepts no
responsibility for loss or damage arising from the use of the
information transmitted by this email including damage from virus.

--
___
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: 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 see the FAQ for a discussion for sending traps from the agent.


 I would be generating the skeleton code using mib2c and compile to produce a 
 .so file.
 Il then embed the path of this .so file into the snmpd.conf of the master 
 agent. So
 whenever the master agent is up my subagent also comes up.

Strictly speaking, that's a dynamically loaded module, rather than a separate
subagent.   But the distinction doesn't really matter too much.
   (Except that it might confuse the list if you talk about a
subagent in this context)


 I need your inputs on this approach as well.

That approach should work fine.

Dave

--
___
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: sending traps

2009-03-30 Thread Tanisha Kashyap

What's the difference between a dynamically loaded module and a subagent.
What would be end-product of developing a subagent.


No task is so humble that it does not offer an outlet for individuality


-Original Message-
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] 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 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 see the FAQ for a discussion for sending traps from the agent.


 I would be generating the skeleton code using mib2c and compile to produce a 
 .so file.
 Il then embed the path of this .so file into the snmpd.conf of the master 
 agent. So
 whenever the master agent is up my subagent also comes up.

Strictly speaking, that's a dynamically loaded module, rather than a separate
subagent.   But the distinction doesn't really matter too much.
   (Except that it might confuse the list if you talk about a
subagent in this context)


 I need your inputs on this approach as well.

That approach should work fine.

Dave

DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus.

--
___
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: 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 is how this agent know what information to return for any
given request.
Some information will be handled within the agent itself, so can be
returned directly.
There's no need for it to look elsewhere.
   But some information may not be available to this agent process, so
the agent needs
to be extended to be able to handle those requests.

One approach is to write a new chunk of code, and include it within the agent
(by recompiling the agent, and restarting it).   So you've essentially got a new
agent, that knows a bit more than before.   This is the most efficient approach,
but does involve a (hopefully short) break in service.

A related approach is to write the same new chunk of code, but compile it into
a .so file, and have the main agent load this dynamically.   That way,
it now knows
about the new information, and can respond to request - but it's never actually
stopped running.   This is known as a dynamically loaded module.

Both of these end up with a single agent process running on the system.


The idea of a subagent is to take the same new chunk of code, but compile
it into a separate application (subagent) which runs as a separate process.
This then connects to the main (master) agent, and offers to handle requests
for this new information.

So here you now have *two* processes running at the same time.


Typically, the MIB code itself is likely to be more-or-less the same
in each case.
The differences are in how these MIB modules are plugged into the overall agent
framework - are they included within a single SNMP agent (either statically or
dynamically), or are they run as part of a separate subagent.

Dave

--
___
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: sending traps

2009-03-30 Thread Tanisha Kashyap


No task is so humble that it does not offer an outlet for individuality


-Original Message-
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf 
Of Dave Shield
Sent: Monday, March 30, 2009 4:44 PM
To: Tanisha Kashyap
Cc: net-snmp-users@lists.sourceforge.net
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 for information.
== This agent is the net-snmp daemon snmpd?

The question is how this agent know what information to return for any
given request.
Some information will be handled within the agent itself, so can be
returned directly.
There's no need for it to look elsewhere.
   But some information may not be available to this agent process, so
the agent needs
to be extended to be able to handle those requests.

One approach is to write a new chunk of code, and include it within the agent
(by recompiling the agent, and restarting it).   So you've essentially got a new
agent, that knows a bit more than before.   This is the most efficient approach,
but does involve a (hopefully short) break in service.
==is the agent code recompilable? I read in Solaris handbook that the agent 
code cannot be recompiled.

A related approach is to write the same new chunk of code, but compile it into
a .so file, and have the main agent load this dynamically.   That way,
it now knows
about the new information, and can respond to request - but it's never actually
stopped running.   This is known as a dynamically loaded module.
==Since the dynamically loaded module will be a .so file which is called  when 
the snmpd comes up so how does it run like a process?

Both of these end up with a single agent process running on the system.


The idea of a subagent is to take the same new chunk of code, but compile
it into a separate application (subagent) which runs as a separate process.
This then connects to the main (master) agent, and offers to handle requests
for this new information.

So here you now have *two* processes running at the same time.
==how is the subagent actually developed. This information is crucial since it 
would really help me decide what approach I should take.

Typically, the MIB code itself is likely to be more-or-less the same
in each case.
The differences are in how these MIB modules are plugged into the overall agent
framework - are they included within a single SNMP agent (either statically or
dynamically), or are they run as part of a separate subagent.

Dave

DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus.

--
___
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: sending traps

2009-03-30 Thread Tanisha Kashyap
Just a few more question
If I develop a subagent then that would run independent of the master agent 
i.e. snmpd?

Will that be a master-slave mode?

The end product would be a daemon which would run like the snmpd does?

No task is so humble that it does not offer an outlet for individuality


-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...@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 of an agent, yes.
Other vendors also provide similar software.


 One approach is to write a new chunk of code, and include it within the agent
 (by recompiling the agent, and restarting it).   So you've essentially got a 
 new
 agent, that knows a bit more than before.   This is the most efficient 
 approach,
 but does involve a (hopefully short) break in service.

 is the agent code recompilable?

The Net-SNMP agent source code is available, so our agent can be recompiled.

 I read in Solaris handbook that the agent code cannot be recompiled.

I have no idea what SNMP agent this refers to.
But if it's talking about Sun's own agent (either developed in-house, or one
that they bought in from some third party), then it wouldn't surprise me if
the source code isn't available.

But this list is specifically provided to support for the Net-SNMP software,
so when we talk about an agent, we're typically talking about *our* agent.



 A related approach is to write the same new chunk of code, but compile it 
 into
 a .so file, and have the main agent load this dynamically.

 Since the dynamically loaded module will be a .so file which is called
  when the snmpd comes up so how does it run like a process?

It's the snmpd agent that runs as a process - not your .so file.
Your new module is effectively bolted on to the snmpd binary.


 So here you now have *two* processes running at the same time.

 how is the subagent actually developed.

Personally, I tend to use the main agent framework, so haven't really looked
at developing subagents much.   But I believe you can run

net-snmp-config  --compile-subagentmySubAgent   myModule,c

to generate a subagent binary.


 This information is crucial since it would really help me decide
 what approach I should take.

The design of the Net-SNMP agent is such that is does *NOT* matter
which approach you take (at least from the SNMP side).   The MIB
module code would be the same in all three cases.
   You can take a MIB module, originally coded to run as static code
within the main agent binary,  and recompile it as a subagent,
without touching the code file itself.   That's been a design feature,
right from the start of the AgentX (i.e. subagent) support.

Dave

DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus.

--
___
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: sending traps

2009-03-30 Thread Tanisha Kashyap
I had actually gone through the demo modules provided with the net-snmp 
package. That seemed fine to me.

But now the AgentX approach seems better in the sense that I would have my own 
daemon running (I am assuming it shall be visible with the ps -ef|grep command 
apart from the snmpd).  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.

Thanks a lot.

No task is so humble that it does not offer an outlet for individuality


-Original Message-
From: 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 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 that be a master-slave mode?

Yes


 The end product would be a daemon which would run like the snmpd does?

A daemon that would run alongside snmpd, yes.

Dave

DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus.

--
___
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: sending traps

2009-03-30 Thread Tanisha Kashyap
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.

The traps are formed in a different way. Some data is parsed and the traps are 
formed using the parsed information. The traps are then sent to the NMS. All 
this is done in one function/module.

I would be generating the skeleton code using mib2c and compile to produce a 
.so file. Il then embed the path of this .so file into the snmpd.conf of the 
master agent. So whenever the master agent is up my subagent also comes up. I 
need your inputs on this approach as well.

Thanks

No task is so humble that it does not offer an outlet for individuality

-Original Message-
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf 
Of Dave Shield
Sent: Monday, March 30, 2009 3:46 PM
To: Tanisha Kashyap; sazid.maham...@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 this.
   Coding this yourself is cleaner, while forking off snmptrap is probably
simpler.


Please go throught
http://www.net-snmp.org/dev/agent/group__agent__trap.html
 and use appropriate API.

No - please do *NOT* attempt to use these API calls.
They are designed for use within an SNMP agent, and rely
on the agent infrastructure for sending the trap.

From what you've said, you're working with a standalone application,
and turning it into an SNMP agent doesn't feel the right approach.

You'd be better off looking at the code for the snmptrap command,
to see how this sends traps.

Dave

DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus.

--
___
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: 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 probably
simpler.


Please go throught
http://www.net-snmp.org/dev/agent/group__agent__trap.html
 and use appropriate API.

No - please do *NOT* attempt to use these API calls.
They are designed for use within an SNMP agent, and rely
on the agent infrastructure for sending the trap.

From what you've said, you're working with a standalone application,
and turning it into an SNMP agent doesn't feel the right approach.

You'd be better off looking at the code for the snmptrap command,
to see how this sends traps.

Dave

--
___
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: 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 of an agent, yes.
Other vendors also provide similar software.


 One approach is to write a new chunk of code, and include it within the agent
 (by recompiling the agent, and restarting it).   So you've essentially got a 
 new
 agent, that knows a bit more than before.   This is the most efficient 
 approach,
 but does involve a (hopefully short) break in service.

 is the agent code recompilable?

The Net-SNMP agent source code is available, so our agent can be recompiled.

 I read in Solaris handbook that the agent code cannot be recompiled.

I have no idea what SNMP agent this refers to.
But if it's talking about Sun's own agent (either developed in-house, or one
that they bought in from some third party), then it wouldn't surprise me if
the source code isn't available.

But this list is specifically provided to support for the Net-SNMP software,
so when we talk about an agent, we're typically talking about *our* agent.



 A related approach is to write the same new chunk of code, but compile it 
 into
 a .so file, and have the main agent load this dynamically.

 Since the dynamically loaded module will be a .so file which is called
  when the snmpd comes up so how does it run like a process?

It's the snmpd agent that runs as a process - not your .so file.
Your new module is effectively bolted on to the snmpd binary.


 So here you now have *two* processes running at the same time.

 how is the subagent actually developed.

Personally, I tend to use the main agent framework, so haven't really looked
at developing subagents much.   But I believe you can run

net-snmp-config  --compile-subagentmySubAgent   myModule,c

to generate a subagent binary.


 This information is crucial since it would really help me decide
 what approach I should take.

The design of the Net-SNMP agent is such that is does *NOT* matter
which approach you take (at least from the SNMP side).   The MIB
module code would be the same in all three cases.
   You can take a MIB module, originally coded to run as static code
within the main agent binary,  and recompile it as a subagent,
without touching the code file itself.   That's been a design feature,
right from the start of the AgentX (i.e. subagent) support.

Dave

--
___
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: 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 that be a master-slave mode?

Yes


 The end product would be a daemon which would run like the snmpd does?

A daemon that would run alongside snmpd, yes.

Dave

--
___
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: sending traps

2009-03-30 Thread Tanisha Kashyap
Thanks... :)

No task is so humble that it does not offer an outlet for individuality


-Original Message-
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf 
Of Dave Shield
Sent: Monday, March 30, 2009 6: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:
 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 towards.

The best way forward would probably to run the 'net-snmp-config'
command I mentioned, and experiment with that.

Dave

DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus.

--
___
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: 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 towards.

The best way forward would probably to run the 'net-snmp-config'
command I mentioned, and experiment with that.

Dave

--
___
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:snmpd restart causes subagent to stop sending traps

2009-03-24 Thread Pavel Hrdina
Hello all,

is there anybody who can write some explanation regarding my problem?

And excuse me forgetting to mention one important information:
The problem was found on Red Hat Linux 3.4.6-9 with Net-SNMP 5.1.2 and 
confirmed with the latest version 5.4.2.1.

Thank you very much for any helpful answer.
Paul

  Original message 
 From: Pavel Hrdina pole...@seznam.cz
 Subject: snmpd restart causes subagent to stop sending traps
 Date: 19.3.2009 15:23:42
 
 Is the Net-SNMP library designed in a way to survive a restart cycle of 
 snmpd
 daemon?
 
 I am facing a problem when my AgentX subagent stops sending traps after the
 snmpd daemon has been restarted. The subagent is a part of other program (log
 server) so it is not desirable for it to require a restart each time the snmpd
 is restarted.
 
 I'm using the snmp_select_info (+snmp_read/snmp_timeout) in the main loop of 
 my
 program to handle activity on SNMP sockets together with my own sockets and it
 works well. Each time I call send_v2trap to generate a trap, one SNMP socket 
 is
 selected (it receives some kind of confirmation, probably).
 
 When I restart the snmpd, again one SNMP socket is selected, but then the
 following snmp_select_info returns a value that is by one less then 
 previously -
 thus one socket must have been closed and forgotten and this is probably the
 most important one (for communication with master agent) because no further
 send_v2trap is confirmed (and some SNMP socket selected) nor any trap is
 delivered to registered trapsinks.
 
 Do any of you know about this problem and its possible solution?
 
 Thank you,
 Paul
 
 --
 Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
 powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
 easily build your RIAs with Flex Builder, the Eclipse(TM)based development
 software that enables intelligent coding and step-through debugging.
 Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
 ___
 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
 
 
 

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
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


snmpd restart causes subagent to stop sending traps

2009-03-19 Thread Pavel Hrdina
Is the Net-SNMP library designed in a way to survive a restart cycle of snmpd 
daemon?

I am facing a problem when my AgentX subagent stops sending traps after the 
snmpd daemon has been restarted. The subagent is a part of other program (log 
server) so it is not desirable for it to require a restart each time the snmpd 
is restarted.

I'm using the snmp_select_info (+snmp_read/snmp_timeout) in the main loop of my 
program to handle activity on SNMP sockets together with my own sockets and it 
works well. Each time I call send_v2trap to generate a trap, one SNMP socket is 
selected (it receives some kind of confirmation, probably).

When I restart the snmpd, again one SNMP socket is selected, but then the 
following snmp_select_info returns a value that is by one less then previously 
- thus one socket must have been closed and forgotten and this is probably the 
most important one (for communication with master agent) because no further 
send_v2trap is confirmed (and some SNMP socket selected) nor any trap is 
delivered to registered trapsinks.

Do any of you know about this problem and its possible solution?

Thank you,
Paul

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
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: 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 file for
AL the agent) or pass multi destinations in the same trapsess in the
AL destination IP option. I'm not having success :(

You need multiple trapsess lines to make it work.  It's definitely
possible.  If you define more than one, you might run the agent by hand
in the foreground with the '-f -Le -d' switches to see it print out trap
packets to your destination.

(It's possible your receiver isn't getting it for some reason on its side)
-- 
Wes Hardaker
Sparta, Inc.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
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: 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, you will end up sending 28 copies of each trap!

Dave

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
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: Sending Traps for different destinations at the same time

2009-01-31 Thread Angela Lazaro

Thanks Dave!!!

I've tried that without success I defined two trapsess and the agent do not 
run properly and do not answer to the requests. 
I do not know why. But since I know it's possible and that should work, I will 
try to do some trace in order to understand what's the problem.

Thanks 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
 
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, you will end up sending 28 copies of each trap!

Dave

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
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


Sending Traps for different destinations at the same time

2009-01-30 Thread Angela Lazaro

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 destination IP option. I'm not having success :(

Does anyone know if that is possible and if I'm doing it correctly? I mean, is 
it possible to do it by defining multi trapsess in the same configuration file?

Thanks a lot for your help and attention!

Best Regards,
Ângela

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
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: 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 destination IP
voption. I'm not having success :(

Does anyone know if that is possible and if I'm doing it correctly? I
mean, is it possible
to do it by defining multi trapsess in the same configuration file?

Thanks a lot for your help and attention!

Best Regards,
Ângela



--


You can send traps to multiple destinations like follows:

trap2sink  xx.xx.xx.xx public
trap2sink  yy.yy.yy.yy public

Reference: (earlier reply by Sir Dave)

http://www.mail-archive.com/net-snmp-users@lists.sourceforge.net/msg14335.html 




Regards,

-zeeshan


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
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


Problem in sending traps from daemon(snmpd)

2008-11-24 Thread Shrawan Patel
 

Hi friends,

 

I am using net-snmp-5.4.1.2 in my window system(Window-XP). I have generated
the template codes by the help of mib2c command. I have made proper
changes in template coding  to perform all the GET  SETs operations. Now I
want to send traps from my agent and for that I made changes in my .c
template  also but its not working.. I don't know is there  any packet
formation problem or there is any problem in my coding in mib2c generated
.c file.

 

I have checked through Ethereal ,it is not showing any type of traps.I think
there is some problem in variable binding, but not sure about it.

 

If any of you are familiar with this problem that what are the possible
issues and for those what may be the solutions ,then please reply me as soon
as possible.

 

Pl

 

 

Thanks  Regards

 

Shrawan 

 

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
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: 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 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.

But from the rest of your post, it sounds as if you are
working with some sort of agent.


 When I step through in gdb, the sinks list is empty.

That's normal.
This list is a left-over from the early days of the project.

Now, traps are handled by the Notification MIB module.
That's the purpose of  the SNMPD_CALLBACK_SEND_TRAP[12]
calls towards the end of netsnmp_send_traps.


 Does anyone happen to have sample code (I've searched!)
 for sending a trap from a standalone?

What do you mean by a standalone?

Dave

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
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: 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 running
agent, which I don't have the luxury of. I was hoping to be able to
avoid working with netsnmp_session objects directly.

 That's normal.
 This list is a left-over from the early days of the project.

Ah, good to know.

Thanks for the help,
-Dan

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
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


sending traps

2008-06-12 Thread dan anderson
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);

But without success. When I step through in gdb, the sinks list is
empty. I've tried using netsnmp_config(trap2sink localhost); as
well. (Also, snmpd_parse_config_trap2sink(, localhost);, but that
segfaults in a tokenizer - even when there's whitespace around
localhost - and I can't really see why.)

Am I doing something ludicriously wrong somewhere? Does anyone happen
to have sample code (I've searched!) for sending a trap from a
standalone? Or even for create_trap_session?

Cheers,
-Dan

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
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


AgentX agent not sending traps (was RE: Enterprise trap question/send_v2trap API call)

2008-01-02 Thread McGowen, Wendy
Happy New Year, everyone! I didn't see any responses to this issue over
the last 2 weeks, and I'm still stuck on this problem.

Basically, I am unable to generate any traps from my AgentX agent - I
know from my debug output that my code is being triggered, and I'm
calling the SNMP API to send the trap accordingly, but nothing happens.
The 30-second built in heartbeat code (the example) is working just
fine, so I know that traps are being sent and received - i.e. the
destination is set up correctly in the configuration files. (My earlier
response has some of the details.)

So is there a known issue with AgentX and traps? Do I need to configure
the AgentX agent in some special way to get the traps to work? Or is it
more likely something in the way I've defined the trap itself? I used
mib2c to create the actual trap code, so it should be correct, as far
as SNMP is concerned. 

Here's the trap stuff from my MIB:

pivot3  OBJECT IDENTIFIER ::= { enterprises 25148 }

pvt3System MODULE-IDENTITY
LAST-UPDATED 20071206Z
DESCRIPTION  MIB for all Pivot3 databank objects
REVISION 20071206Z
DESCRIPTION  First revision
::= { pivot3 1 }

pvt3SysTrapsOBJECT IDENTIFIER ::= { pvt3System 3 }

pvt3DatabankDriveStateFailed NOTIFICATION-TYPE
OBJECTS { name,
  slot }
STATUS  current
DESCRIPTION This trap is sent when the state of a drive in
 a databank has changed to FAILED.
::= { pvt3SysTraps 7 }

Thanks in advance for any advice - I'm really at my wits end here! As an
experiment later today, I'm going to try to build the 30-second
heartbeat sample trap code as an AgentX agent, and try running that - if
I don't see those traps, then I guess it will confirm my suspicion that
my problem has to do with the fact that I'm trying to send a trap from
an AgentX agent, instead of the main SNMP process. The problem is, I
have to compile my stuff separately from SNMP; I can't add the overhead
of building the entire SNMP product into our build process.

~ Wendy

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
McGowen, Wendy
Sent: Friday, December 14, 2007 2:55 PM
To: net-snmp-users@lists.sourceforge.net
Subject: RE: Enterprise trap question/send_v2trap API call

This is what I have in snmpd.conf:

trapcommunity public
trap2sink localhost public 162
trap2sink 10.1.5.2 public 162
trap2sink 10.2.5.2 public 162
trap2sink 10.1.5.5 public 162

I don't think the port numbers are necessary anymore . . .

I'm running snmptrapd on 10.1.5.5, and it is seeing the heartbeat traps
that are being generated by the version of snmpd that I rebuilt this
afternoon (configuration: --with-mib-modules=examples/notification).
But when the same system generates one of my traps, nothing gets sent to
10.1.5.5 (and based on my debug output, I know I'm at least calling
send_v2trap).

I'm beginning to wonder if it's something more to do with the fact that
I'm using AgentX. I turned on the debug in snmpd (the token traps),
and I don't see anything logged from netsnmp_send_traps when my trap
code is executed; however, I do see the debug output from the 30 second
heartbeat trap. Is there some initialization that needs to be done
before calling send_v2trap if the call is coming from an AgentX agent?

Thanks!

~ wendy

-Original Message-
From: Mike Ayers [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 14, 2007 2:11 PM
To: McGowen, Wendy; net-snmp-users@lists.sourceforge.net
Subject: RE: Enterprise trap question/send_v2trap API call

 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of McGowen, Wendy
 Sent: Friday, December 14, 2007 12:04 PM

 Maybe I'm just not seeing the obvious, either in my code or in my MIB,
 but I don't understand why my trap isn't being sent. Any 
 assistance will
 be greatly appreciated!

How have you configured your destination?


Thanks,

Mike


-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketp
lace
___
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

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:

Re: snmpd not sending traps

2007-10-03 Thread Neil Watson
I built and install net-snmp version 5.4.1.  I used the same snmpd.conf
file listed earlier in this thread:

[EMAIL PROTECTED] snmp]# snmpd -f  -Le -Ddisman
registered debug token disman, 1
netsnmp_assert !registration != duplicate failed agent_registry.c:535 
netsnmp_subtree_load()
netsnmp_assert !registration != duplicate failed agent_registry.c:535 
netsnmp_subtree_load()
netsnmp_assert !registration != duplicate failed agent_registry.c:535 
netsnmp_subtree_load()
disman:event:init: init trigger container
disman:event:init: create trigger container (9f732e0)
disman:event:init: init trigger container
disman:event:init: Trigger Table
disman:event:init: init trigger container
disman:event:init: Trigger Delta Table
disman:event:init: init trigger container
disman:event:init: Trigger Exist Table
disman:event:init: init trigger container
disman:event:init: Trigger Bool Table
disman:event:init: init trigger container
disman:event:init: Trigger Threshold Table
disman:event:init: init trigger container
disman:event:init: init event container
disman:event:init: create event container (9f76310)
disman:event:table: Create event entry (_snmpd, _mteTriggerFired)
disman:event:table: Event entry created
disman:event:table: Create event entry (_snmpd, _mteTriggerRising)
disman:event:table: Event entry created
disman:event:table: Create event entry (_snmpd, _mteTriggerFalling)
disman:event:table: Event entry created
disman:event:table: Create event entry (_snmpd, _mteTriggerFailure)
disman:event:table: Event entry created
disman:event:table: Create event entry (_snmpd, _linkDown)
disman:event:table: Event entry created
disman:event:table: Create event entry (_snmpd, _linkUp)
disman:event:table: Event entry created
disman:event:init: init event container
disman:event:init: Event Table container (9f76310)
disman:event:init: init event container
disman:event:init: Event Set Table container (9f76310)
disman:event:init: init event container
disman:event:init: Event Notify Table container (9f76310)
disman:event:init: init event container
disman:schedule:init: Initializing core module
disman:schedule:init: init schedule container
disman:schedule:init: create schedule container(9f7dd38)
disman:schedule:init: Initializing config module
disman:schedule:init: init schedule container
disman:schedule:init: Initializing table
disman:schedule:init: init schedule container
Turning on AgentX master support.
disman:event:conf: Registering default monitors
disman:event:conf: Parsing disman monitor config (-o prNames -o prErrMessage   
process table prErrorFlag  != 0)
disman:event:conf: _Bprocess table: Bool (prErrorFlag, 1, 0)
disman:event:table: Create trigger entry (snmpd.conf, process table)
disman:event:table: Trigger entry created
disman:event:conf: Parsing disman monitor config (-o memErrorName -o 
memSwapErrorMsg memory  memSwapError != 0)
disman:event:conf: _Bmemory: Bool (memSwapError, 1, 0)
disman:event:table: Create trigger entry (snmpd.conf, memory)
disman:event:table: Trigger entry created
disman:event:conf: Parsing disman monitor config (-o extNames -o extOutput 
extTable  extResult!= 0)
disman:event:conf: _BextTable: Bool (extResult, 1, 0)
disman:event:table: Create trigger entry (snmpd.conf, extTable)
disman:event:table: Trigger entry created
disman:event:conf: Parsing disman monitor config (-o dskPath -o dskErrorMsg
dskTable  dskErrorFlag != 0)
disman:event:conf: _BdskTable: Bool (dskErrorFlag, 1, 0)
disman:event:table: Create trigger entry (snmpd.conf, dskTable)
disman:event:table: Trigger entry created
disman:event:conf: Parsing disman monitor config (-o laNames -o laErrMessage   
laTable   laErrorFlag  != 0)
disman:event:conf: _BlaTable: Bool (laErrorFlag, 1, 0)
disman:event:table: Create trigger entry (snmpd.conf, laTable)
disman:event:table: Trigger entry created
disman:event:conf: Parsing disman monitor config (-o fileName -o fileErrorMsg  
fileTable fileErrorFlag!= 0)
disman:event:conf: _BfileTable: Bool (fileErrorFlag, 1, 0)
disman:event:table: Create trigger entry (snmpd.conf, fileTable)
disman:event:table: Trigger entry created
disman:event:conf: Parsing disman monitor config (-o snmperrErrMessage 
snmperrs  snmperrErrorFlag != 0)
disman:event:conf: _Bsnmperrs: Bool (snmperrErrorFlag, 1, 0)
disman:event:table: Create trigger entry (snmpd.conf, snmperrs)
disman:event:table: Trigger entry created
Error: Couldn't open a master agentx socket to listen on ():

-- 
Neil Watson | Debian Linux
System Administrator| Uptime 17 days
http://watson-wilson.ca

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Net-snmp-users mailing list

snmpd not sending traps

2007-10-02 Thread Neil Watson
Can anyone explain to me why an snmpd daemon configured using the below
file fails to send traps when the load numbers for 1, 5 and 15 minutes
are exceeded?

###
#
# snmpd.conf
#
#   - created by the snmpconf configuration program
#
###
# SECTION: Access Control Setup
#
#   This section defines who is allowed to talk to your running
#   snmp agent.

# rwuser: a SNMPv3 read-write user
#   arguments:  user [noauth|auth|priv] [restriction_oid]

rwuser  rwperson priv 
createUser rwperson MD5 ** DES *

# rouser: a SNMPv3 read-only user
#   arguments:  user [noauth|auth|priv] [restriction_oid]

rouser  roperson priv 
createUser roperson MD5 *** DES *

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
#   arguments:  community [default|hostname|network/bits] [oid]

rocommunity  **

# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
#   arguments:  community [default|hostname|network/bits] [oid]

rwcommunity  * 172.16.0.0/24 



###
# SECTION: Agent Operating Mode
#
#   This section defines how the agent will operate when it
#   is running.

# master: Should the agent operate as a master agent or not.
#   Currently, the only supported master agent type for this token
#   is agentx.
#   
#   arguments: (on|yes|agentx|all|off|no)

master  agentx
agentSecName  roperson


###
# SECTION: System Information Setup
#
#   This section defines some of the information reported in
#   the system mib group in the mibII tree.

# syscontact: The contact information for the administrator
#   Note that setting this value here means that when trying to
#   perform an snmp SET operation to the sysContact.0 variable will make
#   the agent return the notWritable error code.  IE, including
#   this token in the snmpd.conf file will disable write access to
#   the variable.
#   arguments:  contact_string

syscontact  [EMAIL PROTECTED]


###
# SECTION: Trap Destinations
#
#   Here we define who the agent will send traps to.

# trap2sink: A SNMPv2c trap receiver
#   arguments: host [community] [portnum]

trap2sink  tor-nnm.accounts.example.com  

# authtrapenable: Should we send traps when authentication failures occur
#   arguments: 1 | 2   (1 = yes, 2 = no)

authtrapenable  1



###
# SECTION: Monitor Various Aspects of the Running Host
#
#   The following check up on various aspects of a host.

# disk: Check for disk space usage of a partition.
#   The agent can check the amount of available disk space, and make
#   sure it is above a set limit.  
#   
#disk PATH [MIN=10]
#   
#PATH:  mount path to the disk in question.
#MIN:   Disks with space below this value will have the Mib's errorFlag set.
#   Can be a raw byte value or a percentage followed by the %
#   symbol.  Default value = 10.
#   
#   The results are reported in the dskTable section of the UCD-SNMP-MIB tree

disk  / 1

# load: Check for unreasonable load average values.
#   Watch the load average levels on the machine.
#   
#load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]
#   
#1MAX:   If the 1 minute load average is above this limit at query
#time, the errorFlag will be set.
#5MAX:   Similar, but for 5 min average.
#15MAX:  Similar, but for 15 min average.
#   
#   The results are reported in the laTable section of the UCD-SNMP-MIB tree

load  1 2 2


defaultMonitors yes

-- 
Neil Watson | Debian Linux
System Administrator| Uptime 17 days
http://watson-wilson.ca

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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: snmpd not sending traps

2007-10-02 Thread Dave Shield
On 02/10/2007, Neil Watson [EMAIL PROTECTED] wrote:
 Can anyone explain to me why an snmpd daemon configured using the below
 file fails to send traps when the load numbers for 1, 5 and 15 minutes
 are exceeded?

At first sight - yes, that ought to be generating traps.

Which version of the agent are you working with?
Are there any messages being logged?

Try running the agent using

 snmpd -f  -Le -Ddisman

and then try and trigger the load conditions.
What debug output do you see?

Dave

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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: snmpd not sending traps

2007-10-02 Thread Thomas Anders
Neil Watson wrote:
 defaultMonitors yes

What Net-SNMP version are you working with?

For 5.3.x and up please make sure you read and follow the whole
defaultMonitors paragraph in the snmpd.conf(5) manual page.


+Thomas

-- 
Thomas Anders (thomas.anders at blue-cable.de)

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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: snmpd not sending traps

2007-10-02 Thread Neil Watson
On Tue, Oct 02, 2007 at 04:33:57PM +0200, Thomas Anders wrote:
Neil Watson wrote:
 defaultMonitors yes

What Net-SNMP version are you working with?

[EMAIL PROTECTED] ~]# rpm -qa |grep -i net-snmp
net-snmp-libs-5.1.2-11.EL4.10.0.1
net-snmp-5.1.2-11.EL4.10.0.1
net-snmp-utils-5.1.2-11.EL4.10.0.1

-- 
Neil Watson | Debian Linux
System Administrator| Uptime 17 days
http://watson-wilson.ca

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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: snmpd not sending traps

2007-10-02 Thread Dave Shield
On 02/10/2007, Neil Watson [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] ~]# rpm -qa |grep -i net-snmp
 net-snmp-libs-5.1.2-11.EL4.10.0.1
 net-snmp-5.1.2-11.EL4.10.0.1
 net-snmp-utils-5.1.2-11.EL4.10.0.1

That is a very old version of the Net-SNMP software,
and the DisMan support has been completely reworked
since then.
  Please upgrade to 5.4.1, and try again.

Dave

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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: snmpd not sending traps

2007-10-02 Thread Neil Watson
On Tue, Oct 02, 2007 at 03:31:15PM +0100, Dave Shield wrote:
Try running the agent using

 snmpd -f  -Le -Ddisman

[EMAIL PROTECTED] ~]# snmpd -f  -Le -Ddisman
Turning on AgentX master support.
NET-SNMP version 5.1.2

No other output after more than ten minutes of load (1 and 5 minutes
load numbers are above 2).

-- 
Neil Watson | Debian Linux
System Administrator| Uptime 17 days
http://watson-wilson.ca

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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: snmpd not sending traps

2007-10-02 Thread Dave Shield
On 02/10/2007, Neil Watson [EMAIL PROTECTED] wrote:
 Building the software by hand in distributing it to all servers on our
 network is something I'd like to avoid.  Are you saying that the version
 I have is not capable of sending traps using the 'defaultmonitors yes'
 directive?

I would have very little confidence of the 5.1.x line (or 5.2.x line)
sending such active traps reliably.

The DisMan implementation was completely reworked for the 5.3.x
release, to improve this functionality.   If you want the agent to
generate traps in response to this sort of configuration, I would
*strongly* recommend that you upgrade to 5.4.1.

If you need to stay with the 5.1.x line, then you would do better
working with a separate process to monitor the load and generate
traps appropriately.
   A simple shell script could work reasonably well.  Something
like:

while true
do
load=`uptime | awk '{print $10}' `
if [ $uptime -gt 1.0 ]
then
snmptrap monitorhost 
fi
sleep 60
done


That's a bit too simplistic, of course.  But you get the idea.


If you want the snmpd agent to handle this, then upgrade.

Dave

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
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


sending traps to NNM

2007-07-16 Thread [EMAIL PROTECTED]
I am desperately seeking some help as I am really struggling, but I accept
this isn't really the remit of this list - if its more appropriate off list
replies are fine by me.

I have net-snmp installed and apparently working  e.g. snmpget returns
values from localhost.

I now want to test sending traps to a HP Openview Network Node Manager (I
am told this is what should be happening - I inherited a very very partial
OV installation and am trying to make it work with no budget and little
background. Aren't I lucky?!).

I have run snmp-config and nominated the NNM server as the receiver of
traps (snmpd.conf attached below - some of the triggers are deliberately
set to create traps at the moment for test ppurposes).

I can issue commands like 

bash-3.00# snmptrap -v 2c -c public localhost  UCD-SNMP-MIB::ucdStart
bash-3.00# snmptrap -v 2c -c public localhost  .1.3.6.1.4.1.2021.251.1
bash-3.00# snmptrap -v 2c -c public localhost  ucdStart sysContact.0 s
Dave

- but nothing ever appears in NNM.  If I restart the snmpd daemon then an
alarm does appear then in NNM noting this - but that's is all I ever see
there.

Any pointers or other help greatefully received.  I have no idea where to
go from here :-(

cheers

ian


---

###
#
# snmpd.conf
#
#   - created by the snmpconf configuration program
#
###
# SECTION: System Information Setup
#
#   This section defines some of the information reported in
#   the system mib group in the mibII tree.
# syslocation: The [typically physical] location of the system.
#   Note that setting this value here means that when trying to
#   perform an snmp SET operation to the sysLocation.0 variable will make
#   the agent return the notWritable error code.  IE, including
#   this token in the snmpd.conf file will disable write access to
#   the variable.
#   arguments:  location_string
syslocation  upstairs
# syscontact: The contact information for the administrator
#   Note that setting this value here means that when trying to
#   perform an snmp SET operation to the sysContact.0 variable will make
#   the agent return the notWritable error code.  IE, including
#   this token in the snmpd.conf file will disable write access to
#   the variable.
#   arguments:  contact_string
syscontact  ian diddams
###
# SECTION: Access Control Setup
#
#   This section defines who is allowed to talk to your running
#   snmp agent.
# rwuser: a SNMPv3 read-write user
#   arguments:  user [noauth|auth|priv] [restriction_oid]
rwuser private
# rouser: a SNMPv3 read-only user
#   arguments:  user [noauth|auth|priv] [restriction_oid]
rouser public
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
#   arguments:  community [default|hostname|network/bits] [oid]
rocommunity public
# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
#   arguments:  community [default|hostname|network/bits] [oid]
rwcommunity private
###
# SECTION: Trap Destinations
#
#   Here we define who the agent will send traps to.
# trapsink: A SNMPv1 trap receiver
#   arguments: host [community] [portnum]
trapsink  msnm2  162
# trap2sink: A SNMPv2c trap receiver
#   arguments: host [community] [portnum]
trap2sink  msnm2  162
# informsink: A SNMPv2c inform (acknowledged trap) receiver
#   arguments: host [community] [portnum]
informsink  msnm2  162
# trapcommunity: Default trap sink community to use
#   arguments: community-string
trapcommunity  public
# authtrapenable: Should we send traps when authentication failures occur
#   arguments: 1 | 2   (1 = yes, 2 = no)
authtrapenable  1
###
# SECTION: Monitor Various Aspects of the Running Host
#
#   The following check up on various aspects of a host.
# proc: Check for processes that should be running.
# proc NAME [MAX=0] [MIN=0]
#
# NAME:  the name of the process to check for.  It must match
#exactly (ie, http will not find httpd processes).
# MAX:   the maximum number allowed to be running.  Defaults to 0.
# MIN:   the minimum number to be running.  Defaults to 0.
#
#   The results are reported in the prTable section of the UCD-SNMP-MIB tree
#   Special Case:  When the min and max numbers are both 0, it assumes
#   you want a max of infinity and a min of 1.
proc  sendmail 2 2
# disk: Check for disk space usage of a partition.
#   The agent can check the amount of available disk space, and make
#   sure it is above a set limit.
#
#disk PATH [MIN=10]
#
#PATH:  mount path to the disk in question.
#MIN:   Disks with space below this value will have the Mib's errorFlag
set.
#   Can be a raw byte value or a percentage followed by the %
#   symbol

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 not appear in NNM because they
don;t actually arrive...  so what other tests can I do top try and
ascertain why?  (I can telnet to port 162 for example)

cheers

ian


mail2web - Check your email from the web at
http://link.mail2web.com/mail2web



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
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


Problem Using TCP for Sending Traps

2007-05-18 Thread John Giaccotto
Hi,

I have configured snmptrapd to listen on both UDP and TCP ports.  I
start snmptrapd as follows:

$SNMPTRAPD -On -C -c $SNMPTRAPDCONF -Lf $LOGFILE udp:anIPAddress:162
tcp:anIPAddress:162

If I send a trap from another machine using the following line:

snmptrap -v 2c -c public tcp:anIPAddress '' .1.3.6.1.4.1.1230.1 .0.0 s
just here

Then $LOGFILE shows the following:

Unknown operation (4): This shouldn't happen!
2007-05-18 19:09:55 radi.hosts.adeptra.com [TCP: [10.11.3.22]:-29235]:
.1.3.6.1.2.1.1.3.0 = Timeticks: (2182530698) 252 days, 14:35:06.98
.1.3.6.1.6.3.1.1.4.1.0 = OID: .1.3.6.1.4.1.1230.1   .0.0 = STRING:
just here
Unknown operation (5): This shouldn't happen!

If I specify udp instead of tcp then I don't get the messages about an
unknown operation.  

I am running Net-SNMP 5.3.0.1 on Red Hat Linux 4.

Can anyone shed some light on what might be causing this?

Thanks,
John





-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
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 Using TCP for Sending Traps

2007-05-18 Thread Dave Shield
On 18/05/07, John Giaccotto [EMAIL PROTECTED] wrote:
 I have configured snmptrapd to listen on both UDP and TCP ports.


 If I send a trap from another machine using the following line:

 snmptrap -v 2c -c public tcp:anIPAddress '' .1.3.6.1.4.1.1230.1 .0.0 s
 just here

 Then $LOGFILE shows the following:

 Unknown operation (4): This shouldn't happen!
 I am running Net-SNMP 5.3.0.1 on Red Hat Linux 4.

 Can anyone shed some light on what might be causing this?


See the patch 
http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/branches/V5-3-patches/net-snmp/apps/snmptrapd_handlers.c?r1=15088r2=15729view=patch

Dave

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
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


How to assign a specific interface carrd for sending traps

2007-04-17 Thread Reza Salehi
Hi,
   
  If my machine has many interface cards(eth0.eth1,ath0,) and I want to 
assign outgoing traps to eth1(for example) what I should do.
   
  I appreciate your help,
  Reza

   
-
Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos.-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
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


Problems with Sun Solaris sending traps

2007-04-05 Thread Michael Lineback
I am attempting to send traps from a Sun Solaris 9 box to nms system.I have 
Net-Snmp V5.1.1.Configuration options show disman/event-mib is enabled in 
the Configure options.
The following is an example of the traps that I get from the server.

Generic: 6; Specific: 2; Community: bipolar; Enterprise: .1.3.6.1.4.1.8072.4;
Variables: $*

I get no detailed information as to what the specific trap is, I am assuming 
that this is for the SNMP agent start and stop.

But I get no information from the poller for disk usage and process usage.
Attached is a copy of the snmpd.conf file.The actual host information has 
been changed as the company will not allow it to go out. nms.host.com 
or nms.host.net is the Network Management System FQDN.

Thanks



snmpd.conf.mail
Description: 2586661427-snmpd.conf.mail
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
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: Problems with Sun Solaris sending traps

2007-04-05 Thread Dave Shield
On 05/04/07, Michael Lineback [EMAIL PROTECTED] wrote:
 I am attempting to send traps from a Sun Solaris 9 box to nms system.I
 have Net-Snmp V5.1.1.Configuration options show disman/event-mib is
 enabled in the Configure options.

The 5.1.1 release is extremely old by now, and the disman support was
very much in its early stages.  We would strongly recommend that you
try with a more recent release.   The DisMan Event MIB has been
completely re-implemented since the 5.1.x line, and is now much more
reliable.


Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: 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.
Yes - you would have to construct a copy of the template PDU,
and send that instead.

 tpdu = snmp_pdu_create(SNMP_MSG_TRAP2);
// set up tpdu
pdu = snmp_clone_pdu( tpdu );   snmp_send( ss1, pdu );
pdu = snmp_clone_pdu( tpdu );   snmp_send( ss2, pdu );
pdu = snmp_clone_pdu( tpdu );   snmp_send( ss3, pdu );

Dave

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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: 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 this 
method can resolve the problem perfectly.
 Thank you very much for your help,Dave~!
   
   
  Best regards,
   
  zhou

Dave Shield [EMAIL PROTECTED] 写道:
  On 12/02/07, jin zhou 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.
Yes - you would have to construct a copy of the template PDU,
and send that instead.

tpdu = snmp_pdu_create(SNMP_MSG_TRAP2);
// set up tpdu
pdu = snmp_clone_pdu( tpdu ); snmp_send( ss1, pdu );
pdu = snmp_clone_pdu( tpdu ); snmp_send( ss2, pdu );
pdu = snmp_clone_pdu( tpdu ); snmp_send( ss3, pdu );

Dave



-
 雅虎1G免费邮箱百分百防垃圾信
 雅虎助手-搜索、杀毒、防骚扰  -
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
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: 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 thought about 
this too,but it is the fact.So I should rebuild the same trap with the same 
pdu so as to send it to different receivers.The effiency is very low!But I 
think it is necessary if using this method,isn't it?
  
Dave Shield [EMAIL PROTECTED] 写道:
  [ 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 08/02/07, jin zhou wrote:
 Thank you .But I find it is boring when the trap receivers is not just
 only 1,while I should revaluate the session variable to send traps to
 different receivers for many times.Can session.peername include several
 destinations or is there any way to resolve this problem?

For each destination, you'll need to open a new session.
But you can use the same template for each of them.
Something like:

session.version = SNMP_VERSION2c;
session.community = public;

session.remotepeer = trapdest1:162;
ss1 = snmp_open( session );
session.remotepeer = trapdest2:162;
ss2 = snmp_open( session );
session.remotepeer = trapdest3:162;
ss3 = snmp_open( session );

pdu = snmp_pdu_create(SNMP_MSG_TRAP2);
snmp_send( ss1, pdu );
snmp_send( ss2, pdu );
snmp_send( ss3, pdu );


If you're going to be sending several traps to the same destinations,
then you could re-use the ss1,ss2,ss3 structures from one time
to the next - rather than re-creating them every time.



Note that the code above is a gross oversimplification, and is
almost certainly not correct (as well as being incomplete). But
it should give you the basic idea.

Dave

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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




-
抢注雅虎免费邮箱-3.5G容量,20M附件! -
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
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


problem with sending traps

2007-02-10 Thread Hamid Taromian
hi,
  i  am using net snmp version 5.2.3 and i want to send traps.
  i have this line trap2sink all, and once i used trap2sink (the manager ip),
  and i am using send_v2trap. but i see nothing at the manager machine.
  how can i get sure that my first machine is sending the trap.
  i have to mention that when i use snmptrap command i can get the output at 
the manager snmptrapd deamon.
   
  thanks.

 
-
TV dinner still cooling?
Check out Tonight's Picks on Yahoo! TV.-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
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 sending traps

2007-02-10 Thread Dave Shield
On 10/02/07, Hamid Taromian [EMAIL PROTECTED] wrote:
 i have this line trap2sink all

That would send traps to the host called all


 how can i get sure that my first machine is sending the trap.

Run the agent with the '-d' flag.
That will show raw packet dumps - including any traps.

Dave

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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: 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 08/02/07, jin zhou [EMAIL PROTECTED] wrote:
   Thank you .But I find it is boring when the trap receivers is not just
 only 1,while I should revaluate the session variable to send traps to
 different receivers for many times.Can session.peername include several
 destinations or is there any way to resolve this problem?

For each destination, you'll need to open a new session.
But you can use the same template for each of them.
Something like:

session.version = SNMP_VERSION2c;
session.community = public;

session.remotepeer = trapdest1:162;
ss1 = snmp_open( session );
session.remotepeer = trapdest2:162;
ss2 = snmp_open( session );
session.remotepeer = trapdest3:162;
ss3 = snmp_open( session );

pdu = snmp_pdu_create(SNMP_MSG_TRAP2);
snmp_send( ss1, pdu );
snmp_send( ss2, pdu );
snmp_send( ss3, pdu );


If you're going to be sending several traps to the same destinations,
then you could re-use the ss1,ss2,ss3  structures from one time
to the next - rather than re-creating them every time.



Note that the code above is a gross oversimplification, and is
almost certainly not correct (as well as being incomplete).  But
it should give you the basic idea.

Dave

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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: 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 the 
 destination IP can be changed successfully.Therefore,the snmptrapd cant 
 receive the traps.This situation also occurs when other net-snmp apps using 
 snmp_send(ss,pdu) .

What Net-SNMP version are you working with?


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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: 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 on port 161,even 
 through i use the codesession.remote_port= SNMP_TRAP_PORT;,while the 
 destination IP can be changed successfully.Therefore,the snmptrapd cant 
 receive the traps.This situation also occurs when other net-snmp apps using 
 snmp_send(ss,pdu) .

What Net-SNMP version are you working with?


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)



-
 雅虎免费邮箱-3.5G容量,20M附件-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
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: 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   somehost:162
(and forget about the remote_port field).

Dave

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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: 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 PROTECTED] 写道:
  On 08/02/07, 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

Specify the destination as somehost:162
(and forget about the remote_port field).

Dave

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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




-
 雅虎免费邮箱-3.5G容量,20M附件-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
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: 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 agent.

Dave

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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


Sending traps with dynamic destinations

2007-02-07 Thread jin zhou
Dear Dave and all,
   
Hi,I am sorry to interrupt you again becuase I have another trouble.I need 
to send traps to dynamic destinations which only can be determined when sending 
traps on IPV4,so the trap API routines 'send_easy_trap()' or 'send_v2trap' are 
not so effective because I am not able to write destinations staticly in the 
snmpd.conf file.If i want to change the file dynamicly when apps running,there 
will be another problem:it seems like that the changes only can take effect 
when snmpd apps restart,which is not expected.
Is there any way to resolve this problem?
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 the destination IP 
can be changed successfully.Therefore,the snmptrapd cant receive the traps.This 
situation also occurs when other net-snmp apps using snmp_send(ss,pdu) .
How can I resolve this problem?Thank you for your help.
   
  Best regards,
   
  zhou



-
 Mp3疯狂搜-新歌热歌高速下   -
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___
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: 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 use /var/agentx/master.
So I don't understand why these dumps are showing connections
via 127.0.0.1:

 Received 80 bytes from 127.0.0.1
 : 01 01 00 00  00 00 00 00  00 00 00 00  5B 0A B0 59...


What are the settings in your snmpd.conf file?
Which version of the agent are you using?

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: 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 this change the socket to which my subagent is trying to connect
 to?


Why waste time asking me?
Why not simply try it and see?

Yes - that code should configure the subagent to connect to a local socket.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: sending traps from embedded AgentX subagent

2006-12-19 Thread Srivastava, Namburi (IE10)
I tried it, but still keep getting transport disconnect messages printed
by the master agent.

There are a few observations that make me curious.
1.  as long as I don't run the subagent, I don't get the transport
disconnect messages from the master agent.
2.  If agent and master agent are getting connected on different
sockets, then how does the master agent get to know there is a sub-agent
which is trying to register itself along with its MIBS?
3.  Finally, I tried to forcefully change the socket on which the master
agent listens.  In such scenario, the sub-agent prints debug messages
saying unknown server and failed to connect.

Regards,
Sri.

-Original Message-
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)
[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 this change the socket to which my subagent is trying to connect
 to?


Why waste time asking me?
Why not simply try it and see?

Yes - that code should configure the subagent to connect to a local
socket.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: sending traps from embedded AgentX subagent

2006-12-19 Thread Srivastava, Namburi (IE10)
 00  5C 0A B0 59
\..Y
0016: 3C 00 00 00  00 00 00 00  05 04 00 00  01 00 00 00
...
0032: 88 1F 00 00  03 00 00 00  02 00 00 00  0A 00 00 00

0048: 19 00 00 00  4E 65 74 2D  53 4E 4D 50  20 41 67 65Net-SNMP
Age
0064: 6E 74 58 20  73 75 62 2D  61 67 65 6E  74 00 00 00ntX
sub-agent...


Resending 80 bytes to 127.0.0.1
: 01 01 00 00  00 00 00 00  00 00 00 00  5C 0A B0 59
\..Y
0016: 3C 00 00 00  00 00 00 00  05 04 00 00  01 00 00 00
...
0032: 88 1F 00 00  03 00 00 00  02 00 00 00  0A 00 00 00

0048: 19 00 00 00  4E 65 74 2D  53 4E 4D 50  20 41 67 65Net-SNMP
Age
0064: 6E 74 58 20  73 75 62 2D  61 67 65 6E  74 00 00 00ntX
sub-agent...


Resending 80 bytes to 127.0.0.1
: 01 01 00 00  00 00 00 00  00 00 00 00  5C 0A B0 59
\..Y
0016: 3C 00 00 00  00 00 00 00  05 04 00 00  01 00 00 00
...
0032: 88 1F 00 00  03 00 00 00  02 00 00 00  0A 00 00 00

0048: 19 00 00 00  4E 65 74 2D  53 4E 4D 50  20 41 67 65Net-SNMP
Age
0064: 6E 74 58 20  73 75 62 2D  61 67 65 6E  74 00 00 00ntX
sub-agent...


Resending 80 bytes to 127.0.0.1
: 01 01 00 00  00 00 00 00  00 00 00 00  5C 0A B0 59
\..Y
0016: 3C 00 00 00  00 00 00 00  05 04 00 00  01 00 00 00
...
0032: 88 1F 00 00  03 00 00 00  02 00 00 00  0A 00 00 00

0048: 19 00 00 00  4E 65 74 2D  53 4E 4D 50  20 41 67 65Net-SNMP
Age
0064: 6E 74 58 20  73 75 62 2D  61 67 65 6E  74 00 00 00ntX
sub-agent...


Sending 80 bytes to 127.0.0.1
: 01 01 00 00  00 00 00 00  00 00 00 00  5D 0A B0 59
]..Y
0016: 3C 00 00 00  00 00 00 00  05 04 00 00  01 00 00 00
...
0032: 88 1F 00 00  03 00 00 00  02 00 00 00  0A 00 00 00

0048: 19 00 00 00  4E 65 74 2D  53 4E 4D 50  20 41 67 65Net-SNMP
Age
0064: 6E 74 58 20  73 75 62 2D  61 67 65 6E  74 00 00 00ntX
sub-agent...



-Original Message-
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)
[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 this change the socket to which my subagent is trying to connect
 to?


Why waste time asking me?
Why not simply try it and see?

Yes - that code should configure the subagent to connect to a local
socket.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: sending traps from embedded AgentX subagent

2006-12-18 Thread David Arthur
Dave,

Thank you for the help debugging this AgentX connection.

For the benefit of other list members:
Be sure that both ends of the AgentX connection are using the same socket
type, address, and port. The Net-SNMP master in my case was trying to use
the Unix domain socket /var/agentx/master, but I had my embedded subagent
trying to connect on udp:localhost:705 socket. I fixed the setup conflict in
my case by adding the following line to my snmdp.conf file:

agentxsocket udp:localhost:705

(I chose the internet socket for network portability reasons, versus
changing my embedded subagent 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 embedded AgentX subagent

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?



 /usr/local/share/snmp/agentSNMPAlert.conf: line 7:
 Warning: Unknown token: trapsink.
 /usr/local/share/snmp/agentSNMPAlert.conf: line 18:
 Warning: Unknown token: trap2community.

Hmmm... that looks worrying.
If the master agent doesn't know about trapsink and the like,
then it shouldn't be able to send traps out at all.

but:

 Sending 44 bytes to UDP: [www.xxx.yyy.zzz]:162
 : 30 2A 02 01  00 04 06 70  75 62 6C 69  63 A4 1D 06
0*.public...
 0016: 0A 2B 06 01  04 01 BF 08  03 02 0A 40  04 AC 10 00
[EMAIL PROTECTED]
 0032: 2D 02 01 00  02 01 00 43  01 24 30 00 -..C.$0.

I don't understand how it is generating this packet, given that it
doesn't like the trapsink directive.

I'd also expect to see the connection conversation from your subagent.
If that initial AgentX request isn't being received, then the subagent won't
be able to talk to the master agent for sending traps either.


I think you need to look again at how your subagent is setting up the
connection to the master agent.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: sending traps from embedded AgentX subagent

2006-12-18 Thread Srivastava, Namburi (IE10)
I got into a similar problem, which I am still trying to fix.
The master agent in my case too is trying to connect on
/var/agentx/master...

How do I find to which socket does the sub-agent is trying to connect???

Regards,
Sri.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL 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 of the AgentX connection are using the same
socket
type, address, and port. The Net-SNMP master in my case was trying to
use
the Unix domain socket /var/agentx/master, but I had my embedded
subagent
trying to connect on udp:localhost:705 socket. I fixed the setup
conflict in
my case by adding the following line to my snmdp.conf file:

agentxsocket udp:localhost:705

(I chose the internet socket for network portability reasons, versus
changing my embedded subagent 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 embedded AgentX subagent

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?



 /usr/local/share/snmp/agentSNMPAlert.conf: line 7:
 Warning: Unknown token: trapsink.
 /usr/local/share/snmp/agentSNMPAlert.conf: line 18:
 Warning: Unknown token: trap2community.

Hmmm... that looks worrying.
If the master agent doesn't know about trapsink and the like,
then it shouldn't be able to send traps out at all.

but:

 Sending 44 bytes to UDP: [www.xxx.yyy.zzz]:162
 : 30 2A 02 01  00 04 06 70  75 62 6C 69  63 A4 1D 06
0*.public...
 0016: 0A 2B 06 01  04 01 BF 08  03 02 0A 40  04 AC 10 00
[EMAIL PROTECTED]
 0032: 2D 02 01 00  02 01 00 43  01 24 30 00
-..C.$0.

I don't understand how it is generating this packet, given that it
doesn't like the trapsink directive.

I'd also expect to see the connection conversation from your subagent.
If that initial AgentX request isn't being received, then the subagent
won't
be able to talk to the master agent for sending traps either.


I think you need to look again at how your subagent is setting up the
connection to the master agent.

Dave


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE
V
___
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




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE
V
___
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

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: 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 adding
   netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
   NETSNMP_DS_LIB_DUMP_PACKET, 1);
to the subagent code.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: sending traps from embedded AgentX subagent

2006-12-18 Thread Srivastava, Namburi (IE10)
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
agentx/master: close 0x014200, -15 62 6C 69  63 A2 1F 02
0,.public.
agentx/master: transport disconnect on session 0x014400B
.x...0.0..
agentx/master: close 0x014400, -11 01 01 00  80 00
.c
agentx/master: transport disconnect on session 0x014200
agentx/master: close 0x014200, -1ct on session 0x014400
agentx/master: close 0x014400, -1

is it that by default the sub-agent will be listening on
 agentxsocket udp:localhost:705 ???

Sri.

-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, 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 adding
   netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
   NETSNMP_DS_LIB_DUMP_PACKET, 1);
to the subagent code.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: 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 socket, rather than
the named socket /var/agentx/master.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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: sending traps from embedded AgentX subagent

2006-12-18 Thread Srivastava, Namburi (IE10)
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 this change the socket to which my subagent is trying to connect
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

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 socket, rather than
the named socket /var/agentx/master.

Dave

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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


sending traps from embedded AgentX subagent

2006-12-14 Thread David Arthur
Hello all:

I am unable to get traps from an embedded subagent. I have a C++ application
that runs a module containing an embedded AgentX subagent. Though there are
other app-specific things going on in between, the following is the code
that relates to the embedded subagent. (I have verified that all of this
code is being run, in the order shown.)
-- agentSNMPAlert is the name of my application module that is the embedded
AgentX subagent. Also, the init_agentSNMPAlert() function is just
registering a few MIB objects that I am not yet using for anything...I am
just trying to get the traps to reach my NMS.

// During initialization function for the module:
snmp_enable_stderrlog();  //  set up STDERR logging
netsnmp_ds_set_boolean(
   NETSNMP_DS_APPLICATION_ID,
   NETSNMP_DS_AGENT_ROLE,
   1);//  set agent role in DS
netsnmp_ds_set_string(
   NETSNMP_DS_APPLICATION_ID,
   NETSNMP_DS_AGENT_X_SOCKET,
   udp:localhost:705);  //  set host:port for socket
init_agent(agentSNMPAlert); //  init agent library
init_agentSNMPAlert();//  run MIB module init
init_snmp(agentSNMPAlert);  //  init SNMP library

// My subagent processing loop (gets started on its own thread)
while(!bSNMPShutdown){  // While SNMP is running,
  agent_check_and_process(1);   //  process SNMP gets/sets
}
snmp_shutdown(agentSNMPAlert);// Shutdown the subagent
SOCK_CLEANUP;   // Clean up after socket

// My attempt to send a trap:
// (EGP neighbor loss is used so I can discern my trap for the
//  other cold start trap produced by the master agent on startup.)
// This call is made when the subagent should be up and running.
send_easy_trap(5, 0);   // Send EGP neighbor loss

In my snmpd.conf file I have a trapsink defined to send me traps:
trapsink my.dotted.ip.address public 162

I do get the cold start trap from the Net-SNMP master agent, but not from my
embedded subagent. I have tried using the same trapsink line defined in
agentSNMPAlert.conf but it is causing some problem and I don't get the trap
from my embedded subagent either way??

This is the output that I get when the master agent is started with:
snmpd -Dagentx -mall

output:
No log handling enabled - turning on stderr logging
registered debug token agentx, 1
agentx_register_app_config_handler: registering .conf token for
agentxsocket
agentx_register_app_config_handler: registering .conf token for
agentxperms
agentx_register_app_config_handler: registering .conf token for
agentxRetries
agentx_register_app_config_handler: registering .conf token for
agentxTimeout
/usr/local/share/snmp/agentSNMPAlert.conf: line 7: Warning: Unknown token:
trapsink.
/usr/local/share/snmp/agentSNMPAlert.conf: line 18: Warning: Unknown token:
trap2community.
net-snmp: 1 error(s) in config file(s)
/usr/local/share/snmp/snmpd.conf: line 11: Warning: Unknown token: agentx.
/usr/local/share/snmp/snmpd.conf: line 40: Warning: Unknown token:
trap2community.
net-snmp: 1 error(s) in config file(s)
NET-SNMP version 5.3.1

Thank you very much for your help on this!
David Arthur


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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


  1   2   >