Re: MODE_SET_*

2005-10-18 Thread Dave Shield
On Mon, 2005-10-17 at 18:42 +0200, Roman Medina-Heigl Hernandez wrote:
I missed the part that a SET request can set
 several variables, not only one. Then it is some kind of attempt to
 reach a pseudo-atomic operation

Exactly.

  (which never gets really true since COMMIT may unexpectedly fail).

But there is a responsibility on you (as a MIB developer) to take
every care that it does not!
   If applying an assignment could realistically fail, then you
should be doing this during the ACTION pass, and be ready to
reverse it in the UNDO pass.

If you're simply updating some internal variables - that's probably
safe enough to do in the COMMIT pass.  And there are some situations
where reversing an assignment is likely to be more unreliable than
acting on it in the first place.  In which case COMMIT is probably the
least worst option.

But if acting on an assignment can potentially fail, and it's realistic
to reverse it, then this should be handled in the ACTION/UNDO passes.
Yes, this is more work than COMMIT-based handling, but laziness is no
excuse for irresponsibility :-)


Dave


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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: mib2c

2005-10-18 Thread Dave Shield
On Mon, 2005-10-17 at 14:43 -0400, Eugen wrote:
 Thanks for your answer. Actually what I did was the following:
 
 - I've downloaded the package net-snmp-5.2.1.2-1.src.rpm
   from net-snmp web page

I though you said you'd installed the RedHat-provided version
of Net-SNMP ?


 - I've generated the binaries with rpm -bb net-snmp.spec

The perl modules aren't built by default - you need to explicitly
request that they be include (-with perl_modules).  See the
head of the net-snmp.spec file.



 So it seems that in 5.2.1.2 the net-snmp-utils is part of
 the other modules.

Not quite - this is a difference between RedHat packaging
and our arrangements, not the version of Net-SNMP.
The RedHat RPMs distinguish between the setup required for
just running the agent (net-snmp), and for using the
command-line tools (net-snmp-utils).  We don't - our
net-snmp RPM covers both.



 When trying to run mib2c I received that error message than, following
 the instructions, I've installed the net-snmp-perlmods-5.2.1.2-1
 directly from the binary downloaded on the same net-snmp web page
 (net-snmp-perlmods-5.2.1.2-1.i686.rpm since I didn't found the rpm
 source of this module).

H.
The problem with that particular RPM is that it doesn't specify
which O/S it was built against.  You may have better luck using
one of the O/S-specific perlmods RPMs (rh9, fc2, fc4 or el4)


 Could this be caused by the fact that the binaries generated from the
 net-snmp source package have all the extension *i386.rpm versus
 net-snmp-perlmods-5.2.1.2-1.i686.rpm ?

Sort of - it's more likely to be the O/S assumptions of that particular
RPM don't match your system.  That's why the other (i386) RPMs each
specify which O/S they were built on.
  We'll need to ensure that the i686 version requirements are made
clearer in the future.


 And another thing. After the net-snmp-perlmods installation I was
 expecting to have some file or directory containing the name mib2c

No - the mib2c tool (and supporting directories) is part of the
main 'net-snmp' RPM, not the 'net-snmp-perlmods' RPM.
It *requires* the perl modules, but it isn't part of them.


  rpm -ql net-snmp-perlmods-5.2.1.2-1

Try
rpm -ql net-snmp | grep mib2c

Dave


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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: Get IP-addresses and names of hosts attached to Switchports

2005-10-18 Thread Dave Shield
On Mon, 2005-10-17 at 13:15 -0400, Robert Story wrote:
 On Fri, 14 Oct 2005 12:14:39 +0200 Boris wrote:
 BF output:
 BF SNMPv2-SMI::mib-2.17.4.3.1.1.0.0.28.182.27.202 = Hex-STRING: 00 00 1C B6 
 BF 1B DF
 
 Any part of that look familiar? '28.182.27.202' looks like an ip address to me

Close.
It's actually 0:0:28:182:27:202, and is the Mac Address of the system
concerned.  This OID translates to
BRIDGE-MIB::dot1dTpFdbAddress.0.0.28.182.27.202
and is the index of the Forwarding Database (dot1dTpFdbTable)

BRIDGE-MIB::dot1dTpFdbPort  (mib-2.17.4.3.1.2) will report which port
traffic for that particular Mac Address will be sent to.

You'd need to use another lookup to perform the Mac-IP mapping
(e.g. the ipNetToMediaTable of some well-connected system,
 probably *not* the switch itself).  Or use a local database.


  I don't know of any stanard MIBs that have ip/host mapping.

That would be the DISMAN-NSLOOKUP-MIB.
It's not particularly widely implemented, AFAIK.

Dave


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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: timeout exponentially backoff ?

2005-10-18 Thread Dave Shield
On Mon, 2005-10-17 at 12:34 -0400, Robert Story wrote:
 On Mon, 26 Sep 2005 13:32:41 +0100 Dave wrote:

 DS The backoff code was removed in 1998
 
 Anyone have a good enough memory to remember why?

After 7+ years?  Are you nuts, Robert?
I have enough difficulty remembering what got changed
(and why) after 7 days!

I don't have the time ATM to look up exactly when this
change was made.  (It took quite a bit of searching last
time).  But I seem to vaguely recall that it was probably
part of Mike's SSI stuff.


Seems like a good idea to me,
 eve it it's optional instead of the default.

After so long with a fixed backoff, any change to
the Net-SNMP timeout behaviour *must* be optional
(and default to off).

Yes - this is probably worth doing at some point.
If you want to see it in 5.3, then you'd better get
moving quickly!  Otherwise it'll have wait until 5.4.

Dave


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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: Help with exec and pass

2005-10-18 Thread Santanu Misra
Thanks Dave, 

LOL I liked your comments ;)

I will make note of this as I am learning a lot about snmp with my
little steps. 


-Regards
Santanu


-Original Message-
From: Dave Shield [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 18 October, 2005 14:47
To: Santanu Misra
Cc: net-snmp-users@lists.sourceforge.net
Subject: RE: Help with exec and pass

On Mon, 2005-10-17 at 10:38 +0200, Santanu Misra wrote: 
  I am going to post the dummies how to on that. You
 are welcome to make your comments on that.

Oh, you foolish, foolish person!
You really shouldn't make suggestions like that :-)

  Here is the draft.


 1. It should always reply with 3(three) sets of DATA
   - The OID
   - The Type (String or integer)

A pass script can return more than just string or
(signed) integer values.  There are about eight or
nine recognised types.  You've missed the following:

unsigned
counter
octet
gauge
objectid
timetick
ipaddress

It doesn't support 64-bit counters (unfortunately),
and you can probably safely ignore opaque.  But
the type returned must match the MIB definition.



 2. It should not print anything or debug message if there is
  anything wrong it should just do an exit!!

That's true for  GET/GETNEXT requests.
It doesn't hold for processing SET requests.


 3. The script should be able to answer to -g and -n option
  only when that was passed otherwise do an exit.

Nope - it should also handle -s, for SET requests.
(I hope that you *have* read the man page!?)


 4. When it is -g it should print the value for the OID it was asked.
 Example:
 
 # /usr/bin/lmstat.pl -g .1.3.6.1.4.1..1.0.0
 .1.3.6.1.4.1..1.0.0
 string
 QAC_runtime


 5. When it is -n it should print the value for the next OID,
 # /usr/bin/lmstat.pl -n .1.3.6.1.4.1..1.0.0
 .1.3.6.1.4.1..1.0.1

You'd probably be better off illustrating this with the
next scalar-style OID - .1.3.6.1.4.1..1.1.0

It's unlikely that both .1.3.6.1.4.1..1.0.0 and
.1.3.6.1.4.1..1.0.1 would be valid in any sensible MIB.
(In fact, ending with two 0's is unusual, and you'd do
better using ...1.1.0 and ...1.2.0 instead)

 integer
 0

Note that with -n, the requested OID need not actually be valid
for a -g request.  The following invocations:

/usr/bin/lmstat.pl -n .1.3.6.1.4.1..1.0.0
/usr/bin/lmstat.pl -n .1.3.6.1.4.1..1.0.0.0.0.0.0.0.0
/usr/bin/lmstat.pl -n .1.3.6.1.4.1..1.0.99
/usr/bin/lmstat.pl -n .1.3.6.1.4.1..1.1

should *all* return the same results (for .1.3.6.1.4.1..1.1.0)



 6. When the last OID is reached it should exit.

Or anything following.


Dave


-
Visit our Internet site at http://www.reuters.com

To find out more about Reuters Products and Services visit 
http://www.reuters.com/productinfo 

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.



---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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 can I test perl modules?

2005-10-18 Thread Radek Vokál
On Tue, 2005-10-18 at 15:27 +0200, Roman Medina-Heigl Hernandez wrote:
 Radek Vokál wrote:
  I've tried to run sample perl module from
  
  http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/perl/perl_module.pl
  
  I've also modified the snmpd.conf to load the module
  
  # head /etc/snmp/snmpd.conf
  perl do /etc/snmp/perl_module.pl;
  
  snmpd doesn't display any error, so I guess it's loaded .. 
 
 Do the following: kill/stop snmpd (if running as daemon), open a
 shell/xterm/etc and run snmpd in foreground:
 $ snmpd -f -Lsd -Lf /var/log/snmpd.log -p /var/run/snmpd -a
 
 Now you should see messages like:
 starting perl_module.pl
 perl_module.pl loaded ok

That's exactly what I would love to see but still I don't get any line
that the module is loaded

[EMAIL PROTECTED] ~#  snmpd -f -Lsd -Lf /var/log/snmpd.log -p /var/run/snmpd
-a
[EMAIL PROTECTED] ~# head /var/log/snmpd.log
too many sensors. ignoring serial16
Turning on AgentX master support.
NET-SNMP version 5.2.2.rc1
Connection from UDP: [127.0.0.1]:41819
Received SNMP packet(s) from UDP: [127.0.0.1]:41819
Received TERM or STOP signal...  shutting down...


 
 In general your perl module can write to STDERR and it will be dumped
 into the former shell so it is a quick method for debugging. Note also
 that when you modify the module snmpd should be restarted, so you simply
 go to the shell, hit ctrl-c, and launch snmpd (in foreground) again.
 
 Regards,
 -Roman
-- 
Radek Vokál [EMAIL PROTECTED]


signature.asc
Description: This is a digitally signed message part


Re: How can I test perl modules?

2005-10-18 Thread Thomas Anders

Radek Vokál wrote:
at's exactly what I would love to see but still I don't get any line

that the module is loaded

[EMAIL PROTECTED] ~#  snmpd -f -Lsd -Lf /var/log/snmpd.log -p /var/run/snmpd


Run with -Dread_config -Dperl.


+Thomas

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


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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 can I test perl modules?

2005-10-18 Thread Dave Shield
On Tue, 2005-10-18 at 15:27 +0200, Roman Medina-Heigl Hernandez wrote:

 Do the following: kill/stop snmpd (if running as daemon), open a
 shell/xterm/etc and run snmpd in foreground:
 $ snmpd -f -Lsd -Lf /var/log/snmpd.log -p /var/run/snmpd -a

I'd actually suggest you run the agent using

snmpd -f -Le

rather than using syslog (-Lsd) and a log file (-Lf)
The perl script you refer to outputs explicitly to STDERR,
and while I haven't traced the output processing (or
tried this in practise),  I suspect it's probably safer
to have the agent explicitly log to standard output too.


Comparing your debug output to the perl control code, I'd
expect the initializing perl message to be followed by
either done initializing perl or an error:
embedded perl support failed to initalize

(see agent/snmp_perl.c:maybe_source_perl_startup())

Neither of these seems to occur.  Strange


What's in the file  /usr/share/snmp/snmp_perl.pl  ?

Dave


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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: mib2c

2005-10-18 Thread Eugen
Hi Dave,

I've patched net-snmp.spec at the top with
%define _with_perl_modules 1
I've compiles everything, the net-snmp-perlmods-5.2.1.2-1.i386.rpm was
generated, then I've installed it and it works now.

Thanks so much,
Eugen

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dave
Shield
Sent: Tuesday, October 18, 2005 4:39 AM
To: Eugen
Cc: 'Robert Story'; net-snmp-users@lists.sourceforge.net
Subject: RE: mib2c

On Mon, 2005-10-17 at 14:43 -0400, Eugen wrote:
 Thanks for your answer. Actually what I did was the following:
 
 - I've downloaded the package net-snmp-5.2.1.2-1.src.rpm
   from net-snmp web page

I though you said you'd installed the RedHat-provided version
of Net-SNMP ?


 - I've generated the binaries with rpm -bb net-snmp.spec

The perl modules aren't built by default - you need to explicitly
request that they be include (-with perl_modules).  See the
head of the net-snmp.spec file.



 So it seems that in 5.2.1.2 the net-snmp-utils is part of
 the other modules.

Not quite - this is a difference between RedHat packaging
and our arrangements, not the version of Net-SNMP.
The RedHat RPMs distinguish between the setup required for
just running the agent (net-snmp), and for using the
command-line tools (net-snmp-utils).  We don't - our
net-snmp RPM covers both.



 When trying to run mib2c I received that error message than, following
 the instructions, I've installed the net-snmp-perlmods-5.2.1.2-1
 directly from the binary downloaded on the same net-snmp web page
 (net-snmp-perlmods-5.2.1.2-1.i686.rpm since I didn't found the rpm
 source of this module).

H.
The problem with that particular RPM is that it doesn't specify
which O/S it was built against.  You may have better luck using
one of the O/S-specific perlmods RPMs (rh9, fc2, fc4 or el4)


 Could this be caused by the fact that the binaries generated from the
 net-snmp source package have all the extension *i386.rpm versus
 net-snmp-perlmods-5.2.1.2-1.i686.rpm ?

Sort of - it's more likely to be the O/S assumptions of that particular
RPM don't match your system.  That's why the other (i386) RPMs each
specify which O/S they were built on.
  We'll need to ensure that the i686 version requirements are made
clearer in the future.


 And another thing. After the net-snmp-perlmods installation I was
 expecting to have some file or directory containing the name mib2c

No - the mib2c tool (and supporting directories) is part of the
main 'net-snmp' RPM, not the 'net-snmp-perlmods' RPM.
It *requires* the perl modules, but it isn't part of them.


  rpm -ql net-snmp-perlmods-5.2.1.2-1

Try
rpm -ql net-snmp | grep mib2c

Dave


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads,
discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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


Binary that installs just the snmp utils

2005-10-18 Thread Ravi Malghan
Hi: I want to install UCD-SNMP with just the SNMP
utilities (primarily snmpget, snmpwalk) for Solaris 9.
I donot want the agent or anything else. I have
searched everywhere and not found one. 
1. Does anybody know if such a binary exists
2. if not how do I create one. What do I need to do
before I run configure?

Thanks
Ravi




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
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


Multiple sets in one pdu

2005-10-18 Thread Yong Chen (yongche)



Hi,

I'm facing a problem with 
multiple sets in one pdu, basically it's sequence issue.

Say the pdu is set 
for 5 oids as following: oid_1.1 oid_2.1 
oid_1.2 oid_2.2 oid_1.3 (oid_1 and oid_2 are 
variables in two different tables, .1/.2/.3 are indice)

It seems the agent does 
some optimization, so instead of doing:

 set 
oid_1.1
 set 
oid_2.1
 set 
oid_1.2
 set 
oid_2.2
 set 
oid_1.3

it actually does 
following:

 set 
oid_1.1
 set 
oid_1.2
 set 
oid_1.3
 set 
oid_2.1
 set 
oid_2.2

This is not what I want, I 
want the original sequence. I'm using net-snmp 5.1. 

Has anyone seen this issue? 
I found in ChangeLog following, but seems it's not what I 
see.

*5.0.1*
Fixes: - the agent should properly handle requests in 
the right order. (e.g., restrict the agent to 
processing only one SET at a time)


Does anyone know what trap it is ?

2005-10-18 Thread Ryan guo
hi ,all, ireceived some stange traps through trap receiver,the snmp trap 's source is 0.0.0.0,andtrap'soid is 1.3.6.1.4.8072.3.2.10,i lookup some references ,and get that this oid is locate in 
NET-SNMP.that is netSnmp(8072).netSnmpEnumerations(3).netSnmpAgentOIDs(2),and i wanna know that what the useness this trap it is and why it's source is 0.0.0.0,i will very appreciate anyone who can help 
me.and attachment is the pic of trap printscreen.
attachment: snmp2.jpg