Enabling the SNMP Daemon on NorthStar Controller
The SNMP daemon (SNMPD) responds to SNMP request packets. This section describes and provides examples for enabling and running SNMPD on the NorthStar Controller. SNMPD is useful if you prefer to monitor the NorthStar server using your own monitoring system.
The following net-SNMP man page is a good resource for additional information and configuration help:
Perform the steps that follow to enable SNMPD on the NorthStar server. Run all commands in this procedure as the root user on the NorthStar server.
- Juniper Networks provides a sample
snmpd.conf
file in the NorthStar build in the following directory:/opt/northstar/utils/examples/snmpd.conf
Copy the sample file to your local
/usr/share/snmp/
directory. - Modify the
/usr/share/snmp/snmpd.conf
file to include your company’s settings. - Start the service:#service snmpd start
- Configure the service to turn on in the event of a reboot:#chkconfig snmpd on
- Confirm that your server is listening on port 161 (default
snmpd):#netstat -na | grep 161
- Wait five minutes for trap collection, then check your
SNMP collection device or host.
The sample
snmpd.conf
file included with the NorthStar build sends the following traps by default:Physical location
Contact information
Running processes (the supervisord process has been predefined)
Mounted filesystems (/ and /home have been pre-established)
System load on the machine, including memory and CPU
The trap2sink line in the sample configuration file tells the host the address of the traps receiver.
Sample snmpd.conf
file
included with the NorthStar build:
# snmpd.conf # # - created by the snmpconf configuration program # ########################################################################### # 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 Unknown (edit /etc/snmp/snmpd.conf) syslocation Bridgewater # 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 Root <root@localhost> (configure /etc/snmp/snmp.local.conf) syscontact “John Doe” syscontact "John Doe" # sysservices: The proper value for the sysServices object. # arguments: sysservices_number sysservices 78 ########################################################################### # SECTION: Extending the Agent # # You can extend the snmp agent to have it return information # that you yourself define. # pass_persist: Run a persistant process that intepretes the request for an entire tree. # The pass program defined here will get called for all # requests below a certain point in the mib tree. It is then # responsible for returning the right data beyond that point. # The pass_persist scripts must be able to stay running and accept input # from stdin. # # arguments: miboid program # # example: pass_persist .1.3.6.1.4.1.2021.255 /path/to/local/pass_persisttest # # See the snmpd.conf manual page for further information. pass_persist # dlmod: dynamically extend the agent using a shared-object # arguments: module-name module-path dlmod ########################################################################### # 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. # The following line will be monitoring the supervisord process. proc /opt/northstar/thirdparty/python/bin/supervisord 1 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 integer value (units of kB) or a percentage followed by the % # symbol. Default value = 100000. # # The results are reported in the dskTable section of the UCD-SNMP-MIB tree # The following will monitor the root and home filesystems. disk / disk /home # 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 5 5 5 # 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_kilobytes] # # 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 ########################################################################### # 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 northstar # rocommunity: a SNMPv1/SNMPv2c read-only access community name # arguments: community [default|hostname|network/bits] [oid] rocommunity northstar ########################################################################## # SECTION: Trap Destinations # # Here we define who the agent will send traps to. # trap2sink: A SNMPv2c trap receiver # arguments: host [community] [portnum] trap2sink 192.168.1.161 # # Unknown directives read in from other files by snmpconf # com2sec notConfigUser default public group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser view systemview included .1.3.6.1.2.1.1 view systemview included .1.3.6.1.2.1.25.1.1 access notConfigGroup "" any noauth exact systemview none none dontLogTCPWrappersConnects yes