LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-25-2012, 04:56 AM   #1
pendrive
Member
 
Registered: Mar 2011
Posts: 51
Blog Entries: 1

Rep: Reputation: 2
Angry Problem in making snmp to work in ubuntu


Hi
I've installed snmp in a ubuntu server 10.04 machine with

apt-get install snmpd snmp command and the snmpd --version gives me

NET-SNMP version: 5.4.2.1

after modifying the /ext/default/snmpd and remove 127.0.0.1 ,
In the default configuration of /etc/snmp/snmpd.conf :

Code:
###############################################################################
#
# EXAMPLE.conf:
#   An example configuration file for configuring the ucd-snmp snmpd agent.
#
###############################################################################
#
# This file is intended to only be an example.  If, however, you want
# to use it, it should be placed in /etc/snmp/snmpd.conf.
# When the snmpd agent starts up, this is where it will look for it.
#
# You might be interested in generating your own snmpd.conf file using
# the "snmpconf" program (perl script) instead.  It's a nice menu
# based interface to writing well commented configuration files.  Try it!
#
# Note: This file is automatically generated from EXAMPLE.conf.def.
# Do NOT read the EXAMPLE.conf.def file! Instead, after you have run
# configure & make, and then make sure you read the EXAMPLE.conf file
# instead, as it will tailor itself to your configuration.

# All lines beginning with a '#' are comments and are intended for you
# to read.  All other lines are configuration commands for the agent.

#
# PLEASE: read the snmpd.conf(5) manual page as well!
#


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

# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
# KNOWN AT YOUR SITE.  YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.

# 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 as well.
#
# The following lines change the access permissions of the agent so
# that the COMMUNITY string provides read-only access to your entire
# NETWORK (EG: 10.10.10.0/24), and read/write access to only the
# localhost (127.0.0.1, not its real ipaddress).
#
# For more information, read the FAQ as well as the snmpd.conf(5)
# manual page.

####
# First, map the community name (COMMUNITY) into a security name
# (local and mynetwork, depending on where the request is coming
# from):

#       sec.name  source          community
com2sec paranoid  default         public
#com2sec readonly  default         public
#com2sec readwrite default         private

####
# Second, map the security names into group names:

#             	sec.model  sec.name
group MyROSystem v1        paranoid
group MyROSystem v2c       paranoid
group MyROSystem usm       paranoid
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
group MyRWGroup v1         readwrite
group MyRWGroup v2c        readwrite
group MyRWGroup usm        readwrite

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

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

####
# 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       noauth    exact  system none   none
access MyROGroup ""      any       noauth    exact  all    none   none
access MyRWGroup ""      any       noauth    exact  all    all    none

# -----------------------------------------------------------------------------


###############################################################################
# System contact information
#

# It is also possible to set the sysContact and sysLocation system
# variables through the snmpd.conf file.  **PLEASE NOTE** that setting
# the value of these objects here makes these objects READ-ONLY
# (regardless of any access control settings).  Any attempt to set the
# value of an object whose value is given here will fail with an error
# status of notWritable.

syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)

# Example output of snmpwalk:
#   % snmpwalk -v 1 -c public localhost system
#   system.sysDescr.0 = "SunOS name sun4c"
#   system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
#   system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
#   system.sysContact.0 = "Me <me@somewhere.org>"
#   system.sysName.0 = "name"
#   system.sysLocation.0 = "Right here, right now."
#   system.sysServices.0 = 72


# -----------------------------------------------------------------------------


###############################################################################
# Process checks.
#
#  The following are examples of how to use the agent to check for
#  processes running on the host.  The syntax looks something like:
#
#  proc NAME [MAX=0] [MIN=0]
#
#  NAME:  the name of the process to check for.  It must match
#         exactly (ie, http will not find httpd processes).
#  MAX:   the maximum number allowed to be running.  Defaults to 0.
#  MIN:   the minimum number to be running.  Defaults to 0.

#
#  Examples:
#

#  Make sure mountd is running
#proc mountd

#  Make sure there are no more than 4 ntalkds running, but 0 is ok too.
#proc ntalkd 4

#  Make sure at least one sendmail, but less than or equal to 10 are running.
#proc sendmail 10 1

proc snmpd

#  A snmpwalk of the prTable would look something like this:
# 
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.2
# enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
# enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
# enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
# enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
# enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
# enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
# enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
# enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
# enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
# enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
# enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
# enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
# enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
# enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
# enterprises.ucdavis.procTable.prEntry.prCount.3 = 1
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0
# enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0
# enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running."
# enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = ""
# enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = ""
# enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0
# enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0
# enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0
#
#  Note that the errorFlag for mountd is set to 1 because one is not
#  running (in this case an rpc.mountd is, but thats not good enough),
#  and the ErrMessage tells you what's wrong.  The configuration
#  imposed in the snmpd.conf file is also shown.  
# 
#  Special Case:  When the min and max numbers are both 0, it assumes
#  you want a max of infinity and a min of 1.
#


# -----------------------------------------------------------------------------


###############################################################################
# Executables/scripts
#

#
#  You can also have programs run by the agent that return a single
#  line of output and an exit code.  Here are two examples.
#
#  exec NAME PROGRAM [ARGS ...]
#
#  NAME:     A generic name.
#  PROGRAM:  The program to run.  Include the path!
#  ARGS:     optional arguments to be passed to the program

# a simple hello world
#exec echotest /bin/echo hello world

# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note:  this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do.  Uncomment to use it.
#
#exec shelltest /bin/sh /tmp/shtest

# Then, 
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8
# enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
# enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2
# enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"
# enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest"
# enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world"
# enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
# enterprises.ucdavis.extTable.extEntry.extResult.2 = 35
# enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."
# enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world."
# enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
# enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0

# Note that the second line of the /tmp/shtest shell script is cut
# off.  Also note that the exit status of 35 was returned.

# -----------------------------------------------------------------------------


###############################################################################
# disk checks
#

# The agent can check the amount of available disk space, and make
# sure it is above a set limit.  

# disk PATH [MIN=DEFDISKMINIMUMSPACE]
#
# PATH:  mount path to the disk in question.
# MIN:   Disks with space below this value will have the Mib's errorFlag set.
#        Default value = DEFDISKMINIMUMSPACE.

# Check the / partition and make sure it contains at least 10 megs.

#disk / 10000

# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9
# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0
# enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F 
# enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0"
# enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000
# enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130
# enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325
# enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092
# enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58
# enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0
# enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = ""

# -----------------------------------------------------------------------------


###############################################################################
# load average checks
#

# load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE]
#
# 1MAX:   If the 1 minute load average is above this limit at query
#         time, the errorFlag will be set.
# 5MAX:   Similar, but for 5 min average.
# 15MAX:  Similar, but for 15 min average.

# Check for loads:
#load 12 14 14

# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.10
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1"
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5"
# enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15"
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39 
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31 
# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36 
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00"
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00"
# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00"
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0
# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = ""
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = ""
# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = ""

# -----------------------------------------------------------------------------


###############################################################################
# Extensible sections.
# 

# This alleviates the multiple line output problem found in the
# previous executable mib by placing each mib in its own mib table:

# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note:  this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do.  Uncomment to use it.
#
 exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /opt/shtest

# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
# enterprises.ucdavis.50.1.1 = 1
# enterprises.ucdavis.50.2.1 = "shelltest"
# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.50.100.1 = 35
# enterprises.ucdavis.50.101.1 = "hello world."
# enterprises.ucdavis.50.101.2 = "hi there."
# enterprises.ucdavis.50.102.1 = 0

# Now the Output has grown to two lines, and we can see the 'hi
# there.' output as the second line from our shell script.
#
# Note that you must alter the mib.txt file to be correct if you want
# the .50.* outputs above to change to reasonable text descriptions.

# Other ideas:
# 
 exec .1.3.6.1.4.1.2021.51 ps /bin/ps 
# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq

# -----------------------------------------------------------------------------


###############################################################################
# Pass through control.
# 

# Usage:
#   pass MIBOID EXEC-COMMAND
#
# This will pass total control of the mib underneath the MIBOID
# portion of the mib to the EXEC-COMMAND.  
#
# Note:  You'll have to change the path of the passtest script to your
# source directory or install it in the given location.
# 
# Example:  (see the script for details)
#           (commented out here since it requires that you place the
#           script in the right location. (its not installed by default))

# pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/passtest

# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255
# enterprises.ucdavis.255.1 = "life the universe and everything"
# enterprises.ucdavis.255.2.1 = 42
# enterprises.ucdavis.255.2.2 = OID: 42.42.42
# enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42
# enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1
# enterprises.ucdavis.255.5 = 42
# enterprises.ucdavis.255.6 = Gauge: 42
#
# % snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.255.5
# enterprises.ucdavis.255.5 = 42
#
# % snmpset -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1 s "New string"
# enterprises.ucdavis.255.1 = "New string"
#

# For specific usage information, see the man/snmpd.conf.5 manual page
# as well as the local/passtest script used in the above example.

###############################################################################
# Subagent control
#

# The agent can support subagents using a number of extension mechanisms.
# From the 4.2.1 release, AgentX support is being compiled in by default.
# To use this mechanism, simply uncomment the following directive.
#
#  master  agentx
#
#   Please see the file README.agentx for more details.
#


###############################################################################
# Further Information
#
#  See the snmpd.conf manual page, and the output of "snmpd -H".
#  MUCH more can be done with the snmpd.conf than is shown as an
#  example here.
and then with this command from client

snmpwalk -v 1 -c public Server_IP .1.3.6.1.4.1.2021.50

attemted to get informations of exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /opt/shtest

but it just gives me:

Code:
End of MIB
then I tried the

Code:
snmpwalk -v 1 -c public Server_IP .1.3.6.1.4.1.2021.2
for getting process information and also it gives me

Code:
End of MIB
and also for every thing I do there is nothing...

then I changed the snmpd.conf to a snmp v3 configuration that it worked for me about a year ago

here it is:

Code:
agentuser  root
agentgroup root

#################################
#SNMPv3 Configuration
	engineID "324546576"
################################

###############################
#Access Control
	#SNMPv3 Users
		createUser comme     MD5 "12345678" DES
	
		rwuser comme auth  .1.3.6.1.2.1.1
 
##############################
#VACM Configuration

proc    snmpd    1  1

# OID => .1.3.6.1.4.1.2021.2
# enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
# enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
# enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
# enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
# enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
# enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
# enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
# enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
# enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
# enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
# enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
# enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
# enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
# enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
# enterprises.ucdavis.procTable.prEntry.prCount.3 = 1




#Disk Usage Monitoring

	#The state of disk storage can be monitored using:
	includeAllDisks 10%
	disk /var 20%
	disk /usr  3%
	#  Keep 100 Mb free for crash dumps
	disk /mnt/crash  100000

#System Load Monitoring

	#A simple check for an overloaded system might be:
	#load 10
	#A more refined check (to allow brief periods of heavy use, but recognise sustained medium-heavy load) might be:
	load 30 10 5
#Log File Monitoring

	#TODO
	#file FILE [MAXSIZE]
	#logmatch NAME PATH CYCLETIME REGEX



#Extending Agent Functionality
####test1#################################################################
	#extend .1.3.6.1.2.2014.40 TEST /bin/bash /home/pendrive/snmp.sh
##########################################################################
####test2##############################################################################################################
	#extend .1.3.6.1.2.2014.40.1 iplist /bin/bash /home/pendrive/snmp_test/iptables_traffic_iplist.sh -g
	#extend .1.3.6.1.2.2014.40.2 ipindex /bin/bash /home/pendrive/snmp_test/iptables_traffic_iplist.sh -i
	#extend .1.3.6.1.2.2014.40.3 traffic_in /bin/bash /home/pendrive/snmp_test/snmp_ips/iptables_traffic_eval.sh in
	#extend .1.3.6.1.2.2014.40.4 traffic_out /bin/bash /home/pendrive/snmp_test/iptables_traffic_eval.sh out
#######################################################################################################################
exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /opt/shtest
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
# enterprises.ucdavis.50.1.1 = 1
# enterprises.ucdavis.50.2.1 = "shelltest"
# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.50.100.1 = 35
# enterprises.ucdavis.50.101.1 = "hello world."
# enterprises.ucdavis.50.101.2 = "hi there."
# enterprises.ucdavis.50.102.1 = 0


exec .1.3.6.1.4.1.2021.51 ps /bin/ps
and I attempt to do

Code:
snmpwalk -v 3 -u comme -A 12345678 -a MD5 -l authNoPriv server_ip .1.3.6.1.4.1.2021.51
it gives me:

Code:
UCD-SNMP-MIB::ucdavis.51 = No more variables left in this MIB View (It is past the end of the MIB tree)
and for every OID I test, it gives me the same,

What do I suppose to do now? please help

Last edited by pendrive; 07-28-2012 at 04:07 PM.
 
Old 07-25-2012, 05:09 AM   #2
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Rep: Reputation: 79
Did you try snmpwalk -v1 -c public Server_IP alone?
and seen if you have a result?
 
Old 07-28-2012, 04:08 PM   #3
pendrive
Member
 
Registered: Mar 2011
Posts: 51

Original Poster
Blog Entries: 1

Rep: Reputation: 2
thanks for the reply

yes I did and it gives me End of MIB
 
Old 08-03-2012, 08:50 AM   #4
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Rep: Reputation: 79
Did you have a look at this?
http://net-snmp.sourceforge.net/docs...sometimes_not_

This might give you a clue.

Angel.
 
Old 08-05-2012, 04:19 PM   #5
pendrive
Member
 
Registered: Mar 2011
Posts: 51

Original Poster
Blog Entries: 1

Rep: Reputation: 2
thank you Angel, it sounds great. I'll check it out
 
Old 08-05-2012, 04:37 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
On the 10.04 host:
Code:
snmpwalk localhost -c public -v1
do you get an End of MIB message?
 
Old 08-09-2012, 04:20 PM   #7
pendrive
Member
 
Registered: Mar 2011
Posts: 51

Original Poster
Blog Entries: 1

Rep: Reputation: 2
thank you habitual for the reply.

No i don't

here is the output:

Code:
root@srv:~# snmpwalk -v 1 -c public localhost
SNMPv2-MIB::sysDescr.0 = STRING: Linux srv.test.com 2.6.32-21-generic-pae #32-Ubuntu SMP Fri Apr 16 09:39:35 UTC 2010 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (13461) 0:02:14.61
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
SNMPv2-MIB::sysName.0 = STRING: srv.test.com
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (configure /etc/snmp/snmpd.local.conf)
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
End of MIB
After reading the FAQ page Angel presented, here is my works on it:

I stopped the agent and started again the server with this command:

Code:
snmpd -f -Le -d
and it started with no error.

after that I putted

Code:
extend .1.3.6.1.4.1.2021.51 ps /bin/ps
entry in the snmpd.conf and then issued this:

Code:
# snmpget -m ALL -v1 -c public localhost .1.3.6.1.4.1.2021.51
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ucdavis.51
as you can see it gives me "There is no such variable name in this MIB" by the snmpget

for the

Code:
# snmpget -m ALL -v1 -c public localhost .1.3.6.1.4.1.2021
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ucdavis
the same appears.
but for this one it works

Code:
snmpget -m ALL -v1 -c public localhost SNMPv2-MIB::sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux srv6374.screweb.com 2.6.32-21-generic-pae #32-Ubuntu SMP Fri Apr 16 09:39:35 UTC 2010 i686
It seems there are some MIB parsing probems here.

the problem is I need snmp to monitor the IP addresses connecting to my server to a specified port and the traffics coming and going from also specified port. So I need to make snmp run my custom scripts and don't want to fall into creating custom mib . . .

here is the lists of my mibs

Code:
# ls /usr/share/snmp/mibs
AGENTX-MIB.txt			     IF-INVERTED-STACK-MIB.txt	NET-SNMP-EXAMPLES-MIB.txt  SNMP-COMMUNITY-MIB.txt	SNMPv2-TC.txt
DISMAN-EVENT-MIB.txt		     IF-MIB.txt			NET-SNMP-EXTEND-MIB.txt    SNMP-FRAMEWORK-MIB.txt	SNMPv2-TM.txt
DISMAN-SCHEDULE-MIB.txt		     INET-ADDRESS-MIB.txt	NET-SNMP-MIB.txt	   SNMP-MPD-MIB.txt		SNMP-VIEW-BASED-ACM-MIB.txt
DISMAN-SCRIPT-MIB.txt		     IP-FORWARD-MIB.txt		NET-SNMP-TC.txt		   SNMP-NOTIFICATION-MIB.txt	TCP-MIB.txt
EtherLike-MIB.txt		     IP-MIB.txt			NET-SNMP-VACM-MIB.txt	   SNMP-PROXY-MIB.txt		TRANSPORT-ADDRESS-MIB.txt
HCNUM-TC.txt			     IPV6-ICMP-MIB.txt		NOTIFICATION-LOG-MIB.txt   SNMP-TARGET-MIB.txt		UCD-DEMO-MIB.txt
HOST-RESOURCES-MIB.txt		     IPV6-MIB.txt		RFC1155-SMI.txt		   SNMP-USER-BASED-SM-MIB.txt	UCD-DISKIO-MIB.txt
HOST-RESOURCES-TYPES.txt	     IPV6-TCP-MIB.txt		RFC1213-MIB.txt		   SNMP-USM-AES-MIB.txt		UCD-DLMOD-MIB.txt
IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt  IPV6-TC.txt		RFC-1215.txt		   SNMP-USM-DH-OBJECTS-MIB.txt	UCD-IPFWACC-MIB.txt
IANAifType-MIB.txt		     IPV6-UDP-MIB.txt		RMON-MIB.txt		   SNMPv2-CONF.txt		UCD-SNMP-MIB.txt
IANA-LANGUAGE-MIB.txt		     LM-SENSORS-MIB.txt		SCTP-MIB.txt		   SNMPv2-MIB.txt		UDP-MIB.txt
IANA-RTPROTO-MIB.txt		     NET-SNMP-AGENT-MIB.txt	SMUX-MIB.txt		   SNMPv2-SMI.txt
I don't know what to do . . .
 
Old 08-10-2012, 06:19 AM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Pendrive:

What OS/ver is the target that gives you the End of MIB message?

Thank you,

N/M : generic-pae #32-Ubuntu SMP
 
Old 08-10-2012, 07:32 AM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Sorry, I have trouble connecting with my cheat notes this morning...

I "think" you may be able to correct the EoMIB message using
Code:
sudo apt-get install snmp-mibs-downloader
on the target. Someone here may have more info re: installing that, or not...

Also your last last post held a wealth of information about the host's setup re: snmp and file locations, these .conf file should be looked at.

Specifically, "...sysContact...and syslocation" values in /etc/snmp/snmpd.local.conf" but on one of my AWS hosts, I have no .local.conf but I do have a /root/snmpd.conf and a walk of the localhost does give me "some" of those values I have manipulated in /root/snmpd.conf.

NOTE: You need to pay attention to these values in snmpd.conf (these came from my /root/snmpd.conf)

Try these in a /root/snmpd.conf
Code:
rouser  secret  
rwuser  secret  
rocommunity  secret  
rwcommunity  secret  
syscontact  pendrive
syslocation  Area51
and restart snmpd and then
Code:
snmpwalk -v 1 -c secret localhost
or
Code:
snmpwalk -v 2c -c secret localhost
I gathered most of this from these resources:
http://www.zabbix.com/wiki/howto/monitor/snmp/snmp
http://wiki.centos.org/HowTos/Cacti_...8Statistics%29
http://forums.cacti.net/post-200186.html
http://www.debuntu.org/how-to-monito...snmp-and-cacti
http://wiki.xdroop.com/space/snmp/Sa...+for+cacti+use
http://www.cyberciti.biz/faq/linux-u...ss-interfaces/
http://wiki.xdroop.com/space/snmp/net-snmp
http://forums.ayksolutions.com/showthread.php?t=425
http://www.net-snmp.org/tutorial/tut...mon/snmpd.html
http://forums.cacti.net/viewtopic.php?t=15353
http://www.net-snmp.org/docs/FAQ.htm..._in_snmp_conf_
http://www.nwsmith.net/HintsTips/net-snmp-tutorial.htm
http://www.net-snmp.org/docs/man/snmpd.conf.html
http://silverwraith.com/papers/freebsd-snmp.php
http://www.opennms.org/wiki/SNMP_Reports_How-To
http://www.zabbix.com/forum/showthre...=5152#post5152
http://www.debianadmin.com/linux-snm...tatistics.html
http://www.eric-a-hall.com/software/...etsnmp-memory/
https://aaronwalrath.wordpress.com/2...nmp-and-cacti/
http://man.flashnux.com/en/centos/5/...pd.conf.5.html
http://h30097.www3.hp.com/docs/base_...8/0382____.HTM
http://www.net-snmp.org/logo.html

Sorry, if that's not too helpful but my notes are for machines we had or reconfigured since we last used snmp to collect data (We use Zabbix now, not Cacti)
 
1 members found this post helpful.
Old 08-15-2012, 01:45 AM   #10
pendrive
Member
 
Registered: Mar 2011
Posts: 51

Original Poster
Blog Entries: 1

Rep: Reputation: 2
it's solved. thank you Habitual. actually because I was going to implement snmpv3, I forgot to add ro and rw community entries. and you right pointed them. I'm saying it again. really thanks. and I of course don't forget to hit thank you button
 
Old 08-15-2012, 09:09 AM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Glad it worked out!

Last edited by Habitual; 08-17-2012 at 10:58 AM.
 
  


Reply

Tags
snmp, snmpd, snmpwalk



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a Netgear WNA3100 adapter work with Ubuntu 12 Basilios Ubuntu 5 06-10-2012 01:56 PM
Making a realtek ALC850 sound chipset work under ubuntu 6.06 Lordandmaker Linux - Newbie 2 02-18-2007 11:29 PM
I have a problem making TightVNC work zener Linux - Networking 2 11-10-2006 09:42 AM
LXer: Making wireless work in Ubuntu LXer Syndicated Linux News 0 09-13-2006 05:54 AM
Problem Making ATM work dc740 Linux - Networking 0 04-04-2006 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration