Bug 58959 - If you add the "disk" option to the /etc/snmp/snmpd.conf file The daemon refuses to start
If you add the "disk" option to the /etc/snmp/snmpd.conf file The daemon refu...
Status: CLOSED DUPLICATE of bug 55840
Product: Red Hat Linux
Classification: Retired
Component: ucd-snmp (Show other bugs)
7.2
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-01-28 12:12 EST by Josi Vicente Nzqez Zuleta
Modified: 2015-03-04 20:10 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-02-24 23:58:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Josi Vicente Nzqez Zuleta 2002-01-28 12:12:02 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011019
Netscape6/6.2

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Here is a sample snmpd.conf file. Just uncomment the "disk" section and the
daemon will refuse to load (doesn happens if the line is commented out):

###############################################################################
#
# snmpd.conf:
#   Newbreak LLC SNMP daemon configuration for Linux Redhat 6.2, 7.2 machines
#   Jose Vicente Nunez Zuleta (josevnz@newbreak.com)
#   Newbreak LLC System Administrator
#
#   Version history:
#   0.1 - 01/27/2002 - Alpha version
#
#   Resources:
#   ACL visual map: http://net-snmp.sourceforge.net/tutorial/demon/vacm/
#   snmpd.conf(5) manual page
#   Net-SNMP FAQ: http://net-snmp.sourceforge.net/FAQ.html
###############################################################################

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

# For now we use this wrapper aorund the RFC 2275 com2sec View Based Access Control
# Mode (vacm). I easier to set up and if we need to change that we will
(josevnz@newbreak.com).
# - Give access to all the root-node(.).iso(1).org(3).dod(6).internet(1) subtree:
rocommunity xxxxx 10.1.20.0/24 .1.3.6.1
rwcommunity yyyyy 10.1.20.0/24 .1.3.6.1

# First, map the community name "public" into a "security name"
#       sec.name  source          community
#com2sec notConfigUser  default    dev-newbreak
####
# 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:
#       name           incl/excl     subtree         mask(optional)
#view    systemview     included      system
####
# 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


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

# It is also possible to set the sysContact and sysLocation system
# variables through the snmpd.conf file:

syslocation Newbreak LLC, 500 Summer Street. Suite 303
syscontact josevnz@newbreak.com

# Example output of snmpwalk:
#   % snmpwalk -v 1 localhost public 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 (commented out by default):
#

#  Make sure mountd is running
#proc mountd

proc ypbind 10 1
proc sshd2 5 1
proc gpm 1 1
proc xfs 1 1
proc portmap 1 1
proc syslogd 1 1
proc ntpd 1 1
proc crond 1 1
proc rpc.statd 1 1
proc automount 10 3

#  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

#  A snmpwalk of the process mib tree would look something like this:
# 
# % snmpwalk -v 1 localhost public .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 localhost public .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 <---- BUG, not WORKING!!!! --->
#

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

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

#disk / 10%
#disk /export/home 20%
#disk /usr/local 15%

# Uncomment this to reproduce the BUG
#disk / 10

# % snmpwalk -v 1 localhost public .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=12.0] [5MAX=12.0] [15MAX=12.0]
#
# 1MAX:   If the 1 minute load average is above this limit at query
#         time, the errorFlag will be set.
# 5MAX:   Similar, but for 5 min average.
# 15MAX:  Similar, but for 15 min average.

# Check for loads:
#load 12 14 14

load 6 8 8

# % snmpwalk -v 1 localhost public .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 = ""

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

# Capture and "trap" authentication errors
authtrapenable 1
# Define the trap default comunity string
trapcommunity d3v-n3wbr34k-tr4p
# Send the notifications to this hosts. You can add multiple lines
trapsink loghost.dev.newbreak.bogus
trap2sink loghost.dev.newbreak.bogus
informsink loghost.dev.newbreak.bogus

###############################################################################
# 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 /tmp/shtest

# % snmpwalk -v 1 localhost public .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

exec .1.3.6.1.4.1.2021.50 df /bin/df -k
exec .1.3.6.1.4.1.2021.51 ps /bin/ps -ef
exec .1.3.6.1.4.1.2021.52 top /usr/bin/top b n 1
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/local/passtest

# % snmpwalk -v 1 localhost public .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 localhost public .1.3.6.1.4.1.2021.255.5
# enterprises.ucdavis.255.5 = 42
#
# % snmpset -v 1 localhost public .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.

###############################################################################
# Further Information
#
#  See the snmpd.conf manual page, and the output of "snmpd -H".





Actual Results:  The daemon doesn start

Expected Results:  The daemon should load. I tested this with older version of
the daemon

Additional info:

This is the output of the daemon with the following flags: -L -a -D -f

trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:89 Parsing: proc ypbind 10 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  ypbind(10) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:90 Parsing: proc sshd2 5 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  sshd2 (5) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:91 Parsing: proc gpm 1 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  gpm (1) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:92 Parsing: proc xfs 1 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  xfs (1) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:93 Parsing: proc portmap 1 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  portmap (1) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:94 Parsing: proc syslogd 1 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  syslogd (1) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:95 Parsing: proc ntpd 1 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  ntpd (1) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:96 Parsing: proc crond 1 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  crond (1) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:97 Parsing: proc rpc.statd 1 1
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  rpc.statd (1) (1)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:98 Parsing: proc automount 10 3
trace: proc_parse_config(): ucd-snmp/proc.c, 195
ucd-snmp/proc: Read:  automount (10) (3)
trace: read_config(): read_config.c, 402
read_config: /etc/snmp/snmpd.conf:216 Parsing: disk / 10
                                                           [FAILED]
Comment 1 Phil Knirsch 2002-01-29 09:56:03 EST
The latest version (4.2.3) is available via rawhide now. This should fix this
problem.

Thanks,

Read ya, Phil
Comment 2 Mark Cornick 2002-02-12 18:17:53 EST
This problem reoccurs in ucd-snmp-4.2.3-1.7.2.3 released today with exactly the
same behaviour.
Comment 3 Need Real Name 2002-02-13 07:59:03 EST
Seems snmpd crashed while reading the /etc/mtab (setmntent fails)

/usr/include/ucd-snmp/ucd-snmp-config.h:
...
#define ETC_MNTTAB "unknown"
...
Comment 4 kevin_myer 2002-02-13 10:43:06 EST
"The latest version (4.2.3) is available via rawhide now. This should fix this
problem." 

Because you tested this version against this specific bug or just because this
is a new version or... ????  There were three bugs filed for this, my original
bug, 55538, as well as 57464 and this one.  Methinks quality control slipped on
this one....

For what its worth, I recompiled the RPM on two system and disabled
--enable-reentrant and the problem goes away.  I'm not sure what the
implications of disabling reentrancy are but doing so lets me get disk stats
again so....
Comment 5 Brian Brock 2002-02-13 11:13:20 EST
Verified in ucd-snmp-4.2.3-1.7.2.3.
Comment 6 Brian Brock 2002-02-13 11:27:49 EST
(I verified that the bug still exists, just to be clear.)
Comment 7 Wil Cooley 2002-02-24 23:58:35 EST
Will this bug be fixed as an errata for 7.2, or will it only be fixed in Rawhide?
Comment 8 Phil Knirsch 2002-03-07 10:23:20 EST

*** This bug has been marked as a duplicate of 55840 ***

Note You need to log in before you can comment on or make changes to this bug.