RE: newbie

2016-08-11 Thread Mark Reynolds
Hi Jaya,

What is it you want to use NetSNMP to do?



Mark



*From:* Jayashree M A [mailto:rangili.ma...@gmail.com]
*Sent:* 11 August 2016 10:04
*To:* net-snmp-users@lists.sourceforge.net
*Subject:* newbie



Hi,



I am a newbie to net-snmp and snmp and nms/ems

Could someone give me pointers to good tutorial or books

to come upto speed.



Thanks in advance

Jaya

-- 

--
* Email confidentiality notice *
This message is private and confidential. If you have received this message 
in error, please notify us and remove it from your system.
Insider Technologies Limited is a company registered in England and Wales 
(Company Number: 2352867) and its registered office is at: Spinnaker Court, 
Chandlers Point, 37 Broadway, Salford Quays, MANCHESTER, United Kingdom, 
M50 2YR
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev___
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: SNMP v3 newbie question

2016-04-16 Thread Dan Miller

  
  
On 04/15/16 16:58, Wes Hardaker wrote:

  Dan Miller  writes:


  

  created ~/.snmp/snmpd.conf :



defSecurityName MD5User

  
  ...


  

  sent:


sudo snmpgetnext 127.0.0.1 1.3.6.1.2.1.1.2.0
snmpgetnext: No securityName specified

  
  
I'm betting the problem is that you're running it as sudo, which means
it's looking in root's ~/.snmp directory and not yours.  Why are you
running snmpgetnext as root?  It shouldn't be needed.


Oh!!!?0?2 I didn't even
think about it... almost anything involving network accesses
requires root; I just made assumptions!!?0?2 

Okay, just tried as normal user, and I don't get the name errors
now; but I still time out on both attempts:
snmpget -v 3 -n none -u usr-none-none -l noAuthNoPriv
demo.snmplabs.com 1.3.6.1.2.1.1.2.0
and 
snmpgetnext -v 3 -n none -l noAuthNoPriv -u noAuthUser 127.0.0.1
1.3.6.1.2.1.1.2.0

BTW, I verified that I can ping demo.snmplabs.com, so there's no
general access issue.
Also, my linux firewall is disabled, so there's no blocking
going on.

//***
Okay, I think I understand what is going on... 
I was running snmpd itself as root - so it also was likely not
seeing any of my .conf files.
I just killed it, then restarted it as normal user, and now I'm
getting all kinds of error messages from it, regarding the
various snmpd.conf files that I have scattered around.

I'll pick this back up on Monday, when I get back to work...
I need to study conf files for a bit, then try this again!!

Thank you all for your help!!
Dan Miller

  
  

	

		Virus-free. www.avast.com
		
	



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
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


SNMP v3 newbie question

2016-04-15 Thread Dan Miller

  
  
I'm trying an even
simpler test now.  I have snmpd V5.7.2 running on my machine.
Using as reference,
http://www.net-snmp.org/wiki/index.php/TUT:SNMPv3_Options

> stopped snmpd

> created ~/.snmp/snmpd.conf :

defContext none
defSecurityName MD5User
defAuthPassphrase anacomTest
defVersion 3
defAuthType MD5
defSecurityLevel authNoPriv

rouser noAuthUser
rouser MD5User
rwuser MD5DESUser

> created /var/net-snmp/snmpd.conf :

createUser NoAuthUser
createUser MD5User MD5 "The Net-SNMP Demo Password"
createUser MD5DESUser MD5 "The Net-SNMP Demo Password" DES

> restarted snmpd

> sent:
sudo snmpgetnext 127.0.0.1 1.3.6.1.2.1.1.2.0
snmpgetnext: No securityName specified

> sent:
sudo snmpgetnext -v 3 -n none -l noAuthNoPriv -u noAuthUser
127.0.0.1 1.3.6.1.2.1.1.2.0 
snmpgetnext: Unknown user name

I just can't get *anything* to work with V3 at all... I hope I'm
missing something simple???
Dan Miller


  
  

	

		Virus-free. www.avast.com
		
	



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
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: Newbie query : snmp request/response oid length

2012-09-07 Thread stavan shah
I tried it out and recompiling with the changed OID did work :)

This is a Juniper Bug and is tracked by  bug id: PR397705

Thanks Dave for your support.

Looking forward to learn more about Net SNMP.

On Thu, Aug 2, 2012 at 11:38 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote:

 On 2 August 2012 16:23, stavan shah stavan2...@gmail.com wrote:
  If a simple config change and recompiling can help it will be great. So
  wanted to understand what change am I missing in this regard.

 All I can suggest is you try it.
 That ought to work, but it's not something we've ever really looked at.

 Dave

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Newbie query : snmp request/response oid length

2012-08-02 Thread stavan shah
Hi All,

Can you please help me out with the below query.

I am using the net-snmp-5.4.2.1 package and polling a few devices.

I have a case where in the OID length is  128 subidentifiers. i.e breaking
the sub identifier length rule in http://tools.ietf.org/html/rfc2578

But I would still like to process the above requests.

From the documentation I see MAX_OID_LEN is the one limiting the same.
I have tried modifying the values for this in library/asn1.h file to an
arbitrary value say 5000 or redefining the value in the C Code.

But the above doesn't seem to process the request for OID128 sub ids.

Do I need to make any changes in the Net-snmp package to tackle this change
or am I missing any re-compilation part. Please advice.

I could find below code section in net-snmp/snmplib/asn1.c

if (0 != length) { ERROR_MSG(OID length exceeds buffer size); return
NULL; }

Will commenting this and recompiling help or what should be the step to
basically increase the OID Length to 5000 or remove this restriction
altogether.

Thanks for your time.

Thanks, Stavan
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: Newbie query : snmp request/response oid length

2012-08-02 Thread Dave Shield
On 2 August 2012 12:14, stavan shah stavan2...@gmail.com wrote:
 I am using the net-snmp-5.4.2.1 package and polling a few devices.

 I have a case where in the OID length is  128 subidentifiers. i.e breaking
 the sub identifier length rule in http://tools.ietf.org/html/rfc2578

 But I would still like to process the above requests.

I would suggest *VERY STRONGLY* that you reconsider this.
SNMP an international standard protocol - it has been designed
such that tools from a variety of different vendors are able to
work together.
   Breaking one particular set of tools to accomodate a private
extension undermines this interoperability.  It's like designing a
web-site that can only be viewed from one particular web browser.

I would suggest that you review the design of your MIB table,
and consider an alternative form of indexing, that falls within
the 128-octet limitation.

Dave

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: Newbie query : snmp request/response oid length

2012-08-02 Thread stavan shah
Thanks a lot Dave for the super quick response. I have read few of your
posts and they are definitely helping me understand things better.
I completely agree to your advice below and we are in process of
redesigning the MIB tables for this.
But there are a considerable devices to be configured and it might take a
bit of time. So till the redesign is complete I would like to incorporate
this change so that we don't miss out on data.

If a simple config change and recompiling can help it will be great. So
wanted to understand what change am I missing in this regard.
Thanks once again for your help and advice. Really appreciate that.

Cheers,
Stavan

On Thu, Aug 2, 2012 at 7:29 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote:

 On 2 August 2012 12:14, stavan shah stavan2...@gmail.com wrote:
  I am using the net-snmp-5.4.2.1 package and polling a few devices.
 
  I have a case where in the OID length is  128 subidentifiers. i.e
 breaking
  the sub identifier length rule in http://tools.ietf.org/html/rfc2578
 
  But I would still like to process the above requests.

 I would suggest *VERY STRONGLY* that you reconsider this.
 SNMP an international standard protocol - it has been designed
 such that tools from a variety of different vendors are able to
 work together.
Breaking one particular set of tools to accomodate a private
 extension undermines this interoperability.  It's like designing a
 web-site that can only be viewed from one particular web browser.

 I would suggest that you review the design of your MIB table,
 and consider an alternative form of indexing, that falls within
 the 128-octet limitation.

 Dave

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: Newbie query : snmp request/response oid length

2012-08-02 Thread Dave Shield
On 2 August 2012 16:23, stavan shah stavan2...@gmail.com wrote:
 If a simple config change and recompiling can help it will be great. So
 wanted to understand what change am I missing in this regard.

All I can suggest is you try it.
That ought to work, but it's not something we've ever really looked at.

Dave

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Newbie needs help

2012-05-26 Thread Magda Stefan
First of all I would like to 
introduce my self: I am a student in the 4th year at Technical 
University of Cluj Napoca, Romania. As I am about to graduate I have to 
do a project for my bachelor diploma which is The management of 
computers network, based on Nagios. I had to install Nagios as a manger 
and the Net-snmp as an agent to send information to it. 

    One of the tasks that I had to do was to create 2 new oids that 
represent One way delay and Available transfer rate for each of the 
computer's network interface. I chose to introduce them under the 
ifTable. Now, I have to configure the agent to get the right data from a 
file(eg. eth0atr, eth0owd) and bind it to those variables. I began with the 
mib2c.mfd.conf function to create the proper C files but I don't know how to 
modify them because on Internet I found only a tutorial for the 5.2 version of 
net-snmp.
I am using the following programs:
    - Fedora core 14
    - net-snmp version 5.5    

   

I have attached to this email my MIB file and the C files that mib2c has 
generated.
If anyone can help me with the basic steps and an example of code I would 
appreciate it!


Thank you for your consideration,
Stefan Magda

PS: Please excuse me for my bad English and please help me as soon as possible 
because I my deadline is in 3 days. 

subagg.tar.gz
Description: GNU Zip compressed data
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: Newbie needs help

2012-05-26 Thread Dave Shield
On 26 May 2012 11:00, Magda Stefan fane...@yahoo.com wrote:
     One of the tasks that I had to do was to create 2 new oids that
 represent One way delay and Available transfer rate for each of the
 computer's network interface. I chose to introduce them under the ifTable.

Hmmm   I'm not sure that's a particularly good idea.
It's probably easier to start with a completely standalone
table, rather than trying to integrate additional columns
into an existing implementation.
   And the ifTable code is probably one of the more complex
areas of the existing agent, so is going to be that much harder
to understand, let alone extend.

(And that's ignoring the fact that the ifTable is an IETF-defined standard,
so you shouldn't be unilaterally changing or extending it anyway!)


 Now, I have to configure the agent to get the right data from a file(eg.
 eth0atr, eth0owd) and bind it to those variables. I began with the
 mib2c.mfd.conf function to create the proper C files but I don't know how
 to modify them because on Internet I found only a tutorial for the 5.2
 version of net-snmp.

There won't have been any significant changes in the MIB module API
since 5.2, so that shouldn't actually be a problem.   Any 5.x-based
documentation should be broadly useable.

  I'm not a great fan of the MfD framework personally.
I'd be more inclined to start with mib2c.table-data.conf
(and turn on the internal cache, which neatly separates the
loading of data from the SNMP processing).

  But I'm sure Robert will leap to the defence of the MfD
approach - it does mean that you can ignore large chunks
of the code, and concentrate on a number of small, tightly
focussed routines

  There are several example of both approaches within
the Net-SNMP agent source code.


 PS:   please help me as soon as
 possible because I my deadline is in 3 days.

Three days?!   To extend/implement a MIB table?
With no prior experience of coding the agent?
I have to say that this feels an unrealistic timetable.
(Particularly since we're now in the weekend, so you're
effectively losing a couple of days anyway!)

I'd suggest you have a word with your tutor about exactly
what you're being asked to do - I suspect that either
you've misunderstood the exercise, or your tutor has
misjudged the scale of the task you have been set.
  (Unless you've been sitting on this exercise for some
time, of course, and have been stimulated into action by
the imminent deadline!)

Dave

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


RE: Newbie needs help

2012-05-26 Thread Magda Stefan
Thank you Dave for your fast reply.
First of all, I'm trying to finish this project for over 2 weeks, but I didn't 
want to ask for any help.I've tried many different ways to approach this 
problem, using different frameworks (mib2c.array-list and the other types).
Do you think that it will be a problem even if I want just to use only those 2 
columns? Should I try to make a new MIB file from scratch?  I have attached a 
new mib file that I wrote 10 minutes ago. It has one scalar object, for the 
number of indexes, and a table prvTable with an index and another 3 columnar 
objects. 

If you say that if I use any 5.x-based documentation should be ok? Because I 
will try to use the following 
one: http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/if-mib/ifTable/index.html.
  I saw that in my 5.5 version there is a container_load that is a little bit 
different from _cache_load from the tutorial. 

Assuming that the Mib file that I wrote is ok and I'm gonna use the mfd 
framework, can you help me with the steps (or/with the code) for binding the 
variable with a value for the begining a static one (Static char[] atr=1234)? 
I will appreciate your effort and you will help me a lot because even I know 
the C language, the way the framework generates the files confuses me. 

Thank you again for your reply and for your consideration
Stefan AtrOwdMibFile DEFINITIONS ::= BEGIN
IMPORTS
mgmt, NetworkAddress, IpAddress, Counter,
Gauge, TimeTicks
FROM RFC1155-SMI
OBJECT-TYPE
FROM RFC-1212;

--textual conventions
DisplayString ::= OCTET STRING

--This data type is used to model textual information taken
--from the NVT ASCII character set.  By convention, objects
--with this syntax are declared as having
--
--SIZE (0..255)


privateMib OBJECT IDENTIFIER ::= { 1 }

-- oid   .1.1
prvNumber OBJECT-TYPE
SYNTAX  INTEGER
ACCESS  read-only
STATUS  mandatory
DESCRIPTION The number of network interfaces (regardless of
their current state) present on this system.
::= { privateMib 1 }


prvTable OBJECT-TYPE
SYNTAX  SEQUENCE OF PrvEntry
ACCESS  not-accessible
STATUS  mandatory
DESCRIPTION My table.
::= { privateMib 2 }

prvEntry OBJECT-TYPE
SYNTAX  PrvEntry
ACCESS  not-accessible
STATUS  mandatory
DESCRIPTION An interface entry containing objects at the 
subnetwork
layer and below for a particular interface.
INDEX   {
prvIndex
}
::= { prvTable 1 }

PrvEntry ::= SEQUENCE {
prvIndex
INTEGER,
prvOWD
DisplayString,
prvATR
DisplayString,
prvBER
DisplayString
}

-- oid 1.2.1
prvIndex OBJECT-TYPE
SYNTAX  INTEGER
ACCESS  read-only
STATUS  mandatory
DESCRIPTION A unique value for each interface. Its value ranges
between 1 and the value of ifNumber. The value
for each interface must remain constant at least
from one re-initialization of the entity's network
management system to the next re- initialization.
::= { prvEntry 1 }
-- oid 1.2.2
prvOWD OBJECT-TYPE
SYNTAX  DisplayString (SIZE(0..255))
ACCESS  read-only
STATUS  mandatory
DESCRIPTION One way delay.
::= { prvEntry 2 }
-- oid 1.2.3
prvATR OBJECT-TYPE
SYNTAX  DisplayString (SIZE(0..255))
ACCESS  read-only
STATUS  mandatory
DESCRIPTION Avaible Transfer Rate
::= { prvEntry 3 }
-- oid 1.2.4
prvBER OBJECT-TYPE
SYNTAX  DisplayString (SIZE(0..255))
ACCESS  read-only
STATUS  mandatory
DESCRIPTION Bit Error Rate
::= {  prvEntry 4 }

END
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:

snmptrap/snmptrapd - newbie question

2012-04-23 Thread Dioguardi, Timothy
I've installed the Windows binaries for NET-SNMP version 5.6.1.1 on my
Windows 7 workstation.

I registered the snmptrapd service and was able to run the service from
the command line (output is being logged to c:\usr\log\traptest.txt).

 

Now I'm trying to test that snmptrapd is receiving traps.  To do this
I've followed the examples posted on Net-SNMP tutorial page
(http://www.net-snmp.org/tutorial/tutorial-5/commands/snmptrap.html ).
I even created the TRAP-TEST-MIB definition.

 

snmptrap -v 1 -c public localhost TRAP-TEST-MIB::demotraps localhost 6
17 '' SNMPv2-MIB::sysLocation.0 s Just here

 

AND

 

snmptrap -v 1 -c public 127.0.0.1 TRAP-TEST-MIB::demotraps 127.0.0.1  6
17 '' SNMPv2-MIB::sysLocation.0 s Just here

 

AND

 

snmptrap -v 1 -c public [ACTUAL IPV4 ADDRESS] TRAP-TEST-MIB::demotraps
[ACTUAL IPV4 ADDRESS] 6 17 '' SNMPv2-MIB::sysLocation.0 s Just here

 

When I run the command I receive no errors and not output in snmptrapd
log file.

 

Can anyone help me figure out what I'm doing wrong?

 

 

Regards,

 

Tim

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
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: writing a subagent -- newbie help

2010-09-29 Thread Matt Flanzer
Following up... I got the example subagent working. (yay!)

The issue is with macports, not net-snmp. The current macports
distribution is net-snmp 5.5 but the master agent (snmpd) is 4.5. The
generated subagents do not like to play well.

Within the macports distribution the net-snmp config file
(specifically the Portfile file) disables rebuilding the master agent
(specifying --disable-agent). I tried enabling the agent build but it
fails because the current net-snmp distribution does not specify a
darwin10.h system configuration file for MacOS X 10.6. Maybe I should
make write a note to the net-snmp-coders list?

My next step was to again modify the Portfile to specify a target os
for darwin9 (--build=i386-mac-darwin9). From there, the build worked
and it the subagent now communicates with the master as well.

Incidentally, if anyone else perhaps searches for it, I rebuilt the
macports distribution (after modifying the Portfile) with port -n
upgrade --force net-snmp

So from here, I'll see if I can get my custom subagent working, but
there's no reason to think that it won't... wish me luck.

Cheers,
Matt




On Mon, Sep 27, 2010 at 5:51 PM, Matt Flanzer mattflan...@gmail.com wrote:
 Thanks everyone for your initial responses.
 I think if I can get the example subagent code working, I could get mine to
 as well. Using the -Dagentx flag doesn't produce any additional output on
 the example subagent. On the master agent (snmpd) it does print some extra
 lines, but nothing new is produced when I run that example subagent. Does
 this mean that they are not connecting at all?
 Here are the command lines for each:
 master:
 %sudo snmpd -Le -m+NET-SNMP-TUTORIAL-MIB -M+. -Dverbose -Dagentx -f
 localhost
 sub:
 %sudo ./mysubagent -Le -m+NET-SNMP-TUTORIAL-MIB -M+. -f -Dverbose -Dagentx
 Attached are the output from each.
 Any thoughts on where I can go from here?
 The example subagent came from the wiki tutorial as I mentioned...
 http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_Subagent
 Best,
 Matt



 On Mon, Sep 27, 2010 at 2:07 PM, Wes Hardaker
 harda...@users.sourceforge.net wrote:

  On Fri, 24 Sep 2010 16:53:15 -0700, Matt Flanzer
  mattflan...@gmail.com said:

 MF Basically, no matter what I've tried I get the response:
 MF No Such Object available on this agent at this OID

 One thing worth doing is running both the subagent and the master agent
 with debugging output.  You can do this with the master agent using the
 -Dagentx flag which should show whether it is getting and accepting the
 traffic from the subagent when it tries to connect.  If you start the
 subagent and the master agent doesn't produce any output with that flag,
 then something is wrong with where the master and subagent are trying to
 connect over.

 (By default, this is /var/agentx/master if you're using a unix based
 machine, which Mac OSX should be doing).

 Note that you likely need to run the master and subagent both as root to
 get that to work properly.
 --
 Wes Hardaker
 Cobham Analytic Solutions



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


writing a subagent -- newbie help

2010-09-27 Thread Matt Flanzer
Hello all --

I've installed NET-SNMP on my Mac (via macports) and I'm trying to write a
subagent. I've followed the wiki instructions, but I can't get it to work.
Basically, no matter what I've tried I get the response:
No Such Object available on this agent at this OID

I've also tried the demo subgent from
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_Subagent

No luck there either. I get the same response. *snmptranslate* works just
fine, so it's not a MIB issue (I think).

I've also edited the *snmpd.conf* file to include the *com2sec* lines as
described in the wiki as well, but that's no it.

So I am now at a loss. If I had to guess, I'd think that the subagent (mine
or the tutorial) is not connecting to the snmpd master agent. But, who
knows.

I turn to you, internet lords, for help.

Thanks,
Matt
--
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


writing a subagent -- newbie help

2010-09-27 Thread Matt Flanzer
Hello all --

I've installed NET-SNMP on my Mac (via macports) and I'm trying to write a
subagent. I've followed the wiki instructions, but I can't get it to work.
Basically, no matter what I've tried I get the response:
No Such Object available on this agent at this OID

I've also tried the demo subgent from
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_Subagent

No luck there either. I get the same response. *snmptranslate* works just
fine, so it's not a MIB issue (I think).

I've also edited the *snmpd.conf* file to include the *com2sec* lines as
described in the wiki as well, but that's no it.

So I am now at a loss. If I had to guess, I'd think that the subagent (mine
or the tutorial) is not connecting to the snmpd master agent. But, who
knows.

I turn to you, internet lords, for help.

Thanks,
Matt
--
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: writing a subagent -- newbie help

2010-09-27 Thread Wes Hardaker
 On Fri, 24 Sep 2010 16:53:15 -0700, Matt Flanzer mattflan...@gmail.com 
 said:

MF Basically, no matter what I've tried I get the response:
MF No Such Object available on this agent at this OID

One thing worth doing is running both the subagent and the master agent
with debugging output.  You can do this with the master agent using the
-Dagentx flag which should show whether it is getting and accepting the
traffic from the subagent when it tries to connect.  If you start the
subagent and the master agent doesn't produce any output with that flag,
then something is wrong with where the master and subagent are trying to
connect over.

(By default, this is /var/agentx/master if you're using a unix based
machine, which Mac OSX should be doing).

Note that you likely need to run the master and subagent both as root to
get that to work properly.
-- 
Wes Hardaker
Cobham Analytic Solutions

--
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: writing a subagent -- newbie help

2010-09-27 Thread Wes Hardaker
 On Mon, 27 Sep 2010 22:50:41 +0200, sebastian2...@gmx.de 
 sebastian2...@gmx.de said:

Sd REALLY nice would be to have a simple compiling example, how to create a  
Sd program which can act as trapsender, client and server at once.

FYI, the example code in agent/mibgroup/examples/notification.c might
help you with the trap-sending portion of the code.
-- 
Wes Hardaker
Cobham Analytic Solutions

--
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: writing a subagent -- newbie help

2010-09-27 Thread Matt Flanzer
Thanks everyone for your initial responses.

I think if I can get the example subagent code working, I could get mine to
as well. Using the -Dagentx flag doesn't produce any additional output on
the example subagent. On the master agent (snmpd) it does print some extra
lines, but nothing new is produced when I run that example subagent. Does
this mean that they are not connecting at all?

Here are the command lines for each:

master:
%sudo snmpd -Le -m+NET-SNMP-TUTORIAL-MIB -M+. -Dverbose -Dagentx -f
localhost

sub:
%sudo ./mysubagent -Le -m+NET-SNMP-TUTORIAL-MIB -M+. -f -Dverbose -Dagentx

Attached are the output from each.

Any thoughts on where I can go from here?

The example subagent came from the wiki tutorial as I mentioned...
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_Subagent

Best,
Matt




On Mon, Sep 27, 2010 at 2:07 PM, Wes Hardaker 
harda...@users.sourceforge.net wrote:

  On Fri, 24 Sep 2010 16:53:15 -0700, Matt Flanzer 
 mattflan...@gmail.com said:

 MF Basically, no matter what I've tried I get the response:
 MF No Such Object available on this agent at this OID

 One thing worth doing is running both the subagent and the master agent
 with debugging output.  You can do this with the master agent using the
 -Dagentx flag which should show whether it is getting and accepting the
 traffic from the subagent when it tries to connect.  If you start the
 subagent and the master agent doesn't produce any output with that flag,
 then something is wrong with where the master and subagent are trying to
 connect over.

 (By default, this is /var/agentx/master if you're using a unix based
 machine, which Mac OSX should be doing).

 Note that you likely need to run the master and subagent both as root to
 get that to work properly.
 --
 Wes Hardaker
 Cobham Analytic Solutions

registered debug token verbose, 1
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
Couldn't find a table entry for the model name MacBookPro6,2
Sensor Data Collection not supported
verbose:snmpNotifyFilterTable:init_snmpNotifyFilterTable: called
verbose:snmpNotifyFilterTable:initialize_table_snmpNotifyFilterTable: called
verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_init_data: called
verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_container_init: called
verbose:ifTable:init_ifTable: called
verbose:ifTable:initialize_table_ifTable: called
verbose:ifTable:ifTable_container_init: called
verbose:ifTable:ifTable_init_data: called
verbose:ifTable:ifTable_container_load: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_rowreq_ctx_init: called
verbose:ifTable:ifTable_indexes_set: called
verbose:ifTable:ifTable_indexes_set_tbl_idx: called
verbose:ifTable:ifTable_index_to_oid: called
verbose:ifTable:ifTable_cache_load: 8 records
verbose:ifXTable:initialize_table_ifXTable: called
verbose:ifXTable:ifXTable_init_data: called
verbose:ifXTable:init_ifXTable: called
verbose:ifTable:init_ifTable: called
verbose:ifXTable:_ifXTable_container_col_restore: processing column 14
verbose:ifXTable:_ifXTable_container_col_restore: processing column 18
verbose:ifXTable:_ifXTable_container_col_restore: processing column 14
verbose:ifXTable:_ifXTable_container_col_restore: processing column 18
verbose:ifXTable:_ifXTable_container_col_restore: processing column 14
verbose:ifXTable:_ifXTable_container_col_restore: processing column 18

Re: Newbie question

2010-08-03 Thread Dave Shield
On 2 August 2010 10:22, Guerrero, Simon (PTS horizontal PS projects)
s.guerr...@logica.com wrote:

 So basically, all I want to do is use the “snmptrap” tool to send an error
 message to that product.

 However, I’m confused by all these different MIBS, and what to use

If you need to send your own private error message, then (unless this
is reporting an event which is already covered) you probably need to
define a trap to represent this.  That means writing a MIB to define
the Notification object for the trap.

The clean way to do this would be to apply for your own enterprise
number from IANA, and then define your MIB within this subtree.
But if you don't want to bother weith this (and your traps will *only*
ever be used within your organisation), then there's an area of the
Net-SNMP OID subtree that you can use.

  See   NET-SNMP-MIB::netSnmpPlaypen
  (.1.3.6.1.4.1.8072..)

The only other advice I'd give is to follow the structure of the
Net-SNMP notifications:

  netSnmpNotificationPrefix   OBJECT IDENTIFIER ::= {netSnmp 4}
  netSnmpNotificationsOBJECT IDENTIFIER ::=
{netSnmpNotificationPrefix 0}

  nsNotifyStartNOTIFICATION-TYPE ... ::= { netSnmpNotifications 1 }
   etc

i.e. have an object with the subidentifier '0' as the parent of the
trap definitions
themselves.   That will help if you are likely to use SNMPv1.



  In fact, [the tutorials] don’t seem to even tell you where the MIB files are

That's because we don't know where the MIB files will be.
If you've installed from source, then they'll probably be in one place
(/usr/local/share/mibs), unless you've configured the software to put
them somewhere different.
   If you've installed a vendor-provided version, then they'll be
somewhere else.

  (I found them under /usr/share). :-/

That's probably a vendor-supplied installation then.
But not all vendors will put the MIBs there, and we have no control over this.
   Hence we cannot give a categorical location for these files.

There is some advice in the FAQ entry
Where should I put my MIB files?

(You *have* read the FAQ, haven't you?)

Dave

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
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


Newbie question

2010-08-02 Thread Guerrero, Simon (PTS horizontal PS projects)
Hi

 

I'm new to SNMP, so please forgive the stupid questions, but...

 

I have a number of Windows boxes where I want to run archiving scripts
which take audit data and copy it to a central box. When something goes
wrong, I need to alert a central admin.

 

The admin uses a product which catches SNMP traps and displays info to
the user, so the preferred method is to send a trap to that product. So
basically, all I want to do is use the snmptrap tool to send an error
message to that product.

 

However, I'm confused by all these different MIBS, and what to use, and
how to use it. I've read through the tutorials but they are
frustratingly not tutorials (i.e. they don't say here's how you do
this). In fact, they don't seem to even tell you where the MIB files
are (I found them under /usr/share). :-/

 

Please can someone point me in the right direction? I was hoping to just
have one command that says send error message x to IP y but clearly
it's much more complicated than that.

 

Thanks!

 

Simon



Please help Logica to respect the environment by not printing this email  / 
Pour contribuer comme Logica au respect de l'environnement, merci de ne pas 
imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie 
so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a 
respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm___
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: Very Newbie: Converting a complex MIB file with mib2c

2010-07-07 Thread Dave Shield
On 2 July 2010 14:51, Joan Landry joan.lan...@overturenetworks.com wrote:
 You have to use mib2c for each table and scalor:
 Example:
 mib2c -c mib2c.scalar.conf SNMP-USER-BASED-SM-MIB:usmUserSpinLock
 mib2c -c mib2c.table_data.conf SNMP-USER-BASED-SM-MIB:usmUserTable

Minor correction:
  You should be able to run mib2c -c mib2c.scalar.conf once, giving it the
root of the MIB in question, and it will generate code for *all* scalar objects
within that MIB.

But for tables, it is normal to run mib2c on each table individually.

Dave

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
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


Newbie to net-snmp: which helper to use

2010-07-05 Thread K b
Hi All,

I am implementing a private MIB to expose some performance statistics of our
systems. For HA, we have more than one systems which runs on embedded
devices , but are firewalled by a management server i.e they are not
accessible directly to the external world, they can be
accessed through  management server. These systems run an application which
consists of multiple modules and I want to export some performance
statistics through SNMP. I am planning to embed an agent-x into the
application in the embedded device and run a snmp agent in the management
server. Is this possible? Can I route a OID depending on the row of a table
to a particular sub agent?

Also for coding subagent,

1) My MIB is a set of scalars and some tables , Rows of these tables are
pre-known, but whenever a get request comes, I'll have to call a function in
one of the module within the application to get the value for the individual
scalars and table columns ( for colums by passing index as additional
parameter)  i.e Rows are constant , but column values have to be refreshed
on every GET. ( as this is performance stat) . Which conf in
mib2c/ which helper is suitable for this requirement? assuming that all
operations are read-only..

Appreciate your suggestions!

Thanks
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
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


Very Newbie: Converting a complex MIB file with mib2c

2010-07-02 Thread Stavros Tsolakos
Hi all.

I am really new to SNMP and net-snmp. I have a MIB file from a network
switch and i wanted to make a custom subagent to make the snmpd of my
workstation report some dummy data, as if it were the switch. I have
managed to build a subagent reporting a dummy integer value. But when
trying to use mib2c on the MIB file (I have configured it correctly,
mib2c can find both the MIB and the starting node) I am not sure of
which configuration file to use.

The MIB contains many tables, many scalar and many string values. Is
there a configuration file to  automagically generate template code
which respects data types? Do I have to use mib2c separately for each
entry of my MIB?

Thank you very much and my apologies if the question is stupid. I am
very newbie and very confused, too.

Regards,

Stavros



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
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: Very Newbie: Converting a complex MIB file with mib2c

2010-07-02 Thread Joan Landry
You have to use mib2c for each table and scalor:
Example:
mib2c -c mib2c.scalar.conf SNMP-USER-BASED-SM-MIB:usmUserSpinLock
mib2c -c mib2c.table_data.conf SNMP-USER-BASED-SM-MIB:usmUserTable

-Original Message-
From: Stavros Tsolakos [mailto:stsola...@gmail.com] 
Sent: Friday, July 02, 2010 9:11 AM
To: net-snmp-users@lists.sourceforge.net
Subject: Very Newbie: Converting a complex MIB file with mib2c

Hi all.

I am really new to SNMP and net-snmp. I have a MIB file from a network
switch and i wanted to make a custom subagent to make the snmpd of my
workstation report some dummy data, as if it were the switch. I have
managed to build a subagent reporting a dummy integer value. But when
trying to use mib2c on the MIB file (I have configured it correctly,
mib2c can find both the MIB and the starting node) I am not sure of
which configuration file to use.

The MIB contains many tables, many scalar and many string values. Is
there a configuration file to  automagically generate template code
which respects data types? Do I have to use mib2c separately for each
entry of my MIB?

Thank you very much and my apologies if the question is stupid. I am
very newbie and very confused, too.

Regards,

Stavros




--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
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 Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
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: Very Newbie: Converting a complex MIB file with mib2c

2010-07-02 Thread Fulko Hew
On Fri, Jul 2, 2010 at 9:11 AM, Stavros Tsolakos stsola...@gmail.comwrote:

 Hi all.

 I am really new to SNMP and net-snmp. I have a MIB file from a network
 switch and i wanted to make a custom subagent to make the snmpd of my
 workstation report some dummy data, as if it were the switch. I have
 managed to build a subagent reporting a dummy integer value. But when
 trying to use mib2c on the MIB file (I have configured it correctly,
 mib2c can find both the MIB and the starting node) I am not sure of
 which configuration file to use.

 The MIB contains many tables, many scalar and many string values. Is
 there a configuration file to  automagically generate template code
 which respects data types? Do I have to use mib2c separately for each
 entry of my MIB?

 Thank you very much and my apologies if the question is stupid. I am
 very newbie and very confused, too.


No, its not a stupid question, and it is really an interesting problem.

I started to tackle this in a generic manner.  Ie simulate a network of
devices
that respond to whatever they were queried for with legal (but not
neccessarily
accurate) responses.  And cache the responses so that they would be
consistent
across queries (for enumerations, some strings etc) and for integers and
strings
they may dynamically change, so you could have 'pretty' data on charts (it
thats
what your NMS was doing.

Turns out, unless you only looked at a limited scenario where everything was
under your control, the problem of dynamic OID generation (especially with
tables
that use multiple indexes, becomes nasty).

Unfortunately, I tied my simulator into a whack of my other software that I
can't let
out at this time.  (it uses it to access the MIBs compiled into my system's
database)
(because the simulator would simulate any and all MIBs compiled in if it
were
walked ... from wherever you started, including .iso.  So right now, because
I have over 300
different MIBs in my NMS, MIB walking a single simulated device returns (5
instances)
of each variable, so that results in over 100K variables (MIB-II, CISCO
routers, Synoptic switches,
my company's proprietary devices... etc.)

Simulating a single, simple MIB file for read-only would be relatively easy.
What I would do is:

Take the output of a MIB compiler listing all the OIDs for _your_ file.
build a hash of those OIDs (including as many instances of table entries you
(statically) desire (with valid index values) and write a simple perl
program to access the hash and return the associated value (and the
scan the hash correctly for the 'next' OID if required.)

But I'm simplifying the process for the sake of the email.  :-)
Here is a simple app I wrote at the beginning of testing my simulator
concept.  The you would need to alter it to:
1/ register _your_ part of the OID tree
2/ perform the lookup for _your_ OIDs to value mapping
3/ return the right 'type' designator for the right variable.
3/ return the right 'next' OID, if getnext was used.


#!/usr/bin/perl

use NetSNMP::OID(':all');
use NetSNMP::agent  (':all');
use NetSNMP::ASN(':all');
use Socket;

sub my_snmp_handler {
my ($handler, $registration_info, $request_info, $requests) = @_;

for (my $request = $requests; $request; $request = $request-next()) {
# handle each request component
my $oid = $request-getOID();
print STDERR  Using $0 to ;
if ($request_info-getMode() == MODE_GET) {
# was it a 'get'
print STDERR Get $oid\n;
$request-setValue(ASN_OCTET_STR, 'Get() hello from $oid');
} elsif ($request_info-getMode() == MODE_GETNEXT) {
# or a 'getNext'
print STDERR GetNext $oid\n;
my $next_oid;
if ($oid =~ /0$/)   { $next_oid = new
NetSNMP::OID('9');}
else{ $next_oid = new NetSNMP::OID($oid .
'.0');}
$request-setOID($next_oid);
$request-setValue(ASN_OCTET_STR, 'GetNext() Hello from
$next_oid');
}
}
}

# Mainline

print No $agent defined\n if (!$agent);
{
my $regat='.1.3.6.1.2.1.1.1';
print STDERR Registering $0 as the handler for OID: $regat\n;
my $regoid = new NetSNMP::OID($regat);
$agent-register($0, $regoid, \my_snmp_handler);
}

Fulko
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
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: snmp newbie trying to use net-snmp as an Agent

2009-11-10 Thread seshu babu
Thanks a lot ! Dave for the detailed info.

On Mon, Nov 9, 2009 at 3:14 PM, Dave Shield d.t.shi...@liverpool.ac.ukwrote:

 2009/11/5 seshu babu seshum...@gmail.com:
  1. The net-snmp-devel rpm doesn't have a mib2c compiler that means I can
 do
  away with the mib2c compiler instead depend on dlmod for code  mib
 changes?

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
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: snmp newbie trying to use net-snmp as an Agent

2009-11-09 Thread Dave Shield
2009/11/5 seshu babu seshum...@gmail.com:
 1. The net-snmp-devel rpm doesn't have a mib2c compiler that means I can do
 away with the mib2c compiler instead depend on dlmod for code  mib 
 changes?

mib2c is written in perl, so you need to install the RPM
'net-snmp-perl' as well.
This includes the mib2c script.


Whether or not you use mib2c is completely separate from whether
you use the dlmod mechanism or some other approach.

Mib2c is concerned with helping you to *generate* the code for your MIB.
You don't need to use this - it's perfectly possible to write this code by hand.
But  mib2c takes care of a lot of the donkey work for you - it gives you a
code framework to start from, rather than having to write all this yourself.

dlmod (along with AgentX and re-compiling the agent) are concerned
with what you do with that code when it's finished.   How you get this
MIB that you've written into the agent, so it can be queried.
   Personally, I typically start by compiling the new MIB code directly into
the agent.   This is probably the simplest to get working on a test system
for development purposes, but does require using the Net-SNMP source
tarball from the project website (rather than vendor-supplied RPMs).

Note that  you can always re-package the MIB to use dlmod (or AgentX) later.
The same code can be used for all three approaches.



 2.To write C code  integrate with the net-snmp agent or change/Add mib's,
 which is the right rpm to use?

If you're working with pre-packaged binaries, then you need the following:
net-snmp  The standard agent binary
net-snmp-libslibraries (and MIB files)
net-snmp-utils   command-line tools (snmpget/snmpwalk/etc)
net-snmp-devel The header files (and static libraries)
net-snmp-perl   If you want to use 'mib2c'

With that setup, you'll need to use 'dlmod' (or AgentX) to include
your new MIB module into the running agent.


 Is it mandatory to use net-snmp source code for this?

If you're linking MIB code into the Net-SNMP agent directly, then yes.
You'd have to get the source tarball from the Net-SNMP project website,
and compile from that.   (In which case, you don't need *any* of the
above RPMs).


Dave

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
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


[newbie] ASN1 types mapping to c

2009-11-07 Thread LiWei Sun
i, I am trying to write a mib module of my own. I don't know how to pass an
ip address value to snmp_set_var_typed_value function. I got a string
value like 192.168.1.1, is it right to simply cast it to u_char* type, the
ASN1 type defined in mib is IpAddress? How to specify the byte order ?
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
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


snmp newbie trying to use net-snmp as an Agent

2009-11-05 Thread seshu babu
Hi all,

I am a snmp newbie trying to use net-snmp as an Agent in my linux Fedora 10
system.

To start using net-snmp as an snmp agent:

1. I  first installed these rpm's into our system:
rpm -qa | grep snmp
net-snmp-libs-5.4.2.1-4.fc10.
i386
net-snmp-5.4.2-3.fc10.i386
net-snmp-utils-5.4.2.1-4.fc10.i386

After that I found that I was not able to write agent code as the net-snmp
header files were
not installed with the above rpm installation.

2. Later I tried to install the developer rpm
(net-snmp-devel-5.4.2.1-4.fc10.i386.rpm ) which had the required header
files  libraries.

   Now I am confused how to compile the new mibs as it doesn't have the
mib2c compiler installed.

   I  looked into FAQ's and found that 'dlmod' is another way for writing C
code  integrating with the agent.

http://www.net-snmp.org/docs/FAQ.html#What_about__dlmodwhat_s_that_about_

  There are some questions that I have :

1. The net-snmp-devel rpm doesn't have a mib2c compiler that means I can do
away with the mib2c compiler instead depend on dlmod for code  mib changes?
2.To write C code  integrate with the net-snmp agent or change/Add mib's,
which is the right rpm to use? Is it mandatory to use net-snmp source code
for this?


Thanks for your time,
Seshu
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
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


[newbie] How to decide, which mib2c configuration to use ...

2009-10-26 Thread Schnell, Daniel
Hi,

I am about to evaluate net-snmp for our purposes. We use so far a different 
snmp architecture and have quite many private MIB attributes (and of course 
codelines) which would have to be ported. So I try to find out the smoothest 
way to make that transition work.

The sw handles all kinds of complex scenarios: local caching of snmp requests, 
asynchronous communication to other components via IPC to handle the SNMP 
request, direct answers from the agents context, relation checks, etc.

I have read the examples for mib2c, but somehow I find them too simplistic to 
decide, which mib2c configuration I should use for our purposes. I am missing 
somehow a good overview for the configs and what their special purpose is and 
the pros and cons. So far I took parts of our MIB and used every config I could 
find in net-snmp 5.5. and look inside the generated code.

Best would be to use just one specific configuration for scalars and one 
specific configuration for tables. I don't want to use config1 for certain 
scalars and config2 for other type of scalars. The same with tables.
So which config is the most generic mib2c configs for scalars and for tables 
and what are the things I should watch out for implementing asynchronous 
requests over applications ?

Are there any constraints in how fast an asynchronous request has to be 
answered before timouts happen ?


Thanks in advance,

Daniel Schnell.
--
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: newbie: how to initialize DisplayString for a NOTIFICATION

2009-06-09 Thread Vincent Bernat
OoO  En ce début  d'après-midi ensoleillé  du lundi  08 juin  2009, vers
15:57, PoWah Wong wong_po...@yahoo.ca disait :

 In C.

Did you look at this example?
 http://www.net-snmp.org/dev/agent/notification_8c-example.html

The  last variable  binding in  this  example is  an ASN_OCTET_STR.  You
should do exactly the same.
-- 
BOFH excuse #43:
boss forgot system password

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
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: newbie: how to initialize DisplayString for a NOTIFICATION

2009-06-08 Thread PoWah Wong

In C.

--- On Sat, 6/6/09, Vincent Bernat ber...@luffy.cx wrote:

 From: Vincent Bernat ber...@luffy.cx
 Subject: Re: newbie: how to initialize DisplayString for a NOTIFICATION
 To: PoWah Wong wong_po...@yahoo.ca
 Cc: net-snmp-users net-snmp-users@lists.sourceforge.net
 Received: Saturday, June 6, 2009, 3:58 AM
 OoO En cette  soirée bien
 amorcée du vendredi 05  juin 2009, vers 22:33,
 PoWah Wong wong_po...@yahoo.ca
 disait :
 
  If my  trap is defined as  follows, how to
 initialize  certExpiry to a
  valid DisplayString?
 
 In C or with snmptrap?
 -- 
 BOFH excuse #51:
 Cosmic ray particles crashed through the hard disk platter
 


  __
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  
Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/

--
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
___
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: newbie: how to initialize DisplayString for a NOTIFICATION

2009-06-06 Thread Vincent Bernat
OoO En cette  soirée bien amorcée du vendredi 05  juin 2009, vers 22:33,
PoWah Wong wong_po...@yahoo.ca disait :

 If my  trap is defined as  follows, how to initialize  certExpiry to a
 valid DisplayString?

In C or with snmptrap?
-- 
BOFH excuse #51:
Cosmic ray particles crashed through the hard disk platter

--
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
___
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


newbie: how to initialize DisplayString for a NOTIFICATION

2009-06-05 Thread PoWah Wong

If my trap is defined as follows, how to initialize certExpiry to a valid 
DisplayString?

certExpiry OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..128))
MAX-ACCESS  read-only
STATUS  current
DESCRIPTION
This DisplayString objects' indicates the expiry date of the server 
certificate.
::= { certMib 6 }


certExpiryTrap NOTIFICATION-TYPE
 STATUS current
 VARIABLES { certExpiry }
 DESCRIPTION Notify that the certificate will become expire soon.
 ::= { certMibTraps 1}



  __
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot 
with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail 
today or register for free at http://mail.yahoo.ca

--
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
___
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: newbie questions: monitoring with cacti

2009-05-13 Thread travi+ml-snmp
On Tue, May 12, 2009 at 09:09:30AM +0100, Dave Shield wrote:
 2009/5/11  travis+ml-ca...@subspacefield.org:
  In addition, there are two important system statistics, interface
  statistics and monitored partitions, that I'd like to graph.
 
 Again - the first step is to check whether the agent is reporting this
 information.   You can't start monitoring things until this is working.

Once I fixed the ACLs, the interface statistics started working.

To get the mounted partition information, I had to add a data source
called ucd/net Get Monitored Partitions.  Apparently the default
data source that queried for filesystem usage (SNMP Get Mounted
Partitions) was querying an OID that net-snmpd was not providing.

-- 
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. | 
http://www.subpacefield.org/~travis/ 
If you are a spammer, please email j...@subspacefield.org to get blacklisted.


pgpT1JP58Kmka.pgp
Description: PGP signature
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-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: newbie questions: monitoring with cacti

2009-05-12 Thread Dave Shield
2009/5/11  travis+ml-ca...@subspacefield.org:
 4) I tested using: snmpwalk -v 2c -c COMMUNITY_STRING_HERE nirvana system

That output shows that the agent is reporting the information for the
'system' group.
What happens if you run the same query, but looking at  'interfaces'
or  'host',
or 'cpu' etc ?


 5) I installed cacti and configured a few hosts using the ucd/net
 host and graph templates, using SNMP v1 and specifying the correct
 community string.  There were graph templates for CPU usage, Load
 Average, Memory usage.

 Now, the graphing functions appear to be working, but there's no values
 being stored in them, which suggests to me that my SNMP configuration
 is not providing the necessary data for the graphs.

Hence running 'snmpwalk' against them, to see whether there's anything
being reported.


 In addition, there are two important system statistics, interface
 statistics and monitored partitions, that I'd like to graph.

Again - the first step is to check whether the agent is reporting this
information.   You can't start monitoring things until this is working.



 I'm suspicious that the paranoid security group defined in
 snmpd.conf simply isn't providing the necessary information.

That was my immediate suspicion too.
My initial guess was that the default configuration will give
access to the 'system' group only  (or 'system' + 'hrSystem'),
and anything else needs to be explicitly configured.
This is confirmed by your snmpd.conf file.

Try uncommenting the line

com2sec readonly  default public

(replacing public with a suitable community string)

Alternatively, try adding a line to the snmpd.conf file

 rocommunity   someCommunityString

Either of these would allow access to *everything*.


  If that's true, should I start by reading up on the snmpd.conf manpages?

Either the access control section of this man page, or the access control
entries in the project FAQ.

Dave

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-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: newbie questions: monitoring with cacti

2009-05-12 Thread travis+ml-snmp
On Tue, May 12, 2009 at 09:09:30AM +0100, Dave Shield wrote:
  I'm suspicious that the paranoid security group defined in
  snmpd.conf simply isn't providing the necessary information.
 
 That was my immediate suspicion too.
 My initial guess was that the default configuration will give
 access to the 'system' group only  (or 'system' + 'hrSystem'),
 and anything else needs to be explicitly configured.
 This is confirmed by your snmpd.conf file.

Yep.

I changed from 'paranoid' to a full read-only permission set, and the
CPU, Load Average, and Memory Usage graphs are now being populated.

Another factor is that it has to be graphing for some period of time
before it will generate the graphs; it doesn't happen right away,
or even after the first polling.  It appears to want to fill the graph
before it starts showing anything.
-- 
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. | 
http://www.subpacefield.org/~travis/ 
If you are a spammer, please email j...@subspacefield.org to get blacklisted.


pgp3pBGnAOdt3.pgp
Description: PGP signature
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-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


newbie questions: monitoring with cacti

2009-05-11 Thread travis
Hello,

I've recently decided to start using SNMP to monitor the systems in my
personal network.  These are mostly PCs running Linux or OpenBSD, but
there may be one switch that I decide to monitor once I've got the
knack.

Based on what I'd heard, I chose cacti to do the front-end work
(graphing, etc.), since it's free and open-source and appears quite
capable.

Here's what I've done so far.

1) I installed the snmp or net-snmp packages as appropriate.

2) I changed /etc/default/snmp to listen on all interfaces rather
than only 127.0.0.1

3) The debian ones map the community string public to a security
name called paranoid.  Based on what I read, leaving the community
string public as-is is not recommended for security reasons, so I've
changed it to something site-specific and mostly random (using apg).

4) I tested using: snmpwalk -v 2c -c COMMUNITY_STRING_HERE nirvana system

The results were as follows:

SNMPv2-MIB::sysDescr.0 = STRING: Linux nirvana 2.6.27-11-server #1 SMP Wed Apr 
1 21:34:13 UTC 2009 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (338981) 0:56:29.81
SNMPv2-MIB::sysContact.0 = STRING: Hostmaster hostmas...@sec.vpn
SNMPv2-MIB::sysName.0 = STRING: nirvana
SNMPv2-MIB::sysLocation.0 = STRING: Computer Room
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.2 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORDescr.1 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB for Message Processing and 
Dispatching.
SNMPv2-MIB::sysORDescr.3 = STRING: The management information definitions for 
the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP 
implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP 
implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP 
implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.8 = No more variables left in this MIB View (It is past 
the end of the MIB tree)

5) I installed cacti and configured a few hosts using the ucd/net
host and graph templates, using SNMP v1 and specifying the correct
community string.  There were graph templates for CPU usage, Load
Average, Memory usage.

Now, the graphing functions appear to be working, but there's no values
being stored in them, which suggests to me that my SNMP configuration
is not providing the necessary data for the graphs.

In addition, there are two important system statistics, interface
statistics and monitored partitions, that I'd like to graph.  However,
when creating a graph, they are listed in the Data Query blocks with
the following error message:

This data query returned 0 rows, perhaps there was a problem executing
this data query. You can run this data query in debug mode to get more
information.

Now, I'm very new to this, and all the SNMP documents and tutorials I
could find are very specific, and seem to assume you have a working
knowledge of SNMP already.  I'm more than a little lost, and not quite
sure where to start reading to find my answers.  I even bought the
Stallings book on SNMP, but it's the sort of book that you read a
chapter and then wonder what you learned.  Are there any grand
overview type of tutorials that I should read?

Can anyone please point me in the right direction to help me get this
data available to the graphing front end?

I'm suspicious that the paranoid security group defined in
snmpd.conf simply isn't providing the necessary information.  If
that's true, should I start by reading up on the snmpd.conf manpages?

If it's not true, where should I start?

I've attached a sanitized version of my snmpd.conf to assist, in case
the answer depends on it.
-- 
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. | 
http://www.subpacefield.org/~travis/ 
If you are a spammer, please email j...@subspacefield.org to get 

newbie questions: monitoring with cacti

2009-05-11 Thread travis+ml-cacti
Hello,

I've recently decided to start using SNMP to monitor the systems in my
personal network.  These are mostly PCs running Linux or OpenBSD, but
there may be one switch that I decide to monitor once I've got the
knack.

Based on what I'd heard, I chose cacti to do the front-end work
(graphing, etc.), since it's free and open-source and appears quite
capable.

Here's what I've done so far.

1) I installed the snmp or net-snmp packages as appropriate.

2) I changed /etc/default/snmp to listen on all interfaces rather
than only 127.0.0.1

3) The debian ones map the community string public to a security
name called paranoid.  Based on what I read, leaving the community
string public as-is is not recommended for security reasons, so I've
changed it to something site-specific and mostly random (using apg).

4) I tested using: snmpwalk -v 2c -c COMMUNITY_STRING_HERE nirvana system

The results were as follows:

SNMPv2-MIB::sysDescr.0 =3D STRING: Linux nirvana 2.6.27-11-server #1 SMP We=
d Apr 1 21:34:13 UTC 2009 x86_64
SNMPv2-MIB::sysObjectID.0 =3D OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance =3D Timeticks: (338981) 0:56:29.81
SNMPv2-MIB::sysContact.0 =3D STRING: Hostmaster hostmas...@sec.vpn
SNMPv2-MIB::sysName.0 =3D STRING: nirvana
SNMPv2-MIB::sysLocation.0 =3D STRING: Computer Room
SNMPv2-MIB::sysORLastChange.0 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 =3D OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBComplian=
ce
SNMPv2-MIB::sysORID.2 =3D OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.3 =3D OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.4 =3D OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 =3D OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 =3D OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 =3D OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 =3D OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORDescr.1 =3D STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.2 =3D STRING: The MIB for Message Processing and Dis=
patching.
SNMPv2-MIB::sysORDescr.3 =3D STRING: The management information definitions=
 for the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.4 =3D STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 =3D STRING: The MIB module for managing TCP implem=
entations
SNMPv2-MIB::sysORDescr.6 =3D STRING: The MIB module for managing IP and ICM=
P implementations
SNMPv2-MIB::sysORDescr.7 =3D STRING: The MIB module for managing UDP implem=
entations
SNMPv2-MIB::sysORDescr.8 =3D STRING: View-based Access Control Model for SN=
MP.
SNMPv2-MIB::sysORUpTime.1 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.6 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.7 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.8 =3D Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.8 =3D No more variables left in this MIB View (It i=
s past the end of the MIB tree)

5) I installed cacti and configured a few hosts using the ucd/net
host and graph templates, using SNMP v1 and specifying the correct
community string.  There were graph templates for CPU usage, Load
Average, Memory usage.

Now, the graphing functions appear to be working, but there's no values
being stored in them, which suggests to me that my SNMP configuration
is not providing the necessary data for the graphs.

In addition, there are two important system statistics, interface
statistics and monitored partitions, that I'd like to graph.  However,
when creating a graph, they are listed in the Data Query blocks with
the following error message:

This data query returned 0 rows, perhaps there was a problem executing
this data query. You can run this data query in debug mode to get more
information.

Now, I'm very new to this, and all the SNMP documents and tutorials I
could find are very specific, and seem to assume you have a working
knowledge of SNMP already.  I'm more than a little lost, and not quite
sure where to start reading to find my answers.  I even bought the
Stallings book on SNMP, but it's the sort of book that you read a
chapter and then wonder what you learned.  Are there any grand
overview type of tutorials that I should read?

Can anyone please point me in the right direction to help me get this
data available to the graphing front end?

I'm suspicious that the paranoid security group defined in
snmpd.conf simply isn't providing the necessary information.  If
that's true, should I start by reading up on the snmpd.conf manpages?

If it's not true, where should I start?

I've attached a sanitized version of my snmpd.conf to assist, in case
the answer depends on it.
-- 
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. | 
http://www.subpacefield.org/~travis/ 

Newbie needing help e-mailing traps

2009-03-18 Thread Dan Nolan




I'm sorry if this is a dumb question, but I'm fairly new to Linux,
Nagios, and net-snmp. I am looking for something that I can send SNMP
traps to and it will e-mail me when it gets the trap.

I have net-snmp installed on my Fedora 9 box. I understand that I need
snmptrapd for what I'm looking to do. I found the "traptoemail" script
and put this line in my snmptrapd.conf file:

traphandle TRAPOID|default
/usr/local/bin/traptoemail [-f FROM] [-s SMTPSERVER]b ADDRESSES

I'm just really confused on how to put it all together and make it
actually work.

I have read a lot of the documentation and the wiki tutorials for
snmptrapd, but I'm royally confused. Does anyone have a guide for
dummies or a step-by-step guide that I can follow?

Here is my snmptrapd.conf file:


###
#
# Stuff I added
#
###

authCommunity log,execute,net public

traphandle TRAPOID|default /usr/local/bin/traptoemail [-f FROM] [-s
SMTPSERVER]b ADDRESSES
# FROM defaults to "root"
# SMTPSERVER defaults to "localhost"


###
# snmptrapd.conf
#
# - created by the snmpconf configuration program
#
###
# SECTION: Trap Handlers
#
# Here we define what programs are run when a trap is
# received by the trap receiver.

# traphandle: When traps are received, a program can be run.
# When traps are received, the list of configured trap
# handles is consulted and any configured program is run.
# If no handler is found, any handler with "default" as the
# traphandle type is run instead. The information contained
# in trap is passed to the program via standard input (see
# the snmptrapd.conf manual page for details).
#
# arguments: oid|"default" program args

traphandle



###
# SECTION: Output formatting for traps received.
#
# Output from snmptrapd is formatted according to the
# rules defined by the formatting configuration directives.

# format1: How SNMPv1 traps are formatted.
# See the snmptrapd.conf manual page for format string details.
# arguments: formatstring

format1

# format2: How SNMPv2 and SNMPv3 traps are formatted.
# See the snmptrapd.conf manual page for format string details.
# arguments: formatstring

format2




Thanks!




--
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: Newbie needing help e-mailing traps

2009-03-18 Thread Mike Ayers
 From: Dan Nolan [mailto:dno...@multi-ad.com] 
 Sent: Wednesday, March 18, 2009 9:59 AM

 I have net-snmp installed on my Fedora 9 box.  I understand 
 that I need snmptrapd for what I'm looking to do.  I found 
 the traptoemail script and put this line in my snmptrapd.conf file:
 
 traphandle TRAPOID|default /usr/local/bin/traptoemail [-f 
 FROM] [-s SMTPSERVER]b ADDRESSES

Exactlly like that?!  That is how you copied it below... *sigh*  You'll 
need to remove the brackets (which indicate optional parameters) and replace 
the SAMPLE parameters with theones that work in your environment:

FROM:  sender of email (does not need to have an actual mailbox, just 
don't reply to these emails)
SMTPSERVER:  your email server - you'll need to talk with your IT about 
this
ADDRESSES:  who gets the email?


HTH,

Mike

--
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: Newbie needing help e-mailing traps

2009-03-18 Thread Dave Shield
2009/3/18 Dan Nolan dno...@multi-ad.com:
 I have net-snmp installed on my Fedora 9 box.  I understand that I need
 snmptrapd for what I'm looking to do.  I found the traptoemail script and
 put this line in my snmptrapd.conf file:

 traphandle TRAPOID|default /usr/local/bin/traptoemail [-f FROM] [-s
 SMTPSERVER]b ADDRESSES

That is explaining the syntax of the command - what options are
available and what bits can go where.   It's not intended as a literal
string to be placed in the snmptrapd.conf file as is.


 I'm just really confused on how to put it all together and make it actually
 work.

The simplest form would probably be:

   traphandle  default  /usr/local/bin/traptoemail  dno...@multi-ad.com

That should send an email message to dno...@multi-ad.com
for every trap that arrives, regardless of what that trap actually represents.

The TRAPOID token is an alternative to default, used for selecting
special handling for particular traps.The -f and -s options are used
to configure exactly how email should be sent.
   But to start with, I'd suggest you try with the simple example above.


 Here is my snmptrapd.conf file:


 authCommunity log,execute,net public

That's good.

 traphandle TRAPOID|default /usr/local/bin/traptoemail [-f FROM] [-s
 SMTPSERVER]b ADDRESSES

See above

I'd then delete the rest of the file - all of the directives are missing
essential parameters.
   Don't worry about them yet - start with *just* the two lines listed
above, and get that working first.  Then you can start experimenting
with other formats, and additional trap handles.

Dave

--
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: Newbie lacks general mechanics

2009-01-09 Thread Dave Shield
2009/1/8 Larry Brown larry.br...@dimensionnetworks.com:
  As I understand it the part of the OID that is returned depends on its
  existence in the MIB.

   There is no part of the OID.  OIDs (object identifiers) are atomic.

I'm not sure I agree.
The OID that is returned from a query naturally falls into two parts:

   -   the OID of the management object (as defined/described in the MIB file)
   -   the subidentifier suffix(es), specifying a particular instance
of this object

The subidentifier index is often a single value (for simple integer-based
tables or scalar objects), though it could also be a string, an IP address,
another OID or even several distinct values - depending on the definition
of the MIB object in question.

But there is a definite distinction between the base OID of the MIB object
and any instance subidentifiers.


  What I expected was some way of describing to the snmpd agent where to
  get the value to return.

That tends to be hard-coded into the agent (or subagent) binary.

And as Mike says, it will typically be different on different systems.
For example, the code for determining the list of printers on a box would
be different for Windows vs Solaris vs Mac OS vs Linux etc
   And it would probably be different for a CUPS-based setup vs LPRng
(so it's not just the O/S that would affect the necessary choice of code).


   where can I find such a
 comprehensive list for my version of net-snmp?

   README.agent-mibs


Note that like any documentation, it's not necessarily fully accurate and
up-to-date.   And it won't include any additional subagents or extensions
that you might have configured.
   But this is likely to be the most informative description for any given
version of the agent.

Dave

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
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: Newbie lacks general mechanics

2009-01-09 Thread Larry Brown
On Fri, 2009-01-09 at 08:37 +, Dave Shield wrote:

 
 
   What I expected was some way of describing to the snmpd agent where to
   get the value to return.
 
 That tends to be hard-coded into the agent (or subagent) binary.

This is what I deduced but couldn't find a description that stated it.

 
where can I find such a
  comprehensive list for my version of net-snmp?
 
README.agent-mibs
 
 
 Note that like any documentation, it's not necessarily fully accurate and
 up-to-date.   And it won't include any additional subagents or extensions
 that you might have configured.
But this is likely to be the most informative description for any given
 version of the agent.
 
 Dave
 

This is also in line with what I was thinking as well.  I just didn't
know this file existed.  I take it from the lack of description out
there that most people just cut and paste from the example mibs and
leave it at that... 

Anyway, you guys have been a great source of information and I can now
start monkeying at will ...  I'm sure I'll be back :)

Larry 




--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
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


Newbie lacks general mechanics

2009-01-08 Thread Larry Brown
Hello all, I've read a number of articles around on snmp and have a
fundamental theory going as to how this works at a macro level but need
some confirmation.  Any assistance will be greatly appreciated.

As I understand it the part of the OID that is returned depends on its
existence in the MIB.  I examined a couple of MIB's and none of them do
more than relate an explanation of what the particular OID provides and
in what format it provides it. (along with name resolution for the OID)
What I expected was some way of describing to the snmpd agent where to
get the value to return.  Since I did not find it there I have the
following assumption:

The snmpd agent is written to pull data on a finite amount of data for N
number of devices hard coded into the binary.  The MIB simply denotes
the values to offer up to remote collectors.

If this is correct, I see there are a number of MIB files present by
default on Fedora which I'm using.  I don't know if one of these MIB
files has every possible item that can be checked, changed and or
reported by the development in the net-snmpd agent.  If there are other
devices that those MIB's don't describe, how would I know I can use them
and what their syntax would be?  Is there some list published for every
possible value the snmpd agent is hard coded to be able to query along
with their MIB entry?  If I wanted the snmpd agent that comes with
Fedora to pull some value from some unique location of my choosing I
would have to write my own snmpd agent or use the snmpd.conf file to
point to a script that gathers the info I want?

Also, if one of the MIB's in the mib folder by default for net-snmpd
does contain every possible value snmpd is hard coded to check, which
one is it?

I hope this makes sense and look forward to some any help...

Larry


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
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: Newbie lacks general mechanics

2009-01-08 Thread Mike Ayers
 From: Larry Brown [mailto:larry.br...@dimensionnetworks.com] 
 Sent: Thursday, January 08, 2009 11:26 AM

 Hello all, I've read a number of articles around on snmp and have a
 fundamental theory going as to how this works at a macro 
 level but need
 some confirmation.  Any assistance will be greatly appreciated.
 
 As I understand it the part of the OID that is returned depends on its
 existence in the MIB.

There is no part of the OID.  OIDs (object identifiers) are atomic.

  I examined a couple of MIB's and none 
 of them do
 more than relate an explanation of what the particular OID 
 provides and
 in what format it provides it. (along with name resolution 
 for the OID)

That is all that a MIB does.  It is an opaque interface description.

 What I expected was some way of describing to the snmpd agent where to
 get the value to return.

The information may be in a different place on every different system 
that supports the MIB.  For each, a subagent must be provided which responds to 
the get, set, etc. queries and returns or changes the data as needed.


HTH,

Mike

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
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


SNMP Newbie

2008-12-20 Thread rjubio
Hello I am new to snmp but I have installed snmp on my machine to 
monitor it via another remote machine. I can monitor my CPU, Memory, 
Disk usage but what I want to include is to monitor my network 
interface. Can anyone help me in doing this?

Thanks in advance.



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


Newbie MIB questions on Windows

2008-12-03 Thread Matthew Devine
So I just installed Net-SNMP binary for Windows version 5.4.2.  Been reading
through the documentation but unable to figure out why I can't get any of
the systemStats from the UCDavis SNMP MIB.  I confirmed that the MIB exists
in my c:\usr\share\snmp\mibs directory.  I can't seem to figure out what
I'm supposed to do to get those stats.  I only have one line in my
snmpd.conf and tried looking under the access control faqs but still no
luck.  Any help would be greatly appreciated, just not grasping this stuff.
 
snmpwalk -v2c -c public localhost systemStats
UCD-SNMP-MIB::systemStats = No Such Object available on this agent at this
OID

Matt Devine

-
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: Newbie MIB questions on Windows

2008-12-03 Thread Fernández Piñas , David

snmpwalk -v2c -c public localhost
 
and post the answer you get.
 
 




De: Matthew Devine [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 03 de diciembre de 2008 19:07
Para: net-snmp-users@lists.sourceforge.net
Asunto: Newbie MIB questions on Windows



So I just installed Net-SNMP binary for Windows version 5.4.2.  Been reading 
through the documentation but unable to figure out why I can't get any of the 
systemStats from the UCDavis SNMP MIB.  I confirmed that the MIB exists in my 
c:\usr\share\snmp\mibs directory.  I can't seem to figure out what I'm 
supposed to do to get those stats.  I only have one line in my snmpd.conf and 
tried looking under the access control faqs but still no luck.  Any help would 
be greatly appreciated, just not grasping this stuff.

 

snmpwalk -v2c -c public localhost systemStats

UCD-SNMP-MIB::systemStats = No Such Object available on this agent at this OID

Matt Devine


-
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: Newbie MIB questions on Windows

2008-12-03 Thread Thomas Anders
Matthew Devine wrote:
 So I just installed Net-SNMP binary for Windows version 5.4.2.  Been
 reading through the documentation but unable to figure out why I can’t
 get any of the systemStats from the UCDavis SNMP MIB. 
 
 snmpwalk -v2c -c public localhost systemStats
 
 UCD-SNMP-MIB::systemStats = No Such Object available on this agent at
 this OID

Not implemented for Windows. See README.agent-mibs as shipped with the source.
Patches always appreciated. :-)


+Thomas

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

-
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: Newbie MIB questions on Windows

2008-12-03 Thread Matthew Devine
Thanks for the response, I just noticed the notes in the service
description.

Matthew Devine
-Original Message-
From: Thomas Anders [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2008 1:46 PM
To: Matthew Devine
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: Newbie MIB questions on Windows

Matthew Devine wrote:
 So I just installed Net-SNMP binary for Windows version 5.4.2.  Been
 reading through the documentation but unable to figure out why I can't
 get any of the systemStats from the UCDavis SNMP MIB. 
 
 snmpwalk -v2c -c public localhost systemStats
 
 UCD-SNMP-MIB::systemStats = No Such Object available on this agent at
 this OID

Not implemented for Windows. See README.agent-mibs as shipped with the
source.
Patches always appreciated. :-)


+Thomas

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

-
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



-
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Dave Shield
On 05/09/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Do I need to do something special or enable something in conf files to be
 able to use 1.3.6.1.4.x.y range?

I will repeat the same question that I asked when you posted the same query
on Tuesday:

What are the access control settings for your (master) agent?

Dave

-
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
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Milan_Tvarozek
Hello Dave,

thanks for replying. For some odd reason I did not get your mail on Tuesday.

I am desperately trying different settings in snmpd.conf but w/o any success.

The current settings are:

com2sec paranoid  default public
com2sec readonly  default public
com2sec readwrite default private

com2sec local localhost   private


# Second, map the security names into group names:

#   sec.model  sec.name
group MyROSystem v1paranoid
group MyROSystem v2c   paranoid
group MyROSystem usm   paranoid
group MyROGroup v1 readonly
group MyROGroup v2creadonly
group MyROGroup usmreadonly
group MyRWGroup v1 readwrite
group MyRWGroup v2creadwrite
group MyRWGroup usmreadwrite

group local   v1 local
group local   v2clocal
group local   usmlocal


# Third, create a view for us to let the groups have rights to:

#   incl/excl subtree  mask
#view allincluded  .1   ff
view allincluded  .1   80
#view system included  .iso.org.dod.internet.mgmt.mib-2.system

view system included  system   fe
view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc


# Finally, grant the 2 groups access to the 1 view with different
# write permissions:

#context sec.model sec.level match  read   write  notif
access MyROSystem  any   noauthexact  system none   none
access MyROGroup   any   noauthexact  allnone   none
access MyRWGroup   any   noauthexact  allallnone

access local any   noauthexact  allall   all


I am testing on the same machine as localhost.


Thanks.

Milan



On Thu, September 6, 2007 10:02 am, Dave Shield wrote:
 On 05/09/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Do I need to do something special or enable something in conf files to
 be able to use 1.3.6.1.4.x.y range?

 I will repeat the same question that I asked when you posted the same
 query on Tuesday:

 What are the access control settings for your (master) agent?


 Dave


 -
  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
 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: 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
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Dave Shield
On 06/09/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I am desperately trying different settings in snmpd.conf but w/o any success.

 The current settings are:

 com2sec paranoid  default public
 com2sec readonly  default public
 com2sec readwrite default private

 com2sec local localhost   private

   [etc, etc, etc]

That feels much too complicated.
Delete all of this, and just use

rocommunity  public




 view system included  system   fe
 access MyROSystem  any   noauthexact  system none   none


That's probably why you can't see anything outside the system group.

But don't do things that way - use 'rocommunity' instead.

Dave

-
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
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Milan_Tvarozek
Hello Dave,

thanks for your prompt reply.

I will use rocommunity  public

but what about view and access ?

MIlan

On Thu, September 6, 2007 12:08 pm, Dave Shield wrote:
 On 06/09/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I am desperately trying different settings in snmpd.conf but w/o any
 success.

 The current settings are:


 com2sec paranoid  default public com2sec readonly  default
 public com2sec readwrite default private

 com2sec local localhost   private

 [etc, etc, etc]


 That feels much too complicated.
 Delete all of this, and just use


 rocommunity  public




 view system included  system   fe access
 MyROSystem  any   noauthexact  system none   none



 That's probably why you can't see anything outside the system group.


 But don't do things that way - use 'rocommunity' instead.


 Dave


 -
  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
 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: 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
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Dave Shield
On 06/09/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hello Dave,

 thanks for your prompt reply.

 I will use rocommunity  public

 but what about view and access ?


Please read the documentation.
(man page and FAQ entries)

Dave

-
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
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Mike Ayers

This thread has made me curious.  The OP indicated that (s)he is 
registering for .1.3.6.  Unless the master agent has been built with no MIBs, 
such a registratrion would not service all requests, correct?  Specifically, 
requests within MIBs that were built into the agent will handle their regions, 
and the .1.3.6 registration will service the leftovers, yes?  No?  What's the 
algorithm for routing requests?  Builtins first?  Registration order?  Most 
specific?  Good luck?

I suppose a code dive is in order...


Thanks for any enlightenment,

Mike

-
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
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Milan_Tvarozek
Hello Mike,

the reason for the fact that 1.3.6.1.4.x requests were not passed from the
master agent to the subagent was default (=incorrect in this case) access
configuration of snmpd.conf.

After replacing default with

rocommunity public default .1

things started to work fine.

Previously, I was looking elsewhere including MIBs.

I am giving credit to Dave for pointing me in the right direction.

Milan

On Thu, September 6, 2007 7:31 pm, Mike Ayers wrote:


 This thread has made me curious.  The OP indicated that (s)he is
 registering for .1.3.6.  Unless the master agent has been built with no
 MIBs, such a registratrion would not service all requests, correct?
 Specifically, requests within MIBs that were built into the agent will
 handle their regions, and the .1.3.6 registration will service the
 leftovers, yes?  No?  What's the algorithm for routing requests?
 Builtins first?  Registration order?  Most specific?  Good luck?


 I suppose a code dive is in order...



 Thanks for any enlightenment,


 Mike


 -
  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
 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: 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
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: Newbie question: netsnmp_handler_registration_create

2007-09-06 Thread Dave Shield
On 06/09/07, Mike Ayers [EMAIL PROTECTED] wrote:
  What's the algorithm for routing requests?  Builtins first?
  Registration order?  Most specific?

Most specific.

Dave

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


Newbie question: netsnmp_handler_registration_create

2007-09-05 Thread Milan_Tvarozek
Hello guys,

I am struggling with netsnmp_handler_registration_create.

I am able to register handlers for some OIDs and I receive requests in the
handler. E.g. when I register for .1.3.6 I receive request for
1.3.6.1.2.1.1.9.1.5.

When I register for 1.3.6.1.4 or 1.3.6.1.4.x.y the requests are not passed
to the handler but I can see something coming in the loop

while(keep_running) {
   agent_check_and_process(1);
   printf(mainloop\n);
}


The debug for snmpwalk -v 1 -c public localhost .1.3.6.1.4 shows

Connection from UDP: [127.0.0.1]:-32762
handler:calling: main handler bulk_to_next
handler:calling: calling handler bulk_to_next for mode GETNEXT
handler:returned: handler bulk_to_next returned 0
handler:calling: calling handler null for mode GETNEXT
handler:returned: handler null returned 0
mainloop
Connection from UDP: [127.0.0.1]:-32762
mainloop



I get the same behaviour when I run as master agent and subagent.

Do I need to do something special or enable something in conf files to be
able to use 1.3.6.1.4.x.y range?

Thanks.

Milan




-
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
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: Newbie question: writing a simple agent

2007-08-10 Thread Graeme Wilson

Hi,

If your are running this as a main agent (and I think you are from
another email) make sure your config files are set up correctly and in
the correct locations (including the persistent file).  Are you running
as root or a normal user?
Presumably the snmpwalk/snmpget request is being performed on the same
address as what the agent is running on (if you haven't changed the
address the agent is running on make sure there isn't an snmpd running
which it might conflict with).

Do you get any messages on startup of your agent at all?
When you start up the agent you could try the following Debug tokens
-Dagent,handler.

G
 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 09 August 2007 18:35
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent
 
 Hello,
 
 I tried even a specific OID.
 
 I am using snmpwalk on localhost with .1.3.6. I hope this 
 should generate some requests that could be passed to the 
 handler function.
 
 On the agent side I am getting
 
 Connection from UDP: [127.0.0.1]:-32767
 
 On the snmpwalk side I am getting request timeout.
 
 
 M.
 
 On Thu, August 9, 2007 5:42 pm, Graeme Wilson wrote:
  Hi,
 
 
  Hmm, ok.
  All I can really suggest is that you try doing some debug - maybe 
  instead of registering a generic OID, try registering a 
 specific OID 
  for a test and then try doing a get on that. How are you 
 running the 
  agent and how are you performing the get?
 
  Maybe some others on here could help you turning the Debug 
 on for more 
  trace messages. I'll keep thinking and get back to you with 
 any other 
  suggestions.
 
  Cheers
  G
 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: 09 August 2007 16:09
  To: Graeme Wilson
  Cc: net-snmp-users@lists.sourceforge.net
  Subject: RE: Newbie question: writing a simple agent
 
 
  Hello Graeme,
 
 
  thanks for your prompt reply.
 
  netsnmp_register_handler( reg ) is hidden in
 
  printf(returned=%d\n, netsnmp_register_handler(reg));
 
  I tried it before without printf and it was doing the same thing.
 
 
  I have no other handlers and no other agents started.
 
 
  I considered switching snmp logging with LOG_DEBUG 
 level/priority but 
  I did not find any function how to set the level.
 
  Is there anything else I could try?
 
 
  Thanks.
 
 
  Milan
 
 
  On Thu, August 9, 2007 4:53 pm, Graeme Wilson wrote:
 
  Hi Milan,
 
 
 
  From a quick look at your code it looks like you've missed
 
  a crucial
  line to register the handler:
 
  netsnmp_register_handler( reg );
 
  Which you need to do after your line:
  reg = netsnmp_handler_registration_create(...)
 
  Also, one important point (I forgot to mention previously),
 
  if there
  are any other handlers which register for specific OIDs (e.g.
  .1.3.6.1.2.1.1.4.0) - these will be called instead of 
 your generic 
  handler.
 
  Hope that helps.
  Graeme
 
 
 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]
  Sent: 09 August 2007 15:43
  To: Graeme Wilson
  Cc: net-snmp-users@lists.sourceforge.net
  Subject: RE: Newbie question: writing a simple agent
 
 
 
  Hello Graeme,
 
 
 
  sorry for bothering you again.
 
  I have tried to merge your code with MFD code. I am
 
  obviously doing
  something wrong. When I run snmpwalk on the agent I can see that
  agent_check_and_process(1) in the main loop finishes but
  the handler
  does not get called.
 
  I get error message from the agent:
 
 
 
  Connection from UDP: [127.0.0.1]:-32767
 
 
 
  I assume this means this request was not handled by the agent.
 
 
 
  I do not know if netsnmp_register_handler(reg) is successful, it 
  returns 0. I was googling but I did not find meaning of 
 this value.
 
  Did I miss something in my main()? I am attaching short code.
 
 
 
  Thank you and please do net get angry with me for so many mails.
 
 
 
  Milan
 
 
 
  
 
 
 
 
  #include agent.h
  #include agent_error.h
 
 
 
  static int keep_running;
 
  void stop_server(UNUSED int a) { keep_running = 0; }
 
 
  /* Ippc function which will be called for all OIDs below
 
  the root one
  registered above */ int IppcOidHandler(UNUSED 
 netsnmp_mib_handler 
  *handler, UNUSED netsnmp_handler_registration *reginfo, UNUSED 
  netsnmp_agent_request_info *reqinfo, netsnmp_request_info
  *requests)
 
  { int ret = SNMP_ERR_NOERROR;
 
 
  printf(Received SNMP request); for (unsigned i = 0; i 
  requests-range_end_len; i++) { printf(%d.,
  (int)requests-range_end[i]);
  }
  printf(\n);
 
  switch(reqinfo-mode) { case MODE_GET: /* Call some 
 other code to 
  process the 'requests' argument */ //ret = myData-getData( 
  requests ); break; case
  MODE_GETNEXT: /* Call some other code to process the 'requests'
  argument */ //ret = myData-getNextData( requests );
  break; default:
  /* we should never get here in my code */ //iRet

RE: Newbie question: writing a simple agent

2007-08-09 Thread Milan_Tvarozek
Hello Graeme,

sorry for bothering you again.

I have tried to merge your code with MFD code. I am obviously doing
something wrong. When I run snmpwalk on the agent I can see that
agent_check_and_process(1) in the main loop finishes but the handler does
not get called.

I get error message from the agent:

Connection from UDP: [127.0.0.1]:-32767

I assume this means this request was not handled by the agent.

I do not know if netsnmp_register_handler(reg) is successful, it returns
0. I was googling but I did not find meaning of this value.

Did I miss something in my main()? I am attaching short code.

Thank you and please do net get angry with me for so many mails.

Milan




#include agent.h
#include agent_error.h

static int keep_running;

void stop_server(UNUSED int a) {
keep_running = 0;
}

/* Ippc function which will be called for all OIDs below the root one
registered above */
int IppcOidHandler(UNUSED netsnmp_mib_handler *handler,
   UNUSED netsnmp_handler_registration *reginfo,
   UNUSED netsnmp_agent_request_info *reqinfo,
   netsnmp_request_info *requests)
{
  int ret = SNMP_ERR_NOERROR;

  printf(Received SNMP request);
  for (unsigned i = 0; i  requests-range_end_len; i++) {
  printf(%d., (int)requests-range_end[i]);
  }
  printf(\n);

  switch(reqinfo-mode)
  {
case MODE_GET:
 /* Call some other code to process the 'requests' argument */
 //ret = myData-getData( requests );
 break;
case MODE_GETNEXT:
 /* Call some other code to process the 'requests' argument */
 //ret = myData-getNextData( requests );
 break;
default:
 /* we should never get here in my code */
 //iRet = SNMP_ERR_GENERR;
 break;
  }
  return 1; //ret;
}

int main (UNUSED int argc, UNUSED char **argv) {
  netsnmp_mib_handler *handler;
  netsnmp_handler_registration *reg;

  static oid root_oid[] =  { 1, 3, 6 };

  snmp_enable_stderrlog();

  SOCK_STARTUP;

  init_agent(ippc agent);

  init_snmp(ippc agent);

  init_master_agent();  /* open the port to listen on (defaults to
udp:161) */

  keep_running = 1;
  signal(SIGTERM, stop_server);
  signal(SIGINT, stop_server);

  handler = netsnmp_create_handler(IppcOIDHandler, IppcOidHandler );

  if (handler) {
  reg = netsnmp_handler_registration_create( IppcHandler,
 handler,
 root_oid,
 OID_LENGTH(root_oid),
 0);

  printf(returned=%d\n, netsnmp_register_handler(reg));
   }
   else {
  exit(1);
   }


  while(keep_running) {
agent_check_and_process(1); /* 0 == don't block */
printf(mainloop\n);
  }

  /* at shutdown time */
  netsnmp_unregister_handler(reg);
  snmp_shutdown(ippc agent);
  SOCK_CLEANUP;

  return 0;
}







On Wed, August 8, 2007 4:10 pm, Graeme Wilson wrote:
 Hi Milan,


 No worries about the questions.


 For my subagent (binary/executable) I doctored an existing 'main' that I
 had from when I'd created a subagent with mib2c - its just like your
 example below: - init_agent
 - etc etc
 - register your handler here
 - loop (agent_check_and_process)
 - etc etc


 Cheers
 Graeme



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 08 August 2007 14:47
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent


 Hello Graeme,


 I went through your code and it seems it is exactly what I need.


 I am just confused about one thing: how does it plug into snmpd?


 I understand that I need to do in agent main() registration
 (and un-registration at agent finish)  but what do I actually
 generate?

 Should I create a binary like in MFD example and loop using
 agent_check_and_process() or snmp_select_info() or should I create some
 kind of .so that does mere regsitration and finishes?

 In the former case the scenario is
 - init_agent
 - init_snmp
 - init_master_agent();
 - register handler
 - loop
 - un-register handler
 - snmp_shutdown


 or am I missing something?

 Sorry for asking you newbie trivial questions :-)


 Thanks.


 Milan






 On Wed, August 8, 2007 11:11 am, Graeme Wilson wrote:



 Hi,



 I have done something similar recently (I provide some sample code
 below - but note that ultimately everything is still done within

 the agent).
 My Agent simply registers the root OID of the MIB it will

 handle and
 some other function knows all about the data and the specific OIDs
 that the Agent handles. I just registered a generic handler for the
 root oid and
 then when it
 is called, the handler make appropriate calls to handle the
 request.
 I guess in your case you could then request the data (if

 any) from the
 process/thread that holds the Data and OIDS.

 Hope that helps.
 Graeme
 -
 /* In your

RE: Newbie question: writing a simple agent

2007-08-09 Thread Graeme Wilson
Hi Milan,

From a quick look at your code it looks like you've missed a crucial
line to register the handler:

netsnmp_register_handler( reg );

Which you need to do after your line:
reg = netsnmp_handler_registration_create(...)

Also, one important point (I forgot to mention previously), if there are
any other handlers which register for specific OIDs (e.g.
.1.3.6.1.2.1.1.4.0) - these will be called instead of your generic
handler.

Hope that helps.
Graeme



 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 09 August 2007 15:43
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent
 
 Hello Graeme,
 
 sorry for bothering you again.
 
 I have tried to merge your code with MFD code. I am obviously 
 doing something wrong. When I run snmpwalk on the agent I can see that
 agent_check_and_process(1) in the main loop finishes but the 
 handler does not get called.
 
 I get error message from the agent:
 
 Connection from UDP: [127.0.0.1]:-32767
 
 I assume this means this request was not handled by the agent.
 
 I do not know if netsnmp_register_handler(reg) is successful, 
 it returns 0. I was googling but I did not find meaning of this value.
 
 Did I miss something in my main()? I am attaching short code.
 
 Thank you and please do net get angry with me for so many mails.
 
 Milan
 
 
 
 
 #include agent.h
 #include agent_error.h
 
 static int keep_running;
 
 void stop_server(UNUSED int a) {
 keep_running = 0;
 }
 
 /* Ippc function which will be called for all OIDs below the 
 root one registered above */ int IppcOidHandler(UNUSED 
 netsnmp_mib_handler *handler,
UNUSED netsnmp_handler_registration *reginfo,
UNUSED netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests) {
   int ret = SNMP_ERR_NOERROR;
 
   printf(Received SNMP request);
   for (unsigned i = 0; i  requests-range_end_len; i++) {
   printf(%d., (int)requests-range_end[i]);
   }
   printf(\n);
 
   switch(reqinfo-mode)
   {
 case MODE_GET:
  /* Call some other code to process the 'requests' argument */
  //ret = myData-getData( requests );
  break;
 case MODE_GETNEXT:
  /* Call some other code to process the 'requests' argument */
  //ret = myData-getNextData( requests );
  break;
 default:
  /* we should never get here in my code */
  //iRet = SNMP_ERR_GENERR;
  break;
   }
   return 1; //ret;
 }
 
 int main (UNUSED int argc, UNUSED char **argv) {
   netsnmp_mib_handler *handler;
   netsnmp_handler_registration *reg;
 
   static oid root_oid[] =  { 1, 3, 6 };
 
   snmp_enable_stderrlog();
 
   SOCK_STARTUP;
 
   init_agent(ippc agent);
 
   init_snmp(ippc agent);
 
   init_master_agent();  /* open the port to listen on (defaults to
 udp:161) */
 
   keep_running = 1;
   signal(SIGTERM, stop_server);
   signal(SIGINT, stop_server);
 
   handler = netsnmp_create_handler(IppcOIDHandler, 
 IppcOidHandler );
 
   if (handler) {
   reg = netsnmp_handler_registration_create( IppcHandler,
  handler,
  root_oid,
  OID_LENGTH(root_oid),
  0);
 
   printf(returned=%d\n, netsnmp_register_handler(reg));
}
else {
   exit(1);
}
 
 
   while(keep_running) {
 agent_check_and_process(1); /* 0 == don't block */
 printf(mainloop\n);
   }
 
   /* at shutdown time */
   netsnmp_unregister_handler(reg);
   snmp_shutdown(ippc agent);
   SOCK_CLEANUP;
 
   return 0;
 }
 
 
 
 
 
 
 
 On Wed, August 8, 2007 4:10 pm, Graeme Wilson wrote:
  Hi Milan,
 
 
  No worries about the questions.
 
 
  For my subagent (binary/executable) I doctored an existing 
 'main' that 
  I had from when I'd created a subagent with mib2c - its 
 just like your 
  example below: - init_agent
  - etc etc
  - register your handler here
  - loop (agent_check_and_process)
  - etc etc
 
 
  Cheers
  Graeme
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: 08 August 2007 14:47
  To: Graeme Wilson
  Cc: net-snmp-users@lists.sourceforge.net
  Subject: RE: Newbie question: writing a simple agent
 
 
  Hello Graeme,
 
 
  I went through your code and it seems it is exactly what I need.
 
 
  I am just confused about one thing: how does it plug into snmpd?
 
 
  I understand that I need to do in agent main() registration (and 
  un-registration at agent finish)  but what do I actually generate?
 
  Should I create a binary like in MFD example and loop using
  agent_check_and_process() or snmp_select_info() or should I create 
  some kind of .so that does mere regsitration and finishes?
 
  In the former case the scenario is
  - init_agent
  - init_snmp

RE: Newbie question: writing a simple agent

2007-08-09 Thread Milan_Tvarozek
Hello Graeme,

thanks for your prompt reply.

netsnmp_register_handler( reg ) is hidden in

printf(returned=%d\n, netsnmp_register_handler(reg));

I tried it before without printf and it was doing the same thing.

I have no other handlers and no other agents started.

I considered switching snmp logging with LOG_DEBUG level/priority but I
did not find any function how to set the level.

Is there anything else I could try?

Thanks.

Milan

On Thu, August 9, 2007 4:53 pm, Graeme Wilson wrote:
 Hi Milan,


 From a quick look at your code it looks like you've missed a crucial
 line to register the handler:

 netsnmp_register_handler( reg );

 Which you need to do after your line:
 reg = netsnmp_handler_registration_create(...)

 Also, one important point (I forgot to mention previously), if there are
 any other handlers which register for specific OIDs (e.g.
 .1.3.6.1.2.1.1.4.0) - these will be called instead of your generic
 handler.

 Hope that helps.
 Graeme






 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 09 August 2007 15:43
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent


 Hello Graeme,


 sorry for bothering you again.

 I have tried to merge your code with MFD code. I am obviously
 doing something wrong. When I run snmpwalk on the agent I can see that
 agent_check_and_process(1) in the main loop finishes but the handler
 does not get called.

 I get error message from the agent:


 Connection from UDP: [127.0.0.1]:-32767


 I assume this means this request was not handled by the agent.


 I do not know if netsnmp_register_handler(reg) is successful,
 it returns 0. I was googling but I did not find meaning of this value.

 Did I miss something in my main()? I am attaching short code.


 Thank you and please do net get angry with me for so many mails.


 Milan


 



 #include agent.h
 #include agent_error.h


 static int keep_running;

 void stop_server(UNUSED int a) { keep_running = 0; }


 /* Ippc function which will be called for all OIDs below the
 root one registered above */ int IppcOidHandler(UNUSED
 netsnmp_mib_handler *handler, UNUSED netsnmp_handler_registration
 *reginfo,
 UNUSED netsnmp_agent_request_info *reqinfo,
 netsnmp_request_info *requests) { int ret = SNMP_ERR_NOERROR;

 printf(Received SNMP request); for (unsigned i = 0; i 
 requests-range_end_len; i++) { printf(%d.,
 (int)requests-range_end[i]);
 }
 printf(\n);

 switch(reqinfo-mode) {
 case MODE_GET: /* Call some other code to process the 'requests' argument
 */
 //ret = myData-getData( requests );
 break; case MODE_GETNEXT: /* Call some other code to process the
 'requests' argument */
 //ret = myData-getNextData( requests );
 break; default:
 /* we should never get here in my code */
 //iRet = SNMP_ERR_GENERR;
 break; }
 return 1; //ret; }


 int main (UNUSED int argc, UNUSED char **argv) { netsnmp_mib_handler
 *handler;
 netsnmp_handler_registration *reg;

 static oid root_oid[] =  { 1, 3, 6 };

 snmp_enable_stderrlog();

 SOCK_STARTUP;


 init_agent(ippc agent);

 init_snmp(ippc agent);

 init_master_agent();  /* open the port to listen on (defaults to
 udp:161) */


 keep_running = 1; signal(SIGTERM, stop_server); signal(SIGINT,
 stop_server);

 handler = netsnmp_create_handler(IppcOIDHandler, IppcOidHandler );


 if (handler) { reg = netsnmp_handler_registration_create( IppcHandler,
  handler, root_oid, OID_LENGTH(root_oid),
 0);


 printf(returned=%d\n, netsnmp_register_handler(reg)); }
 else { exit(1); }



 while(keep_running) { agent_check_and_process(1); /* 0 == don't block */
  printf(mainloop\n); }


 /* at shutdown time */
 netsnmp_unregister_handler(reg); snmp_shutdown(ippc agent);
 SOCK_CLEANUP;


 return 0; }





 



 On Wed, August 8, 2007 4:10 pm, Graeme Wilson wrote:

 Hi Milan,



 No worries about the questions.



 For my subagent (binary/executable) I doctored an existing

 'main' that

 I had from when I'd created a subagent with mib2c - its

 just like your
 example below: - init_agent - etc etc
 - register your handler here
 - loop (agent_check_and_process)
 - etc etc



 Cheers
 Graeme




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 08 August 2007 14:47
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent



 Hello Graeme,



 I went through your code and it seems it is exactly what I need.



 I am just confused about one thing: how does it plug into snmpd?



 I understand that I need to do in agent main() registration (and
 un-registration at agent finish)  but what do I actually generate?

 Should I create a binary like in MFD example and loop using
 agent_check_and_process() or snmp_select_info() or should I create
 some kind of .so that does mere regsitration and finishes?

 In the former case the scenario is
 - init_agent
 - init_snmp
 - init_master_agent();
 - register

RE: Newbie question: writing a simple agent

2007-08-09 Thread Graeme Wilson
Hi,

Hmm, ok.
All I can really suggest is that you try doing some debug - maybe
instead of registering a generic OID, try registering a specific OID for
a test and then try doing a get on that.
How are you running the agent and how are you performing the get?

Maybe some others on here could help you turning the Debug on for more
trace messages.
I'll keep thinking and get back to you with any other suggestions.

Cheers
G


 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 09 August 2007 16:09
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent
 
 Hello Graeme,
 
 thanks for your prompt reply.
 
 netsnmp_register_handler( reg ) is hidden in
 
 printf(returned=%d\n, netsnmp_register_handler(reg));
 
 I tried it before without printf and it was doing the same thing.
 
 I have no other handlers and no other agents started.
 
 I considered switching snmp logging with LOG_DEBUG 
 level/priority but I did not find any function how to set the level.
 
 Is there anything else I could try?
 
 Thanks.
 
 Milan
 
 On Thu, August 9, 2007 4:53 pm, Graeme Wilson wrote:
  Hi Milan,
 
 
  From a quick look at your code it looks like you've missed 
 a crucial 
  line to register the handler:
 
  netsnmp_register_handler( reg );
 
  Which you need to do after your line:
  reg = netsnmp_handler_registration_create(...)
 
  Also, one important point (I forgot to mention previously), 
 if there 
  are any other handlers which register for specific OIDs (e.g.
  .1.3.6.1.2.1.1.4.0) - these will be called instead of your generic 
  handler.
 
  Hope that helps.
  Graeme
 
 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: 09 August 2007 15:43
  To: Graeme Wilson
  Cc: net-snmp-users@lists.sourceforge.net
  Subject: RE: Newbie question: writing a simple agent
 
 
  Hello Graeme,
 
 
  sorry for bothering you again.
 
  I have tried to merge your code with MFD code. I am 
 obviously doing 
  something wrong. When I run snmpwalk on the agent I can see that
  agent_check_and_process(1) in the main loop finishes but 
 the handler 
  does not get called.
 
  I get error message from the agent:
 
 
  Connection from UDP: [127.0.0.1]:-32767
 
 
  I assume this means this request was not handled by the agent.
 
 
  I do not know if netsnmp_register_handler(reg) is successful, it 
  returns 0. I was googling but I did not find meaning of this value.
 
  Did I miss something in my main()? I am attaching short code.
 
 
  Thank you and please do net get angry with me for so many mails.
 
 
  Milan
 
 
  
 
 
 
  #include agent.h
  #include agent_error.h
 
 
  static int keep_running;
 
  void stop_server(UNUSED int a) { keep_running = 0; }
 
 
  /* Ippc function which will be called for all OIDs below 
 the root one 
  registered above */ int IppcOidHandler(UNUSED netsnmp_mib_handler 
  *handler, UNUSED netsnmp_handler_registration *reginfo, UNUSED 
  netsnmp_agent_request_info *reqinfo, netsnmp_request_info 
 *requests) 
  { int ret = SNMP_ERR_NOERROR;
 
  printf(Received SNMP request); for (unsigned i = 0; i 
  requests-range_end_len; i++) { printf(%d.,
  (int)requests-range_end[i]);
  }
  printf(\n);
 
  switch(reqinfo-mode) {
  case MODE_GET: /* Call some other code to process the 'requests' 
  argument */ //ret = myData-getData( requests ); break; case 
  MODE_GETNEXT: /* Call some other code to process the 'requests' 
  argument */ //ret = myData-getNextData( requests ); 
 break; default:
  /* we should never get here in my code */ //iRet = 
 SNMP_ERR_GENERR; 
  break; } return 1; //ret; }
 
 
  int main (UNUSED int argc, UNUSED char **argv) { 
 netsnmp_mib_handler 
  *handler; netsnmp_handler_registration *reg;
 
  static oid root_oid[] =  { 1, 3, 6 };
 
  snmp_enable_stderrlog();
 
  SOCK_STARTUP;
 
 
  init_agent(ippc agent);
 
  init_snmp(ippc agent);
 
  init_master_agent();  /* open the port to listen on (defaults to
  udp:161) */
 
 
  keep_running = 1; signal(SIGTERM, stop_server); signal(SIGINT, 
  stop_server);
 
  handler = netsnmp_create_handler(IppcOIDHandler, 
 IppcOidHandler );
 
 
  if (handler) { reg = netsnmp_handler_registration_create( 
  IppcHandler,  handler, root_oid, OID_LENGTH(root_oid), 0);
 
 
  printf(returned=%d\n, netsnmp_register_handler(reg)); } else { 
  exit(1); }
 
 
 
  while(keep_running) { agent_check_and_process(1); /* 0 == 
 don't block 
  */  printf(mainloop\n); }
 
 
  /* at shutdown time */
  netsnmp_unregister_handler(reg); snmp_shutdown(ippc agent); 
  SOCK_CLEANUP;
 
 
  return 0; }
 
 
 
 
 
  
 
 
 
  On Wed, August 8, 2007 4:10 pm, Graeme Wilson wrote:
 
  Hi Milan,
 
 
 
  No worries about the questions.
 
 
 
  For my subagent (binary/executable) I doctored an existing
 
  'main' that
 
  I had from when I'd created a subagent with mib2c - its
 
  just like your
  example below: - init_agent - etc etc
  - register your handler

RE: Newbie question: writing a simple agent

2007-08-09 Thread Milan_Tvarozek
Hello,

I tried even a specific OID.

I am using snmpwalk on localhost with .1.3.6. I hope this should generate
some requests that could be passed to the handler function.

On the agent side I am getting

Connection from UDP: [127.0.0.1]:-32767

On the snmpwalk side I am getting request timeout.


M.

On Thu, August 9, 2007 5:42 pm, Graeme Wilson wrote:
 Hi,


 Hmm, ok.
 All I can really suggest is that you try doing some debug - maybe
 instead of registering a generic OID, try registering a specific OID for a
 test and then try doing a get on that. How are you running the agent and
 how are you performing the get?

 Maybe some others on here could help you turning the Debug on for more
 trace messages. I'll keep thinking and get back to you with any other
 suggestions.

 Cheers
 G





 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 09 August 2007 16:09
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent


 Hello Graeme,


 thanks for your prompt reply.

 netsnmp_register_handler( reg ) is hidden in

 printf(returned=%d\n, netsnmp_register_handler(reg));

 I tried it before without printf and it was doing the same thing.


 I have no other handlers and no other agents started.


 I considered switching snmp logging with LOG_DEBUG
 level/priority but I did not find any function how to set the level.

 Is there anything else I could try?


 Thanks.


 Milan


 On Thu, August 9, 2007 4:53 pm, Graeme Wilson wrote:

 Hi Milan,



 From a quick look at your code it looks like you've missed

 a crucial
 line to register the handler:

 netsnmp_register_handler( reg );

 Which you need to do after your line:
 reg = netsnmp_handler_registration_create(...)

 Also, one important point (I forgot to mention previously),

 if there
 are any other handlers which register for specific OIDs (e.g.
 .1.3.6.1.2.1.1.4.0) - these will be called instead of your generic
 handler.

 Hope that helps.
 Graeme







 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 09 August 2007 15:43
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent



 Hello Graeme,



 sorry for bothering you again.

 I have tried to merge your code with MFD code. I am

 obviously doing
 something wrong. When I run snmpwalk on the agent I can see that
 agent_check_and_process(1) in the main loop finishes but
 the handler
 does not get called.

 I get error message from the agent:



 Connection from UDP: [127.0.0.1]:-32767



 I assume this means this request was not handled by the agent.



 I do not know if netsnmp_register_handler(reg) is successful, it
 returns 0. I was googling but I did not find meaning of this value.

 Did I miss something in my main()? I am attaching short code.



 Thank you and please do net get angry with me for so many mails.



 Milan



 




 #include agent.h
 #include agent_error.h



 static int keep_running;

 void stop_server(UNUSED int a) { keep_running = 0; }


 /* Ippc function which will be called for all OIDs below

 the root one
 registered above */ int IppcOidHandler(UNUSED netsnmp_mib_handler
 *handler, UNUSED netsnmp_handler_registration *reginfo, UNUSED
 netsnmp_agent_request_info *reqinfo, netsnmp_request_info
 *requests)

 { int ret = SNMP_ERR_NOERROR;


 printf(Received SNMP request); for (unsigned i = 0; i 
 requests-range_end_len; i++) { printf(%d.,
 (int)requests-range_end[i]);
 }
 printf(\n);

 switch(reqinfo-mode) { case MODE_GET: /* Call some other code to
 process the 'requests' argument */ //ret = myData-getData( requests
 ); break; case
 MODE_GETNEXT: /* Call some other code to process the 'requests'
 argument */ //ret = myData-getNextData( requests );
 break; default:
 /* we should never get here in my code */ //iRet =

 SNMP_ERR_GENERR;

 break; } return 1; //ret; }


 int main (UNUSED int argc, UNUSED char **argv) {
 netsnmp_mib_handler
 *handler; netsnmp_handler_registration *reg;


 static oid root_oid[] =  { 1, 3, 6 };

 snmp_enable_stderrlog();

 SOCK_STARTUP;



 init_agent(ippc agent);

 init_snmp(ippc agent);

 init_master_agent();  /* open the port to listen on (defaults to
 udp:161) */



 keep_running = 1; signal(SIGTERM, stop_server); signal(SIGINT,
 stop_server);

 handler = netsnmp_create_handler(IppcOIDHandler,
 IppcOidHandler );



 if (handler) { reg = netsnmp_handler_registration_create(
 IppcHandler,  handler, root_oid, OID_LENGTH(root_oid), 0);



 printf(returned=%d\n, netsnmp_register_handler(reg)); } else {
 exit(1); }



 while(keep_running) { agent_check_and_process(1); /* 0 ==
 don't block
 */  printf(mainloop\n); }



 /* at shutdown time */
 netsnmp_unregister_handler(reg); snmp_shutdown(ippc agent);
 SOCK_CLEANUP;



 return 0; }





 




 On Wed, August 8, 2007 4:10 pm, Graeme Wilson wrote:


 Hi Milan,




 No worries about the questions.




 For my subagent

RE: Newbie question: writing a simple agent

2007-08-08 Thread Graeme Wilson
 
Hi,

I have done something similar recently (I provide some sample code below
- but note that ultimately everything is still done within the agent).
My Agent simply registers the root OID of the MIB it will handle and
some other function knows all about the data and the specific OIDs that
the Agent handles.
I just registered a generic handler for the root oid and then when it is
called, the handler make appropriate calls to handle the request.  I
guess in your case you could then request the data (if any) from the
process/thread that holds the Data and OIDS.

Hope that helps.
Graeme
-
/* In your main/initialise function */
netsnmp_mib_handler* handler = netsnmp_create_handler(
GenericOIDHandler, genericOidHandler );

netsnmp_handler_registration* reg = 
 netsnmp_handler_registration_create( GenericHandler,
 handler,
 root_oid,
 OID_LENGTH(root_oid),
 0 );

netsnmp_register_handler( reg );



/* Generic function which will be called for all OIDs below the root one
registered above */
int genericOidHandler( netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests )
{
  int ret = SNMP_ERR_NOERROR;

  switch(reqinfo-mode)
  {
case MODE_GET:
 /* Call some other code to process the 'requests' argument */
 ret = myData-getData( requests );
 break;
case MODE_GETNEXT:
 /* Call some other code to process the 'requests' argument */
 ret = myData-getNextData( requests );
 break;
default:
 /* we should never get here in my code */
 iRet = SNMP_ERR_GENERR;
 break;
  }
  return ret;
}



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of [EMAIL PROTECTED]
 Sent: 08 August 2007 06:51
 To: Mike Ayers
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent
 
 Hello Mike,
 
 thanks for replying to my question.
 
 I understand that a standard approach is to register the 
 agent for a range of OISs and to let the agent to be OID 
 aware while the other process should take care of the 
 underlaying data.
 
 However, I was asked to write an agent that would NOT be 
 OID-aware. All it would know it is responsible for a range of 
 OIDs without knowing any details. It would forward complete 
 OIDs to the other process that would take care about OID 
 disassembly/translation, data manipulation etc.
 
 I am wondering if this is possible within the Net SNMP API, at all.
 
 If so, where should I start?
 
 Thanks.
 
 Milan
 
 On Tue, August 7, 2007 11:44 pm, Mike Ayers wrote:
 
 
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  [EMAIL PROTECTED]
 
 
 
  The agent itself will not be aware of individual OIDs and their 
  meaning. This will be done by the other process that also 
 holds the  
  actual data.
 
  This is a bit of a design problem as stated.  The (sub)agent is 
  responsible for managing its OID range, and therefore it is not 
  possible to have a subagent completely unaware of the OIDs. 
  This does 
  not, however, mean that the subagent needs to be aware of the data 
  underlying the MIB.
 
  A common paradigm is to have the subagent register for the range of 
  values (table, MIB, whatever) that it will manage, and have the OP 
  (other
  process) manage the data within the range.  The agent does OID 
  assembly/disassembly (i.e. breaking OIDs into range part 
 and specific 
  part), possibly reformat the specific part to make it more 
  understandable to the OP (thus only the subagent need be 
 MIB aware).  
  The OP returns the values for the requested data, then the subagent 
  formats and assembles the response.
 
 
  HTH,
 
 
  Mike
 
 
  
 --
  ---  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
  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: 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

RE: Newbie question: writing a simple agent

2007-08-08 Thread Milan_Tvarozek
Hello Graeme,

thanks for your reply.

I will try your code. It seems it might be close to what I need.

Have a nice day.

Milan




On Wed, August 8, 2007 11:11 am, Graeme Wilson wrote:


 Hi,


 I have done something similar recently (I provide some sample code below
 - but note that ultimately everything is still done within the agent).
 My Agent simply registers the root OID of the MIB it will handle and
 some other function knows all about the data and the specific OIDs that the
 Agent handles.
 I just registered a generic handler for the root oid and then when it is
 called, the handler make appropriate calls to handle the request.  I guess
 in your case you could then request the data (if any) from the
 process/thread that holds the Data and OIDS.

 Hope that helps.
 Graeme
 -
 /* In your main/initialise function */
 netsnmp_mib_handler* handler = netsnmp_create_handler( GenericOIDHandler,
 genericOidHandler );


 netsnmp_handler_registration* reg = netsnmp_handler_registration_create(
 GenericHandler,
 handler, root_oid, OID_LENGTH(root_oid),
 0 );

 netsnmp_register_handler( reg );



 /* Generic function which will be called for all OIDs below the root one
 registered above */ int genericOidHandler( netsnmp_mib_handler *handler,
 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
 *reqinfo,
 netsnmp_request_info *requests ) {
 int ret = SNMP_ERR_NOERROR;

 switch(reqinfo-mode) {
 case MODE_GET: /* Call some other code to process the 'requests' argument
 */
 ret = myData-getData( requests ); break; case MODE_GETNEXT: /* Call some
 other code to process the 'requests' argument */ ret =
 myData-getNextData( requests ); break; default:
 /* we should never get here in my code */
 iRet = SNMP_ERR_GENERR; break; }
 return ret; }




 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of [EMAIL PROTECTED]
 Sent: 08 August 2007 06:51
 To: Mike Ayers
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent


 Hello Mike,


 thanks for replying to my question.

 I understand that a standard approach is to register the
 agent for a range of OISs and to let the agent to be OID aware while the
 other process should take care of the underlaying data.

 However, I was asked to write an agent that would NOT be
 OID-aware. All it would know it is responsible for a range of
 OIDs without knowing any details. It would forward complete
 OIDs to the other process that would take care about OID
 disassembly/translation, data manipulation etc.

 I am wondering if this is possible within the Net SNMP API, at all.


 If so, where should I start?


 Thanks.


 Milan


 On Tue, August 7, 2007 11:44 pm, Mike Ayers wrote:



 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 [EMAIL PROTECTED]




 The agent itself will not be aware of individual OIDs and their
 meaning. This will be done by the other process that also
 holds the
 actual data.

 This is a bit of a design problem as stated.  The (sub)agent is
 responsible for managing its OID range, and therefore it is not
 possible to have a subagent completely unaware of the OIDs.
 This does

 not, however, mean that the subagent needs to be aware of the data
 underlying the MIB.

 A common paradigm is to have the subagent register for the range of
 values (table, MIB, whatever) that it will manage, and have the OP
 (other
 process) manage the data within the range.  The agent does OID
 assembly/disassembly (i.e. breaking OIDs into range part
 and specific
 part), possibly reformat the specific part to make it more
 understandable to the OP (thus only the subagent need be
 MIB aware).

 The OP returns the values for the requested data, then the subagent
 formats and assembles the response.


 HTH,



 Mike




 --

 ---  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
 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: 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
 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: Newbie question: writing a simple agent

2007-08-08 Thread Milan_Tvarozek
Hello Graeme,

I went through your code and it seems it is exactly what I need.

I am just confused about one thing: how does it plug into snmpd?

I understand that I need to do in agent main() registration (and
un-registration at agent finish)  but what do I actually generate?

Should I create a binary like in MFD example and loop using
agent_check_and_process() or snmp_select_info() or should I create some
kind of .so that does mere regsitration and finishes?

In the former case the scenario is
- init_agent
- init_snmp
- init_master_agent();
- register handler
- loop
- un-register handler
- snmp_shutdown

or am I missing something?

Sorry for asking you newbie trivial questions :-)

Thanks.

Milan





On Wed, August 8, 2007 11:11 am, Graeme Wilson wrote:


 Hi,


 I have done something similar recently (I provide some sample code below
 - but note that ultimately everything is still done within the agent).
 My Agent simply registers the root OID of the MIB it will handle and
 some other function knows all about the data and the specific OIDs that the
 Agent handles.
 I just registered a generic handler for the root oid and then when it is
 called, the handler make appropriate calls to handle the request.  I guess
 in your case you could then request the data (if any) from the
 process/thread that holds the Data and OIDS.

 Hope that helps.
 Graeme
 -
 /* In your main/initialise function */
 netsnmp_mib_handler* handler = netsnmp_create_handler( GenericOIDHandler,
 genericOidHandler );


 netsnmp_handler_registration* reg = netsnmp_handler_registration_create(
 GenericHandler,
 handler, root_oid, OID_LENGTH(root_oid),
 0 );

 netsnmp_register_handler( reg );



 /* Generic function which will be called for all OIDs below the root one
 registered above */ int genericOidHandler( netsnmp_mib_handler *handler,
 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
 *reqinfo,
 netsnmp_request_info *requests ) {
 int ret = SNMP_ERR_NOERROR;

 switch(reqinfo-mode) {
 case MODE_GET: /* Call some other code to process the 'requests' argument
 */
 ret = myData-getData( requests ); break; case MODE_GETNEXT: /* Call some
 other code to process the 'requests' argument */ ret =
 myData-getNextData( requests ); break; default:
 /* we should never get here in my code */
 iRet = SNMP_ERR_GENERR; break; }
 return ret; }




 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of [EMAIL PROTECTED]
 Sent: 08 August 2007 06:51
 To: Mike Ayers
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent


 Hello Mike,


 thanks for replying to my question.

 I understand that a standard approach is to register the
 agent for a range of OISs and to let the agent to be OID aware while the
 other process should take care of the underlaying data.

 However, I was asked to write an agent that would NOT be
 OID-aware. All it would know it is responsible for a range of
 OIDs without knowing any details. It would forward complete
 OIDs to the other process that would take care about OID
 disassembly/translation, data manipulation etc.

 I am wondering if this is possible within the Net SNMP API, at all.


 If so, where should I start?


 Thanks.


 Milan


 On Tue, August 7, 2007 11:44 pm, Mike Ayers wrote:



 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 [EMAIL PROTECTED]




 The agent itself will not be aware of individual OIDs and their
 meaning. This will be done by the other process that also
 holds the
 actual data.

 This is a bit of a design problem as stated.  The (sub)agent is
 responsible for managing its OID range, and therefore it is not
 possible to have a subagent completely unaware of the OIDs.
 This does

 not, however, mean that the subagent needs to be aware of the data
 underlying the MIB.

 A common paradigm is to have the subagent register for the range of
 values (table, MIB, whatever) that it will manage, and have the OP
 (other
 process) manage the data within the range.  The agent does OID
 assembly/disassembly (i.e. breaking OIDs into range part
 and specific
 part), possibly reformat the specific part to make it more
 understandable to the OP (thus only the subagent need be
 MIB aware).

 The OP returns the values for the requested data, then the subagent
 formats and assembles the response.


 HTH,



 Mike




 --

 ---  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
 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: Newbie question: writing a simple agent

2007-08-08 Thread Graeme Wilson
Hi Milan,

No worries about the questions.

For my subagent (binary/executable) I doctored an existing 'main' that I
had from when I'd created a subagent with mib2c - its just like your
example below:
 - init_agent
   - etc etc
 - register your handler here
 - loop (agent_check_and_process)
 - etc etc

Cheers
Graeme
 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 08 August 2007 14:47
 To: Graeme Wilson
 Cc: net-snmp-users@lists.sourceforge.net
 Subject: RE: Newbie question: writing a simple agent
 
 Hello Graeme,
 
 I went through your code and it seems it is exactly what I need.
 
 I am just confused about one thing: how does it plug into snmpd?
 
 I understand that I need to do in agent main() registration 
 (and un-registration at agent finish)  but what do I actually 
 generate?
 
 Should I create a binary like in MFD example and loop using
 agent_check_and_process() or snmp_select_info() or should I 
 create some kind of .so that does mere regsitration and finishes?
 
 In the former case the scenario is
 - init_agent
 - init_snmp
 - init_master_agent();
 - register handler
 - loop
 - un-register handler
 - snmp_shutdown
 
 or am I missing something?
 
 Sorry for asking you newbie trivial questions :-)
 
 Thanks.
 
 Milan
 
 
 
 
 
 On Wed, August 8, 2007 11:11 am, Graeme Wilson wrote:
 
 
  Hi,
 
 
  I have done something similar recently (I provide some sample code 
  below
  - but note that ultimately everything is still done within 
 the agent).
  My Agent simply registers the root OID of the MIB it will 
 handle and 
  some other function knows all about the data and the specific OIDs 
  that the Agent handles.
  I just registered a generic handler for the root oid and 
 then when it 
  is called, the handler make appropriate calls to handle the 
 request.  
  I guess in your case you could then request the data (if 
 any) from the 
  process/thread that holds the Data and OIDS.
 
  Hope that helps.
  Graeme
  -
  /* In your main/initialise function */
  netsnmp_mib_handler* handler = netsnmp_create_handler( 
  GenericOIDHandler, genericOidHandler );
 
 
  netsnmp_handler_registration* reg = 
  netsnmp_handler_registration_create(
  GenericHandler,
  handler, root_oid, OID_LENGTH(root_oid), 0 );
 
  netsnmp_register_handler( reg );
 
 
 
  /* Generic function which will be called for all OIDs below 
 the root 
  one registered above */ int genericOidHandler( netsnmp_mib_handler 
  *handler, netsnmp_handler_registration *reginfo, 
  netsnmp_agent_request_info *reqinfo, netsnmp_request_info 
 *requests ) 
  { int ret = SNMP_ERR_NOERROR;
 
  switch(reqinfo-mode) {
  case MODE_GET: /* Call some other code to process the 'requests' 
  argument */ ret = myData-getData( requests ); break; case 
  MODE_GETNEXT: /* Call some other code to process the 'requests' 
  argument */ ret =
  myData-getNextData( requests ); break; default:
  /* we should never get here in my code */ iRet = SNMP_ERR_GENERR; 
  break; } return ret; }
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  [EMAIL PROTECTED]
  Sent: 08 August 2007 06:51
  To: Mike Ayers
  Cc: net-snmp-users@lists.sourceforge.net
  Subject: RE: Newbie question: writing a simple agent
 
 
  Hello Mike,
 
 
  thanks for replying to my question.
 
  I understand that a standard approach is to register the 
 agent for a 
  range of OISs and to let the agent to be OID aware while the other 
  process should take care of the underlaying data.
 
  However, I was asked to write an agent that would NOT be 
 OID-aware. 
  All it would know it is responsible for a range of OIDs without 
  knowing any details. It would forward complete OIDs to the other 
  process that would take care about OID 
 disassembly/translation, data 
  manipulation etc.
 
  I am wondering if this is possible within the Net SNMP API, at all.
 
 
  If so, where should I start?
 
 
  Thanks.
 
 
  Milan
 
 
  On Tue, August 7, 2007 11:44 pm, Mike Ayers wrote:
 
 
 
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On 
 Behalf Of 
  [EMAIL PROTECTED]
 
 
 
 
  The agent itself will not be aware of individual OIDs and their 
  meaning. This will be done by the other process that also
  holds the
  actual data.
 
  This is a bit of a design problem as stated.  The (sub)agent is 
  responsible for managing its OID range, and therefore it is not 
  possible to have a subagent completely unaware of the OIDs.
  This does
 
  not, however, mean that the subagent needs to be aware of 
 the data 
  underlying the MIB.
 
  A common paradigm is to have the subagent register for 
 the range of 
  values (table, MIB, whatever) that it will manage, and 
 have the OP 
  (other
  process) manage the data within the range.  The agent does OID 
  assembly/disassembly (i.e. breaking OIDs into range part
  and specific
  part), possibly reformat the specific part to make it more 
  understandable

Newbie SNMP Design Question

2007-08-08 Thread Boby Paul
Hi Snmp gurus,

I am quite new to SNMP, for that matter net-SNMP, but I have worked with
many other socket based protocols. I have to work on a new project to do
the following functionalities. Please lead me how I can use net-SNMP for
that.

There are some components in network, which is going to generate some
kind SNMP traps/alarms. I have to collect these alarms/traps by my
APPLICATION (SNMP agent/manager??) and convert into some other
internal form (protocol) and send it into a legacy application. My
APPLICATION should have the capability to query the network components
too.

For that functionality can I make use of net-snmp? If not can you
suggest any other open source software? Am I making a SNMP manager or
agent? Can you please give me 1ft level design overview? I really
appreciate any helps to start rolling and thanks in advance.

Boby

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


Newbie problems at Snmptrapd

2007-08-08 Thread Romulo Pelicao de Farias
Hi, i am newbie using the net-snmp, but i was trying to put to work the 
snmptrapd, on windows.

 

I having 2 problems:

 

1)   always when I restart the service, the logfile are cleaned. I didn't 
find nothing on documentation that explains that.

2)   I didn't understand what I have to configure on groups. Why the 
documentation don't show any example, to give us one base to what we have to 
put on snmptrad.conf to it works? I simply put disableautenthication on and 
it works :-)

 

I only want it to works okay, to receive the traps.. And not find nothing on 
the web, telling me what I have to do to it works.

 

The authentication, I don't understand this fine... what I have to configure to 
it works fine, not including the disableauthentication.

 

Thanks for attencion

Rômulo

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


FW: Newbie SNMP Design Question

2007-08-08 Thread Boby Paul
I am sorry, I forgot to mention what systems I am working on. My target
system is Linux 2.6.9-42.0.10.EL. RHL.

Thanks
Boby

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Boby
Paul
Sent: Wednesday, August 08, 2007 10:16 AM
To: net-snmp-users@lists.sourceforge.net
Subject: Newbie SNMP Design Question

Hi Snmp gurus,

I am quite new to SNMP, for that matter net-SNMP, but I have worked with
many other socket based protocols. I have to work on a new project to do
the following functionalities. Please lead me how I can use net-SNMP for
that.

There are some components in network, which is going to generate some
kind SNMP traps/alarms. I have to collect these alarms/traps by my
APPLICATION (SNMP agent/manager??) and convert into some other
internal form (protocol) and send it into a legacy application. My
APPLICATION should have the capability to query the network components
too.

For that functionality can I make use of net-snmp? If not can you
suggest any other open source software? Am I making a SNMP manager or
agent? Can you please give me 1ft level design overview? I really
appreciate any helps to start rolling and thanks in advance.

Boby


-
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
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: 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
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: Newbie question: writing a simple agent

2007-08-07 Thread Mike Ayers

 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of [EMAIL PROTECTED]


 The agent itself will not be aware of individual OIDs and 
 their meaning.
 This will be done by the other process that also holds the 
 actual data.

This is a bit of a design problem as stated.  The (sub)agent is 
responsible for managing its OID range, and therefore it is not possible to 
have a subagent completely unaware of the OIDs.  This does not, however, mean 
that the subagent needs to be aware of the data underlying the MIB.

A common paradigm is to have the subagent register for the range of 
values (table, MIB, whatever) that it will manage, and have the OP (other 
process) manage the data within the range.  The agent does OID 
assembly/disassembly (i.e. breaking OIDs into range part and specific part), 
possibly reformat the specific part to make it more understandable to the OP 
(thus only the subagent need be MIB aware).  The OP returns the values for the 
requested data, then the subagent formats and assembles the response.


HTH,

Mike

-
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
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: Newbie question: writing a simple agent

2007-08-07 Thread Milan_Tvarozek
Hello Mike,

thanks for replying to my question.

I understand that a standard approach is to register the agent for a range
of OISs and to let the agent to be OID aware while the other process
should take care of the underlaying data.

However, I was asked to write an agent that would NOT be OID-aware. All it
would know it is responsible for a range of OIDs without knowing any
details. It would forward complete OIDs to the other process that would
take care about OID disassembly/translation, data manipulation etc.

I am wondering if this is possible within the Net SNMP API, at all.

If so, where should I start?

Thanks.

Milan

On Tue, August 7, 2007 11:44 pm, Mike Ayers wrote:


 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of [EMAIL PROTECTED]



 The agent itself will not be aware of individual OIDs and
 their meaning. This will be done by the other process that also holds the
  actual data.

 This is a bit of a design problem as stated.  The (sub)agent is
 responsible for managing its OID range, and therefore it is not possible
 to have a subagent completely unaware of the OIDs.  This does not,
 however, mean that the subagent needs to be aware of the data underlying
 the MIB.

 A common paradigm is to have the subagent register for the range of
 values (table, MIB, whatever) that it will manage, and have the OP (other
 process) manage the data within the range.  The agent does OID
 assembly/disassembly (i.e. breaking OIDs into range part and specific
 part), possibly reformat the specific part to make it more understandable
 to the OP (thus only the subagent need be MIB aware).  The OP returns the
 values for the requested data, then the subagent formats and assembles
 the response.


 HTH,


 Mike


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


Newbie configure issues

2007-04-02 Thread Malladi, Sasikanth
Hi All, I'm trying to compile the net-snmp packages for my solaris 8 box
and am running into multiple issues.

Here's my errors from config.log:


===
configure:4110: sparc-sun-solaris2.8-gcc -c -g -O2
-I/usr/local/ssl/include  conftest.c 5
conftest.c:2: error: syntax error before me
configure:4116: $? = 1
configure: failed program was:
| #ifndef __cplusplus
|   choke me
| #endif
configure:4254: checking how to run the C preprocessor
configure:4289: sparc-sun-solaris2.8-gcc -E -I/usr/local/ssl/include
conftest.c
configure:4295: $? = 0
configure:4327: sparc-sun-solaris2.8-gcc -E -I/usr/local/ssl/include
conftest.c
conftest.c:15:28: ac_nonexistent.h: No such file or directory
configure:4333: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME Net-SNMP
| #define PACKAGE_TARNAME net-snmp

===

What am I missing here? 

And here's my build command:
$configure --without-root-access --with-default-snmp-version=3
--enable-mfd-rewrites --with-mib-modules=ucd-snmp/diskio
--without-perl-modules --disable-embedded-perl
--with-persistent-directory=/var/opt/net-snmp
[EMAIL PROTECTED] 
--build=sparc-sun-solaris2.8 --host=sparc-sun-solaris2.8
--target=sparc-sun-solaris2.8 --with-logfile=/var/log/snmpd.log
--with-sys-location=Citigroup Data Center

There are more errors further down but if I fix this it might take care
of the others, so I'm taking them one at a time.

-
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: How to send a v1 trap (newbie)

2006-08-30 Thread Sebastian Bello
Thanks Dave!

Dave Shield escribió:
 On 28/08/06, Sebastian Bello [EMAIL PROTECTED] wrote:
 I have used the code in snmptrap to send a trap, but

 1- it doesn't use send_trap_vars nor send_easy_trap (just init_snmp,
 snmp_open, snmp_pdu_create, snmp_add_var and snmp_send); what's the
 difference between the two methods?

 'snmptrap' is a standalone application.
 It uses the basic SNMP library APIs to generate traps (and informs),
 with all of the necessary information (destination, version, admin
 settings) specified explicitly.

 'send_trap_vars' and 'send_easy_trap' are part of the *agent* API, and
 generate traps/informs using configuration info specified elsewhere
 (typically via the snmpd.conf file).


 2- it looks like libnetsnmp.so.10.0.1 is the only file needed to send
 the traps, is this right?

 Yes.

 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: How to send a v1 trap (newbie)

2006-08-29 Thread Dave Shield
On 28/08/06, Sebastian Bello [EMAIL PROTECTED] wrote:
 I have used the code in snmptrap to send a trap, but

 1- it doesn't use send_trap_vars nor send_easy_trap (just init_snmp,
 snmp_open, snmp_pdu_create, snmp_add_var and snmp_send); what's the
 difference between the two methods?

'snmptrap' is a standalone application.
It uses the basic SNMP library APIs to generate traps (and informs),
with all of the necessary information (destination, version, admin
settings) specified explicitly.

'send_trap_vars' and 'send_easy_trap' are part of the *agent* API, and
generate traps/informs using configuration info specified elsewhere
(typically via the snmpd.conf file).


 2- it looks like libnetsnmp.so.10.0.1 is the only file needed to send
 the traps, is this right?

Yes.

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


How to send a v1 trap (newbie)

2006-08-23 Thread Sebastian Bello
Hi list,

I want to send v1 traps from my C/C++ application using Net-SNMP. I've 
been reading the documentation but am a bit confused. Maybe someone can 
give me some hint:
- where can I find a simple code example on how to send a trap?
- do I need the full Net-SNMP installed?
- do I need to create a MIB with the traps information?

Thanks,
Sebastian-


-
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: newbie question

2006-08-05 Thread Dave Shield
[Please Cc: the mailing list on all messages.  Thanks]

On 05/08/06, Marius Banica [EMAIL PROTECTED] wrote:
 Cant upgrade this is built in system

Then you're probably out of luck.
The 5.0.x agent doesn't include support for generating linkUp/Down traps.
If you can't change the running code, then I'm not sure what else you can do.

Sorry.

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


newbie question

2006-08-03 Thread Marius Banica








Hello
I tried using the documentation but without success so I have a simple question




Iam
running net snmp 5.0.9



I
want to send snmptrap to a host when my link of the network interface goes down
and when it comes up



I
want to use snmptrap command



I
tried the syntax and using some help commands but without success



Can
some one point me to correct syntax and provide me something that works for me?



Thanks.








-
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: newbie question

2006-08-03 Thread Dave Shield
On 03/08/06, Marius Banica [EMAIL PROTECTED] wrote:
 I am running net snmp 5.0.9
 I want to send snmptrap to a host when my link of the network interface goes
 down and when it comes up

Step 1:  Upgrade to 5.3.1
Step 2:  Read the snmpd.conf(5) man page, under ACTIVE MONITORING
 In praticular, linkUpDownNotifications

Recent versions of the agent can handle this for you, automatically.

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: Newbie help

2006-06-19 Thread Thomas Anders
jaskaran singh wrote:
 Warning: no access control information configured.
 *This receiver will *NOT* accept any incoming notifications.
 *I don't understand why. I am including a copy of snmptrapd.conf file 
 too. Any direction towards a solution is appreciated.

Read the snmptrapd.conf(5) manual page on ACCESS CONTROL:

   http://www.net-snmp.org/docs/man/snmptrapd.conf.html


+Thomas

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


___
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: Newbie help

2006-06-19 Thread Sherry Chen
Hi,

I try the following command to log the result to a file:

snmpget -v 2c -c demopublic -Lf c:\adapters\log\log.txt test.net-snmp.org 
ucdDemoPublicString.0

The command was succeeded, in stead of log the result to the file, the 
result is showed in the standart output.?What is the exact command to log 
result to the file??Thanks advance for your help.

-Sherry



From: Thomas Anders [EMAIL PROTECTED]
To: net-snmp-users@lists.sourceforge.net
Subject: Re: Newbie help
Date: Mon, 19 Jun 2006 11:08:49 +0200

jaskaran singh wrote:
  Warning: no access control information configured.
  *This receiver will *NOT* accept any incoming notifications.
  *I don't understand why. I am including a copy of snmptrapd.conf file
  too. Any direction towards a solution is appreciated.

Read the snmptrapd.conf(5) manual page on ACCESS CONTROL:

http://www.net-snmp.org/docs/man/snmptrapd.conf.html


+Thomas

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


___
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




___
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


Newbie help

2006-06-18 Thread jaskaran singh
I am trying to catch snmptrap sent by a host to this box. When i test 
the config file using the -Dread_config option i get this message.
No log handling enabled - turning on stderr logging
registered debug token read_config, 1
read_config: reading premib configuration tokens
read_config:  config path used for 
snmptrapd:/usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp://.snmp 
(persistent path:/var/net-snmp)
read_config: Reading configuration /usr/local/etc/snmp/snmptrapd.conf
read_config: /usr/local/etc/snmp/snmptrapd.conf:17 examining: format2  
%02.2h:%02.2j TRAP%w .%q from %A
read_config: /usr/local/etc/snmp/snmptrapd.conf:37 examining: traphandle 
CGatePro-MIB::numEnqueuerMessages 
/usr/local/nagios/libexec/handle-CGATE-trap 10
read_config: /usr/local/etc/snmp/snmptrapd.conf:38 examining: traphandle 
CGatePro-MIB::smtpInputTrafficIn 
/usr/local/nagios/libexec/handle-CGATE-trap 1
read_config: /usr/local/etc/snmp/snmptrapd.conf:50 examining: 
ignoreauthfailure  false
read_config: /usr/local/etc/snmp/snmptrapd.conf:65 examining: pidfile  
/var/net-snmp/snmptrapd-pid
read_config: /usr/local/etc/snmp/snmptrapd.conf:68 examining: 
trapcommunity stalker
read_config: /usr/local/etc/snmp/snmptrapd.local.conf: No such file or 
directoryread_config: /usr/local/share/snmp/snmptrapd.conf: No such file 
or directory
read_config: /usr/local/share/snmp/snmptrapd.local.conf: No such file or 
directory
read_config: /usr/local/lib/snmp/snmptrapd.conf: No such file or directory
read_config: /usr/local/lib/snmp/snmptrapd.local.conf: No such file or 
directoryread_config: //.snmp/snmptrapd.conf: No such file or directory
read_config: //.snmp/snmptrapd.local.conf: No such file or directory
read_config:  config path used for snmptrapd:/var/net-snmp (persistent 
path:/var/net-snmp)
read_config: Reading configuration /var/net-snmp/snmptrapd.conf
read_config: /var/net-snmp/snmptrapd.conf:32 examining: engineBoots 2
read_config: /var/net-snmp/snmptrapd.conf:33 examining: oldEngineID 
0x80001f888046d18252448dd5b6
read_config: Found a parser.  Calling it: oldEngineID / 
0x80001f888046d18252448dd5b6
read_config: /var/net-snmp/snmptrapd.local.conf: No such file or directory
read_config:  config path used for 
agentx:/usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp://.snmp 
(persistent path:/var/net-snmp)
read_config: /usr/local/etc/snmp/agentx.conf: No such file or directory
read_config: /usr/local/etc/snmp/agentx.local.conf: No such file or 
directory
read_config: /usr/local/share/snmp/agentx.conf: No such file or directory
read_config: /usr/local/share/snmp/agentx.local.conf: No such file or 
directory
read_config: /usr/local/lib/snmp/agentx.conf: No such file or directory
read_config: /usr/local/lib/snmp/agentx.local.conf: No such file or 
directory
read_config: //.snmp/agentx.conf: No such file or directory
read_config: //.snmp/agentx.local.conf: No such file or directory
read_config:  config path used for agentx:/var/net-snmp (persistent 
path:/var/net-snmp)
read_config: /var/net-snmp/agentx.conf: No such file or directory
read_config: /var/net-snmp/agentx.local.conf: No such file or directory
read_config:  config path used for 
snmp:/usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp://.snmp 
(persistent path:/var/net-snmp)
read_config: Reading configuration /usr/local/etc/snmp/snmp.conf
read_config: /usr/local/etc/snmp/snmp.conf:19 examining: defVersion 2c
read_config: /usr/local/etc/snmp/snmp.conf:20 examining: defversion  2c
read_config: /usr/local/etc/snmp/snmp.conf:28 examining: defCommunity 
communigate
read_config: /usr/local/etc/snmp/snmp.conf:40 examining: dodebugging  0
read_config: Found a parser.  Calling it: dodebugging / 0
Warning: no access control information configured.
*This receiver will *NOT* accept any incoming notifications.
*I don't understand why. I am including a copy of snmptrapd.conf file 
too. Any direction towards a solution is appreciated.
Thanks

config file snmptrapd.conf
###
#
# snmptrapd.conf
#
#   - created by the snmpconf configuration program
#
###
# SECTION: Output formatting for traps received.
#
#   Output from snmptrapd is formatted according to the
#   rules defined by the formatting configuration directives.

# format2: How SNMPv2 and SNMPv3 traps are formatted.
#   See the snmptrapd.conf manual page for format string details.
#   arguments: formatstring

format2  %02.2h:%02.2j TRAP%w .%q from %A



###
# SECTION: Trap Handlers
#
#   Here we define what programs are run when a trap is
#   received by the trap receiver.

# traphandle: When traps are received, a program can be run.
#   When traps are received, the list of configured trap
#   handles is consulted and any configured program is run.
#   If no handler is found, any handler 

SWITCH MAC port security (newbie)

2006-06-09 Thread Peter Huncar
Hello

I'm trying to write an application to configure AT-8326GB switches on my 
network to enable/disable MAC addresses on ports via SNMP. I'm new to 
SNMP and net-snmp. I have the MIB file, but I don't know if I'm able to 
set port security and assign MAC addresses using shell commands like 
snmpset for example and how.

Can you help me or direct me to any documentation / faq / howto please?

Thank you

Peter Huncar


___
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


net-snmp newbie needs help

2006-03-08 Thread Dana Heath

Greetings!

I am BRAND new to the whole net-snmp thing, so please bear with me... 
I'm looking for some basic guidance.


I've run configure, make, and make install with the following successful 
result (as far as I can tell):


-
   Net-SNMP configuration summary:
-

 Net-SNMP Version:   5.1.4.0.1
 Building for:   linux
 Network transport support:  Callback Unix TCP UDP
 SNMPv3 Security Modules:usm
 Agent MIB code: mibII ucd_snmp snmpv3mibs notification 
target agent_mibs agentx utilities

 SNMP Perl modules:  disabled
 Embedded perl support:  disabled
 Authentication support: MD5 SHA1
 Encryption support: DES AES

-


However, after launching the snmpd process and verifying that it is 
running (as shown below)


[EMAIL PROTECTED] sbin]# ps aux | grep snmpd
root 32317  3.0  0.2  7056 2584 ?S10:14   0:00 ./snmpd
root 32319  0.0  0.0  3508  372 pts/4D10:14   0:00 grep snmpd


I cannot get a response from the snmp daemon (again, shown below)

[EMAIL PROTECTED] net-snmp-5.1.4.pre1]$ snmpwalk -v 1 localhost -c public system
Timeout: No Response from localhost


If, however, I launch /usr/bin/snmpd from my distribution, it runs 
successfully as shown:


[EMAIL PROTECTED] net-snmp-5.1.4.pre1]$ snmpwalk -v 1 localhost -c public system
SNMPv2-MIB::sysDescr.0 = STRING: Linux pegasus 2.4.20-8smp #1 SMP Thu 
Mar 13 17:45:54 EST 2003 i686

SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (957) 0:00:09.57
SNMPv2-MIB::sysContact.0 = STRING: Root [EMAIL PROTECTED] (configure 
/etc/snmp/snmp.local.conf)

SNMPv2-MIB::sysName.0 = STRING: pegasus


Can anyone steer me in the right direction? Thanks,

Dana Heath




---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=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: net-snmp newbie needs help

2006-03-08 Thread kanda.samy
Title: RE: net-snmp newbie needs help






Hi,

 See the /var/log/snmpd.log. I hope you are missing the snmpd.conf file. If so run snmpconf i g basic_setup. Refer ./snmpd h and snmpconf h for more details. If you have snmpd.conf file in some other directory ( not in /usr/local/share/snmp/snmpd.con ) use c option to give the conf file path ( run ./snmpd c conf-file with full path)

Kanda

 

--__--__--

Message: 2

Date: Wed, 08 Mar 2006 10:28:23 -0800

From: Dana Heath [EMAIL PROTECTED]

To: net-snmp-users@lists.sourceforge.net

Subject: net-snmp newbie needs help

Greetings!

I am BRAND new to the whole net-snmp thing, so please bear with me... 

I'm looking for some basic guidance.

I've run configure, make, and make install with the following successful result (as far as I can tell):

-

 Net-SNMP configuration summary:

-



 Net-SNMP Version: 5.1.4.0.1

 Building for: linux

 Network transport support: Callback Unix TCP UDP

 SNMPv3 Security Modules: usm

 Agent MIB code: mibII ucd_snmp snmpv3mibs notification 

target agent_mibs agentx utilities

 SNMP Perl modules: disabled

 Embedded perl support: disabled

 Authentication support: MD5 SHA1

 Encryption support: DES AES



-



However, after launching the snmpd process and verifying that it is running (as shown below)

[EMAIL PROTECTED] sbin]# ps aux | grep snmpd

root 32317 3.0 0.2 7056 2584 ? S 10:14 0:00 ./snmpd

root 32319 0.0 0.0 3508 372 pts/4 D 10:14 0:00 grep snmpd


I cannot get a response from the snmp daemon (again, shown below)

[EMAIL PROTECTED] net-snmp-5.1.4.pre1]$ snmpwalk -v 1 localhost -c public system

Timeout: No Response from localhost


If, however, I launch /usr/bin/snmpd from my distribution, it runs successfully as shown:

[EMAIL PROTECTED] net-snmp-5.1.4.pre1]$ snmpwalk -v 1 localhost -c public system SNMPv2-MIB::sysDescr.0 = STRING: Linux pegasus 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 SNMPv2-MIB::sysUpTime.0 = Timeticks: (957) 0:00:09.57 SNMPv2-MIB::sysContact.0 = STRING: Root [EMAIL PROTECTED] (configure

/etc/snmp/snmp.local.conf)

SNMPv2-MIB::sysName.0 = STRING: pegasus


Can anyone steer me in the right direction? Thanks,

Dana Heath


--__--__--







Re: snmp newbie -- linksys log trap

2006-02-06 Thread Wes Hardaker
 On Thu, 02 Feb 2006 03:28:54 +, jburke [EMAIL PROTECTED] said:

jburke I've tried some basic settings for trapping some log sent from my 
jburke linksys befsr41 4-port router which is sending some kinda snmp port 
jburke 162 messages-- but dam I wanna but I cantta?

You need to use the snmptrapd application to receive traps, not the
snmpd application which is a different beast.

-- 
Wes Hardaker
Sparta, Inc.


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=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


snmp newbie -- linksys log trap

2006-02-01 Thread jburke
I've tried some basic settings for trapping some log sent from my 
linksys befsr41 4-port router which is sending some kinda snmp port 
162 messages-- but dam I wanna but I cantta? I'm sorry for being so 
dumb in this, but what terms should I look into and make necessary 
changes to, as in configuration directives, in order for me to catch 
the log from my router on my debian machine?

the build i'm using was revealed using 'snmpd -v'

NET-SNMP version:  5.2.1.2
Web:   http://www.net-snmp.org/
Email: net-snmp-coders@lists.sourceforge.net

(my debian I have looked into /etc/default/snmpd and have set  TRAPDRUN=yes)
if this is debianess, ok ok.. if there's the vanilla way of setting 
things out, I'd like to hear it, because tcpdump with the primitive 
port 162 does show activity, and I know it's really just one or two 
configuration thingies I'm not getting, like a 'pub' 'communitiy' 
name I keep picking up in the docs.. What one or two things should I 
look into just for this? I've searched the mailing list but I only 
get 3 linksys results with no answers. I know some kind of agent is 
supposed to be triggered, but I'm not sure if I'm suppose to be 
calling this other daemon up beforehand (I'm i supposed to 
invoke-rc.d anything other than snmpd, /var/log/snmptrapd.conf won't 
show up in lsof unless I invoke snmptrapd -- and the snmptrapd daemon 
was made to work with snmpd--) All I know is that I have to make some 
kind of mouse-trap ://


I look on the homepage site but there's a pending-state for the 
tutorial i want-- so I'm out of luck.. If I can get just one or two 
links to hint further I should do, I really don't mind at all rtfming 
a little more, I know I'm close on the track though.


thanks for any feedback, greatly appreciated..

jagginess

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=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: newbie question about fileTable

2006-01-11 Thread Dave Shield
On Tue, 2006-01-10 at 11:00 +0100, MelAngeT wrote:

 What mean the fileSize.1 = 4 ?

How large is the file /usr/local/mySoft/logs ?
My guess is that it's probably about 4K


 Is there a way to monitor a directory ?

No.
Files must be listed explicitly.

But it's an idea - I've logged this as a Feature
Request  (#1402767)

Dave


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
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: Re: newbie question about fileTable

2006-01-11 Thread MelAngeT
On Tue, 2006-01-10 at 11:00 +0100, MelAngeT wrote:
  What mean the fileSize.1 = 4 ?

 How large is the file /usr/local/mySoft/logs ?
 My guess is that it's probably about 4K

Actualy it's a directory .
and yes ls -ds /usr/local/mySoft/logs return 
  4 /usr/local/mySoft/logs

so the size is 4096

  Is there a way to monitor a directory ?

 No.
 Files must be listed explicitly.

 But it's an idea - I've logged this as a Feature
 Request  (#1402767)

That's great, thank you !


 Dave






___ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs 
exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
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


Newbie: Problem in installing Perl Module (Net SNMP 5.2.1.2)

2005-11-10 Thread namit gupta
Hi Everybody!!
I am new to SNMP  Linux, please help as I am stuck in this problem for a while
I am using Fedora Core 3 (Linux 2.6.9-1.667)\
net-snmp-libs-5.1.2-11 is installed using RPM
I have installed Net-SNMP 5.2.1.2 compiling from the source code (as root), Steps that I had taken for this was:
Step 1) In root/source folder/./configure (using all default choices)
 No Errors
Step 2) In root/source folder/make
 Got Errors: 

if-mib/data_access/interface_common.c: In function
`netsnmp_access_interface_entry_get_by_name':

if-mib/data_access/interface_common.c:248: warning: assignment discards
qualifiers from pointer target type

if-mib/data_access/interface_common.c: In function
`_access_interface_entry_save_name':

if-mib/data_access/interface_common.c:400: warning: passing arg 2 of
`se_find_value_in_slist' discards qualifiers from pointer target type
 make[1]: [mib2c.conf.5] Error 1 (ignored)
 I Ignored the Errors
Step 3) In root/source folder/make test
 Got Errors
 make[1]: [mib2c.conf.5] Error 1 (ignored)
 Tests Skipped:
 24:testing snmpv1 traps are sent by snmpd API...SKIPPED
 25:testing snmpv2c traps are sent by snmpd API...SKIPPED
 26:testing
snmpv1 traps are sent by snmpd without notification mib
support...SKIPPED
  27:testing
snmpv2c traps are sent by snmpd without notification mib
support...SKIPPED
 33:testing AgentX trap sending support...SKIPPED
 43:testing 1st CPU on Solaris using HOST-RESOURCES...SKIPPED
 44:testing
initial load device on Solaris using HOST-RESOURCES...SKIPPED
 45:testing uptime using HOST-RESOURCES...SKIPPED
 46:testing swap on Solaris using HOST-RESOURCES...SKIPPED  
 Summary: 49 / 49 succeeded
Step 4) In root/source folder/make install
 Got Errors

 make[1]: [mib2c.conf.5] Error 1 (ignored)
Step 5) Made basic Agent configuration file (snmpd.conf) using snmpconf -g basic_setup command
  copied it to /usr/local/shar/snmp

snmpd (agent) seems to work fine 
snmpget, snmpset, adding of MIBs, snmptranslate etc..

But attemting to install Perl Module:
In perl Directory :
perl Makeperl.PL
Output:
Checking if your kit is complete...
Looks good
Writing Makefile for NetSNMP::default_store
Checking if your kit is complete...
Looks good
Writing Makefile for NetSNMP::ASN
Checking if your kit is complete...
Looks good
Writing Makefile for NetSNMP::OID
Checking if your kit is complete...
Looks good
Writing Makefile for NetSNMP::agent::default_store
Writing Makefile for NetSNMP::agent
Checking if your kit is complete...
Looks good
Writing Makefile for SNMP
Checking if your kit is complete...
Looks good
Warning: prerequisite NetSNMP::OID 5.1 not found.
Writing Makefile for NetSNMP::TrapReceiver
Writing Makefile for Bundle::NetSNMP

Warning is thrown up and if I go ahead errors are again thrown up :-(  mib2c is not working
Where things have gone wrong?? I have tried to install with every possible configure options:
./configure --enable-shared --with-perl-module
./configure --with-perl-module
But no combination seems to have worked...I don't know what to do?? I want to use mib2c

Second problem occured when:
After uninstalling Net SNMP 5.2.1.2 (make uninstall) I installed Net SNMP 5.1.3.1
if I follow the same steps as above (it doen not give the Error: make[1]: [mib2c.conf.5] Error 1 (ignored) in any step),
While installing Perl Module also:
Step 1) Executing (in perl folder/perl Makefile.PL) it gives no
Errors such as Warning: prerequisite NetSNMP::OID 5.1 not found.
 which it had given in Net SNMP 5.2.1.2
Step 2) make And make install commands also do not give any errors
But when I execute mib2c, it gives errors:
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
...
Cannot find module (SNMPv2-TM): At line 0 in (none)
But the Agent snmpd (agent) seems to work fine: 

snmpget, snmpset, adding of MIBs, snmptranslate etc..

Mibs are strored in /usr/local/share/snmp/mibs
Why mib2c is not able to find all the MIBs??

Please can anybody help me!!!

Thanks in anticipation
Namit












Re: Newbie MIB question.

2005-11-09 Thread Robert Story
On Mon, 17 Oct 2005 09:53:34 -0400 Ben wrote:
BZ So, my question is along the lines of: Do I need to run mib2c and then
BZ create my own interface code to read / set wireless paramters based on
BZ the MIB

yes, exactly.

-- 
NOTE: messages sent directly to me, instead of the lists, will be deleted
  unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie
Support: http://www.net-snmp.org/ irc://irc.freenode.net/#net-snmp  
Archive: http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users

You are lost in a twisty maze of little standards, all different. 


---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.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


Newbie MIB question.

2005-10-17 Thread Ben Z
Hi all;

I've been sifting through old posts and Google searches since sometime
last Wednesday trying to find an answer to my question. Maybe someone
here can help me?

I'm trying to setup a wireless test network. I would like to to be able
to manage and query my network nodes via SNMP for the purpose of
collecting results and logging them easily. I know that there are other
methods by which this can be accomplished, but it has been asked of me
to perform the tests in this way.

I have found a MIB (I'm not sure if there are any other 'default' MIBs
that accomplish the same and that are already in the net-snmp MIB-base)
called IEEE802dot11-MIB . As far as what I've been reading, some posts
online tell me that all I need to do is to change the .mib extension
to .txt and put it in the net-snmp MIB-path. I have done this, and I
have also started my daemon with the specific MIB passed as an option
(-m +IEEE802dot11-MIB), but fail to get any results from an snmpwalk
or snmpget requests. (snmpwalk -v 2c -c public localhost ieee802dot11
ieee802dot11: Unknown Object Identifier (Sub-id not found: (top) -
ieee802dot11))

So, my question is along the lines of: Do I need to run mib2c and then
create my own interface code to read / set wireless paramters based on
the MIB, or can the MIB itself just be added to the library path without
modification (I can post the MIB contents for clarification if need-be).
I should ask, just to be safe, does net-snmp by default already provide
some wireless-related information?


Thank you all!


Ben Z



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


newbie question

2005-08-16 Thread Paul Hurt
Hi there,

   I have used MIB2C to create a table that I want to
give the user access to create new rows on it.  My MIB
deffinition looks like:
myTableEntry OBJECT-TYPE
SYNTAX myTableEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
A connection entry in the table describing its
characteristics.
INDEX {
myTableFromSide,
myTableFromIndex,
myTableToSide,
myTableToIndex
  }
::= { myTable 1 }

myTableEntry ::=
SEQUENCE {
myTableFromSide
INTEGER,
myTableFromIndex
INTEGER,
myTableToSide
INTEGER,
myTableToIndex
INTEGER,
myTableAnotherIndex
INTEGER,
myTableMode
INTEGER,
myTableName
DisplayString,
myTableStatus
RowStatus
}

myTableFromSide OBJECT-TYPE
SYNTAX INTEGER  { network (1), user (2), test
(3) }
ACCESS read-create
STATUS mandatory
DESCRIPTION
Stuff 1
::= { myTableEntry 1 }

myTableFromIndex OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-create
STATUS mandatory
DESCRIPTION
stuff 2.
::= { myTableEntry 2 }
Yada yada yada

Mib2c handles the definition just fine.  But when I
call snmpset to create a new row:
snmpset -m all -v 1 -c adc -d localhost
myTableFromIndex.1.1.1.1 i 1
I get the following error:
Error in packet.
Reason: (noSuchName) There is no such variable name in
this MIB.


Stepping through my agent, I get into the
object_lookup function, and that calls:
netsnmp_request_set_error_all(requests,
SNMP_ERR_NOCREATION); 
after getting a null from calling
netsnmp_container_table_row_extract

Since I am trying to create a row, I am thinking I am
doing something wrong, but I can't figure out what it
is?  Can anyone help?

Thanks,
Paul Hurt




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


---
SF.Net email is Sponsored by the Better Software Conference  EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile  Plan-Driven Development * Managing Projects  Teams * Testing  QA
Security * Process Improvement  Measurement * http://www.sqe.com/bsce5sf
___
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: newbie question

2005-08-16 Thread Robert Story
On Tue, 16 Aug 2005 09:01:55 -0700 (PDT) Paul wrote:
PHI have used MIB2C to create a table that I want to
PH give the user access to create new rows on it.
PH [...]
PH 
PH Stepping through my agent, I get into the
PH object_lookup function, and that calls:
PH netsnmp_request_set_error_all(requests,
PH SNMP_ERR_NOCREATION); 
PH after getting a null from calling
PH netsnmp_container_table_row_extract
PH 
PH Since I am trying to create a row, I am thinking I am
PH doing something wrong, but I can't figure out what it
PH is?  Can anyone help?

What release are you using? I assume 5.2.1, since it looks like you are using
the mfd conf file.

Did you specify that you wanted to allow row-creating when you ran mib2c? If
not, save your old code and re-run mib2c, making sure to enable row creation.

-- 
NOTE: messages sent directly to me, instead of the lists, will be deleted
  unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie
Support: http://www.net-snmp.org/ irc://irc.freenode.net/#net-snmp  
Archive: http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users

You are lost in a twisty maze of little standards, all different. 


---
SF.Net email is Sponsored by the Better Software Conference  EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile  Plan-Driven Development * Managing Projects  Teams * Testing  QA
Security * Process Improvement  Measurement * http://www.sqe.com/bsce5sf
___
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: newbie question

2005-08-16 Thread Paul Hurt
Hi Robert!

Again thank you for your earlyer response, and you can
ignore my other questions.  People like me are why
they (you?) create README's and FAQs.  :)

Thanks again, you pointed me in the right direction.

Paul Hurt

--- Robert Story [EMAIL PROTECTED] wrote:

 On Tue, 16 Aug 2005 09:01:55 -0700 (PDT) Paul wrote:
 PHI have used MIB2C to create a table that I
 want to
 PH give the user access to create new rows on it.
 PH [...]
 PH 
 PH Stepping through my agent, I get into the
 PH object_lookup function, and that calls:
 PH netsnmp_request_set_error_all(requests,
 PH SNMP_ERR_NOCREATION); 
 PH after getting a null from calling
 PH netsnmp_container_table_row_extract
 PH 
 PH Since I am trying to create a row, I am thinking
 I am
 PH doing something wrong, but I can't figure out
 what it
 PH is?  Can anyone help?
 
 What release are you using? I assume 5.2.1, since it
 looks like you are using
 the mfd conf file.
 
 Did you specify that you wanted to allow
 row-creating when you ran mib2c? If
 not, save your old code and re-run mib2c, making
 sure to enable row creation.
 
 -- 
 NOTE: messages sent directly to me, instead of the
 lists, will be deleted
   unless they are requests for paid consulting
 services.
 
 Robert Story; NET-SNMP Junkie
 Support: http://www.net-snmp.org/
 irc://irc.freenode.net/#net-snmp  
 Archive:

http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users
 
 You are lost in a twisty maze of little standards,
 all different. 
 





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


---
SF.Net email is Sponsored by the Better Software Conference  EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile  Plan-Driven Development * Managing Projects  Teams * Testing  QA
Security * Process Improvement  Measurement * http://www.sqe.com/bsce5sf
___
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


SNMP newbie question: sysUpTime

2005-06-24 Thread Jeetendra Singh





As per RFC 1907, sysUpTime is defined as ""The time (in
hundredths of a second) since the network management portion of the
system was last re-initialized." My questions are:
1. What is meant by "network management portion" in this context?
2. If I have 
 - a managed resource(for ex: device's port status), 
 - a subagent (which is monitoring that port), and
 - an agentX master agent
Whose uptime will be displayed in SNMPv2 traps sent to manager? Will it
be port's uptime, subagent's uptime or the master agent's uptime?
3. Is sysUpTime redundant in case of SNMPv2 traps, if the trap
definition itself has a "*LastChange" as a trap parameter? Since, the
"*LastChange" parameter is normally defined as "The
value of sysUpTime at the time of the most recent change in state of
*", it seems the mandatory varbind "sysUpTime" and "*LastChange" values
will always be similar in the trap?

The question does not have direct reference to net-snmp, but I thought
somebody on this list can help me.
TIA,
Jeetendra





---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477_id=16492=click
___
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: SNMP newbie question: sysUpTime

2005-06-24 Thread Dave Shield
On Fri, 2005-06-24 at 09:39, Jeetendra Singh wrote:
 1. What is meant by network management portion in this context?

The SNMP agent

 2. If I have 
 -a managed resource(for ex: device's port status), 
 -a subagent (which is monitoring that port), and
 -an agentX master agent
 Whose uptime will be displayed in SNMPv2 traps sent to manager?

The master agent.



 3. Is sysUpTime redundant in case of SNMPv2 traps, if the trap
 definition itself has a *LastChange as a trap parameter? Since, the
 *LastChange parameter is normally defined as The value of sysUpTime
 at the time of the most recent change in state of *, it seems the
 mandatory varbind sysUpTime and *LastChange values will always be
 similar in the trap?

Not necessarily.
The LastChange value will be the value of sysUpTime when X changed.
The sysUpTime value is the value of sysUpTime when the trap is sent.

If the trap is sent immediately after X changes (probably as a result
of this change), then the two values will be basically the same - yes.
But if the trap is sent some time later (as a result of some other
event), then the two values may well be different.


Dave



---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
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   >