Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 15, 2010, 02:08 PM   #1
Spike099
macrumors regular
 
Join Date: Feb 2007
Location: Canada
SNMP ifSpeed

Hey Guys,

I'm not all that familiar with SNMP. However I know it can be used to get the current bandwidth utilization using "ifSpeed".

First off, I'm not certain how to obtain the MIB tree. snmpwalk returns the following:

Code:
> snmpwalk -v1 -c public localhost
SNMPv2-MIB::sysContact.0 = STRING: Administrator <postmaster@example.com>
End of MIB
This doesn't look right does it? Is my MIB incomplete?

When I start SNMP I get some config errors. However its the default config!

Code:
> snmpd -L
Couldn't find a table entry for the model name MacBook5,1
Sensor Data Collection not supported
Error opening specified endpoint ""
Server Exiting with code 1
I've been playing with the config file, this is what it looks like now.

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

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

rouser public auth

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

rocommunity public localhost/32

###############################################################################
# Access Control
###############################################################################

# As shipped, the snmpd demon will only respond to queries on the
# system mib group until this file is replaced or modified for
# security purposes. Examples are shown below about how to increase the
# level of access.

# By far, the most common question I get about the agent is "why won't
# it work?", when really it should be "how do I configure the agent to
# allow me to access it?"
#
# By default, the agent responds to the "public" community for read
# only access, if run out of the box without any configuration file in 
# place. The following examples show you other ways of configuring
# the agent so that you can change the community names, and give
# yourself write access to the mib tree as well.
#
# For more information, read the FAQ as well as the snmpd.conf(5)
# manual page.

####
# First, map the community name "public" into a "security name"

# sec.name source community
# com2sec notConfigUser	default public

com2sec notConfigUser	localhost/32 public

####
# Second, map the security name into a group name:

# groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser

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

# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1

####
# Finally, grant the group read-only access to the systemview view.

# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact systemview none none

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

# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string

syslocation work

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

syscontact test@test.com
I'm running OS X 10.6.4.

Any help would be greatly appreciated, thanks!
__________________
MacBook 4GBRam 320GBHDD
iMac 20" 4GBRam 1TBHDD
iPhone 16GB
Cocoa Developer
Spike099 is offline   0 Reply With Quote
Old Nov 15, 2010, 02:27 PM   #2
Spike099
Thread Starter
macrumors regular
 
Join Date: Feb 2007
Location: Canada
Og I got it!

Ok, I solved it.

I changed back to the default config and made the following changes

from
com2sec local localhost COMMUNITY
to
com2sec local localhost public

from
rocommunity public default .1.3.6.1.2.1.1.4
to
#rocommunity public default .1.3.6.1.2.1.1.4

I should change this as it's probably a security issue that i am opening the public to view all snmp info. But at the moment I just want to see the list.
__________________
MacBook 4GBRam 320GBHDD
iMac 20" 4GBRam 1TBHDD
iPhone 16GB
Cocoa Developer
Spike099 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Time Capsule and SNMP - not working, but SNMP is enabled digitalformula Mac Peripherals 0 Mar 24, 2011 03:54 AM
App to monitor snmp bandwidth data from router Ack Mac OS X Server, Xserve, and Networking 0 Oct 12, 2009 11:48 AM
Does the iPhone support SNMP? christall109 iPhone/iPad Programming 2 Jun 25, 2009 03:53 PM
SNMP on 10.3.9 server besadmin Mac OS X Server, Xserve, and Networking 0 Jun 19, 2008 11:38 AM
SNMP Monitoring software recommendations? nitz Mac Applications and Mac App Store 0 Mar 20, 2007 05:05 AM


All times are GMT -5. The time now is 06:40 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC