Net-snmp configuration
1) configure snmpd.conf
[jac@freehpc ~]$ sudo snmpconf -ig basic_setup
************************************************
*** Beginning basic system information setup ***
************************************************
Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y):
Configuring: syslocation
Description:
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
The location of the system: Edina MN
Finished Output: syslocation "Edina MN"
Configuring: syscontact
Description:
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
The contact information: Administrator <admin@sjack.eu>
Finished Output: syscontact "Administrator <admin@sjack.eu>"
Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y): n
**************************************
*** BEGINNING ACCESS CONTROL SETUP ***
**************************************
Do you want to configure the agent's access control? (default = y):
Do you want to allow SNMPv3 read-write user based access (default = y):
Configuring: rwuser
Description:
a SNMPv3 read-write user
arguments: user [noauth|auth|priv] [restriction_oid]
The SNMPv3 user that should have read-write access: <USERNAME>
The minimum security level required for that user [noauth|auth|priv, default = auth]:
The OID that this community should be restricted to [if appropriate]:
Finished Output: rwuser <USERNAME>
Do another rwuser line? (default = y): n
Do you want to allow SNMPv3 read-only user based access (default = y):
Configuring: rouser
Description:
a SNMPv3 read-only user
arguments: user [noauth|auth|priv] [restriction_oid]
Enter the SNMPv3 user that should have read-only access to the system: <USERNAME>
The minimum security level required for that user [noauth|auth|priv, default = auth]:
The OID that this community should be restricted to [if appropriate]:
Finished Output: rouser <USERNAME>
Do another rouser line? (default = y): n
Do you want to allow SNMPv1/v2c read-write community access (default = y): n
Do you want to allow SNMPv1/v2c read-only community access (default = y): y
Configuring: rocommunity
Description:
a SNMPv1/SNMPv2c read-only access community name
arguments: community [default|hostname|network/bits] [oid]
The community name to add read-only access for: <COMMUNITYNAME>
The hostname or network address to accept this community name from [RETURN for all]: 10.0.0.0/24
The OID that this community should be restricted to [RETURN for no-restriction]:
Finished Output: rocommunity <COMMUNITYNAME> 10.0.0.0/24
Do another rocommunity line? (default = y): n
****************************************
*** Beginning trap destination setup ***
****************************************
Do you want to configure where and if the agent will send traps? (default = y): n
****************************************
*** Beginning monitoring setup ***
****************************************
Do you want to configure the agent's ability to monitor various aspects of your system? (default = y):
Do you want to configure the agents ability to monitor processes? (default = y): y
Configuring: proc
Description:
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.
Name of the process you want to check on: afpd
Maximum number of processes named 'afpd' that should be running [default = 0]: 5
Minimum number of processes named 'afpd' that should be running [default = 0]: 1
Finished Output: proc afpd 5 1
Do another proc line? (default = y): y
Configuring: proc
Description:
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.
Name of the process you want to check on: smbd
Maximum number of processes named 'smbd' that should be running [default = 0]: 5
Minimum number of processes named 'smbd' that should be running [default = 0]: 1
Finished Output: proc smbd 1 5
Do another proc line? (default = y):
Configuring: proc
Description:
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.
Name of the process you want to check on: sshd
Maximum number of processes named 'sshd' that should be running [default = 0]: 5
Minimum number of processes named 'sshd' that should be running [default = 0]: 0
Finished Output: proc sshd 5 0
Do another proc line? (default = y): n
Do you want to configure the agents ability to monitor disk space? (default = y):
Configuring: disk
Description:
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
Enter the mount point for the disk partion to be checked on: /
Enter the minimum amount of space that should be available on /:
Finished Output: disk /
Do another disk line? (default = y): n
Do you want to configure the agents ability to monitor load average? (default = y):
Configuring: load
Description:
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
Enter the maximum allowable value for the 1 minute load average: 15
Enter the maximum allowable value for the 5 minute load average: 12
Enter the maximum allowable value for the 15 minute load average: 8
Finished Output: load 15 12 8
Do another load line? (default = y): n
Do you want to configure the agents ability to monitor file sizes? (default = y): n
The following files were created:
/usr/local/shared/snmp/snmpd.conf
2) Copy snmpd.conf to the right place [jac@freehpc ~]$ sudo cp ./snmpd.conf /usr/local/share/snmp/snmpd.conf 3) Add snmpd to /etc/rc.conf [jac@freehpc ~]$ sudo vim /etc/rc.conf add line: snmpd_enable="YES" 5) Create Users <link to create users> 4) Start snap [jac@freehpc ~]$ sudo service snmpd start Starting snmpd. [jac@freehpc ~]$