The /etc/snmp/snmpd.conf file on the Mac lab machines needs to be modified as follows:

Note: There might not be an snmpd.conf file on the machine and so it is presented here in its entirety.

###########################################################################
#
# snmpd.conf
#
#   - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Trap Destinations
#
#   Here we define who the agent will send traps to.

# trapcommunity: Default trap sink community to use
#   arguments: community-string

trapcommunity  UofW

# authtrapenable: Should we send traps when authentication failures occur
#   arguments: 1 | 2   (1 = yes, 2 = no)

authtrapenable  2



###########################################################################
# 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  "School of Computer Science, University of Wateloo"

# 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  "csi-snmp@cscf.cs.uwaterloo.ca"

# sysservices: The proper value for the sysServices object.
#   arguments:  sysservices_number

sysservices 76



###########################################################################
# SECTION: Access Control Setup
#
#   This section defines who is allowed to talk to your running
#   snmp agent
# rwuser: a SNMPv3 read-write user
#   arguments:  user [noauth|auth|priv] [restriction_oid]

#rwuser  cscfadm  

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

#rouser  UofW  

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

rocommunity  "UofW" 129.97.0.0/16 
rocommunity  "UofW" 172.16.0.0/12 
rocommunity  "UofW" 10.0.0.0/8 
rocommunity  "UofW" 127.0.0.1

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


###########################################################################
# SECTION: Monitor Various Aspects of the Running Host
#
#   The following check up on various aspects of a host.

# proc: Check for processes that should be running.
#     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.
#   
#   The results are reported in the prTable section of the UCD-SNMP-MIB tree
#   Special Case:  When the min and max numbers are both 0, it assumes
#   you want a max of infinity and a min of 1.


# disk: Check for disk space usage of a partition.
#   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.
#           Can be a raw byte value or a percentage followed by the %
#           symbol.  Default value = 100000.
#   
#   The results are reported in the dskTable section of the UCD-SNMP-MIB tree

disk  "/" MIN=5%


# load: Check for unreasonable load average values.
#   Watch the load average levels on the machine.
#   
#    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.
#   
#   The results are reported in the laTable section of the UCD-SNMP-MIB tree

load  20 15 10

# file: Check on the size of a file.
#   Display a files size statistics.
#   If it grows to be too large, report an error about it.
#   
#    file /path/to/file [maxsize_in_bytes]
#   
#      if maxsize is not specified, assume only size reporting is needed.
#   
#   The results are reported in the fileTable section of the UCD-SNMP-MIB tree

file  /var/log/system.log 1000000 

Also, /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist needs to be modified with the following:

\f0\fs24 \cf0 <?xml version="1.0" encoding="UTF-8"?>\ 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\ 
<plist version="1.0">\ 
<dict>\ 
    <key>Disabled</key>\ 
    <false/>
    <key>Label</key>\ 
    <string>org.net-snmp.snmpd</string>\ 
    <key>OnDemand</key>\ 
    <false/>\ 
    <key>Program</key>\ 
    <string>/usr/sbin/snmpd</string>\ 
    <key>ProgramArguments</key>\ 
    <array>\ 
        <string>snmpd</string>\ 
        <string>-f</string>\ 
    </array>\ 
    <key>RunAtLoad</key>
    <true/>\ 
    <key>ServiceIPC</key>\ 
    <false/>\ 
</dict>\ 
</plist>\ 

Currently the plist as shipped in base Mac OS X image is as follows:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
        <key>Disabled</key> 
        <true/> 
        <key>Label</key> 
        <string>org.net-snmp.snmpd</string> 
        <key>OnDemand</key> 
        <false/> 
        <key>Program</key> 
        <string>/usr/sbin/snmpd</string> 
        <key>ProgramArguments</key> 
        <array> 
                <string>snmpd</string> 
                <string>-f</string> 
        </array> 
        <key>ServiceIPC</key> 
        <false/> 
</dict> 
</plist>
Initially the "Disabled" key is true and needs to be false (in order to run i.e. you want to enable it to run) and I included a "RunAtLoad" key (where RunAtLoad is equivalent to the "launchctl load -w" command).

-- EdwardChrzanowski - 2014-10-27

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2014-11-06 - BillInce
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback