Net-snmp configuration: Difference between revisions

From wiki
Jump to navigation Jump to search
imported>Jacob
mNo edit summary
imported>Jacob
mNo edit summary
Line 20: Line 20:
     the variable.
     the variable.
     arguments:  location_string
     arguments:  location_string
  The location of the system: Edina MN
  The location of the system: '''Hawthorn Woods IL'''
  Finished Output: syslocation  "Edina MN"
  Finished Output: syslocation  "Hawthorn Woods IL"
  Configuring: syscontact
  Configuring: syscontact
  Description:
  Description:
Line 31: Line 31:
     the variable.
     the variable.
     arguments:  contact_string
     arguments:  contact_string
  The contact information: Administrator <admin@sjack.eu>
  The contact information: '''Administrator <admin@sjakio.com>'''
  Finished Output: syscontact  "Administrator <admin@sjack.eu>"
  Finished Output: syscontact  "Administrator <admin@sjakio.com>"
  Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y): n
  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 ***
  *** BEGINNING ACCESS CONTROL SETUP ***
  **************************************  
  **************************************  
  Do you want to configure the agent's access control? (default = y):  
  Do you want to configure the agent's access control? (default = y): '''Y'''
  Do you want to allow SNMPv3 read-write user based access (default = y):  
  Do you want to allow SNMPv3 read-write user based access (default = y): '''Y'''
  Configuring: rwuser
  Configuring: rwuser
  Description:
  Description:
   a SNMPv3 read-write user
   a SNMPv3 read-write user
     arguments:  user [noauth|auth|priv] [restriction_oid]
     arguments:  user [noauth|auth|priv] [restriction_oid]
  The SNMPv3 user that should have read-write access: <USERNAME>
  The SNMPv3 user that should have read-write access: '''<USERNAME>'''
  The minimum security level required for that user [noauth|auth|priv, default = auth]:  
  The minimum security level required for that user [noauth|auth|priv, default = auth]:  
  The OID that this community should be restricted to [if appropriate]:  
  The OID that this community should be restricted to [if appropriate]:  
  Finished Output: rwuser  <USERNAME>   
  Finished Output: rwuser  <USERNAME>   
  Do another rwuser line? (default = y): n
  Do another rwuser line? (default = y): '''n'''
  Do you want to allow SNMPv3 read-only user based access (default = y):  
  Do you want to allow SNMPv3 read-only user based access (default = y): '''Y'''
  Configuring: rouser
  Configuring: rouser
  Description:
  Description:
   a SNMPv3 read-only user
   a SNMPv3 read-only user
     arguments:  user [noauth|auth|priv] [restriction_oid]
     arguments:  user [noauth|auth|priv] [restriction_oid]
  Enter the SNMPv3 user that should have read-only access to the system: <USERNAME>
  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 minimum security level required for that user [noauth|auth|priv, default = auth]: '''auth'''
  The OID that this community should be restricted to [if appropriate]:  
  The OID that this community should be restricted to [if appropriate]:  
  Finished Output: rouser  <USERNAME>   
  Finished Output: rouser  <USERNAME>   
  Do another rouser line? (default = y): n
  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-write community access (default = y): '''n'''
  Do you want to allow SNMPv1/v2c read-only community access (default = y): y
  Do you want to allow SNMPv1/v2c read-only community access (default = y): '''y'''
  Configuring: rocommunity
  Configuring: rocommunity
  Description:
  Description:
   a SNMPv1/SNMPv2c read-only access community name
   a SNMPv1/SNMPv2c read-only access community name
     arguments:  community [default|hostname|network/bits] [oid]
     arguments:  community [default|hostname|network/bits] [oid]
  The community name to add read-only access for: <COMMUNITYNAME>
  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 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]:  
  The OID that this community should be restricted to [RETURN for no-restriction]:  
  Finished Output: rocommunity  <COMMUNITYNAME> 10.0.0.0/24  
  Finished Output: rocommunity  <COMMUNITYNAME> 10.0.0.0/24  
  Do another rocommunity line? (default = y): n
  Do another rocommunity line? (default = y): '''n'''
  ****************************************  
  ****************************************  
  *** Beginning trap destination setup ***
  *** Beginning trap destination setup ***
  ****************************************  
  ****************************************  
  Do you want to configure where and if the agent will send traps? (default = y): n
  Do you want to configure where and if the agent will send traps? (default = y): '''n'''
  ****************************************  
  ****************************************  
  *** Beginning monitoring setup ***
  *** 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 agent's ability to monitor various aspects of your system? (default = y): '''Y'''
  Do you want to configure the agents ability to monitor processes? (default = y): y
  Do you want to configure the agents ability to monitor processes? (default = y): '''y'''
  Configuring: proc
  Configuring: proc
  Description:
  Description:
Line 91: Line 91:
     Special Case:  When the min and max numbers are both 0, it assumes
     Special Case:  When the min and max numbers are both 0, it assumes
     you want a max of infinity and a min of 1.
     you want a max of infinity and a min of 1.
  Name of the process you want to check on: afpd  
  Name of the process you want to check on: '''afpd'''
  Maximum number of processes named 'afpd' that should be running [default = 0]: 5
  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
  Minimum number of processes named 'afpd' that should be running [default = 0]: '''1'''
  Finished Output: proc  afpd 5 1
  Finished Output: proc  afpd 5 1
  Do another proc line? (default = y): y
  Do another proc line? (default = y): '''y'''
  Configuring: proc
  Configuring: proc
  Description:
  Description:
Line 109: Line 109:
     Special Case:  When the min and max numbers are both 0, it assumes
     Special Case:  When the min and max numbers are both 0, it assumes
     you want a max of infinity and a min of 1.
     you want a max of infinity and a min of 1.
  Name of the process you want to check on: smbd
  Name of the process you want to check on: '''smbd'''
  Maximum number of processes named 'smbd' that should be running [default = 0]: 5
  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
  Minimum number of processes named 'smbd' that should be running [default = 0]: '''1'''
  Finished Output: proc  smbd 1 5
  Finished Output: proc  smbd 1 5
  Do another proc line? (default = y):  
  Do another proc line? (default = y):  
Line 127: Line 127:
     Special Case:  When the min and max numbers are both 0, it assumes
     Special Case:  When the min and max numbers are both 0, it assumes
     you want a max of infinity and a min of 1.
     you want a max of infinity and a min of 1.
  Name of the process you want to check on: sshd
  Name of the process you want to check on: '''sshd'''
  Maximum number of processes named 'sshd' that should be running [default = 0]: 5
  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
  Minimum number of processes named 'sshd' that should be running [default = 0]: '''0'''
  Finished Output: proc  sshd 5 0
  Finished Output: proc  sshd 5 0
  Do another proc line? (default = y): n
  Do another proc line? (default = y): '''n'''
  Do you want to configure the agents ability to monitor disk space? (default = y):  
  Do you want to configure the agents ability to monitor disk space? (default = y): '''Y'''
  Configuring: disk
  Configuring: disk
  Description:
  Description:
Line 147: Line 147:
      
      
     The results are reported in the dskTable section of the UCD-SNMP-MIB tree
     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 mount point for the disk partion to be checked on: '''/'''
  Enter the minimum amount of space that should be available on /:  
  Enter the minimum amount of space that should be available on /: '''25%'''
  Finished Output: disk  /  
  Finished Output: disk  /  
  Do another disk line? (default = y): n
  Do another disk line? (default = y): '''n'''
  Do you want to configure the agents ability to monitor load average? (default = y):  
  Do you want to configure the agents ability to monitor load average? (default = y): '''Y'''
  Configuring: load
  Configuring: load
  Description:
  Description:
Line 165: Line 165:
      
      
     The results are reported in the laTable section of the UCD-SNMP-MIB tree
     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 1 minute load average: '''15'''
  Enter the maximum allowable value for the 5 minute load average: 12
  Enter the maximum allowable value for the 5 minute load average: '''12'''
  Enter the maximum allowable value for the 15 minute load average: 8
  Enter the maximum allowable value for the 15 minute load average: '''8'''
  Finished Output: load  15 12 8
  Finished Output: load  15 12 8
  Do another load line? (default = y): n
  Do another load line? (default = y): '''n'''
  Do you want to configure the agents ability to monitor file sizes? (default = y): n
  Do you want to configure the agents ability to monitor file sizes? (default = y): '''n'''
  The following files were created:
  The following files were created:
   /usr/local/shared/snmp/snmpd.conf
   /usr/local/shared/snmp/snmpd.conf

Revision as of 12:21, 30 May 2019


Return ssh configuration Next net-snmp user creation


1) configure snmpd.conf

[ ~]$ 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): 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: Hawthorn Woods IL
Finished Output: syslocation  "Hawthorn Woods IL"
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@sjakio.com>
Finished Output: syscontact  "Administrator <admin@sjakio.com>"
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): Y
Do you want to allow SNMPv3 read-write user based access (default = y): 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): 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]: 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): 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): 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 /: 25%
Finished Output: disk  / 
Do another disk line? (default = y): n
Do you want to configure the agents ability to monitor load average? (default = y): 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) Add snmpd to /etc/rc.conf

[ ~]$ sudo vim /etc/rc.conf
#add line:
snmpd_enable="YES"

3) Create Users

Net-snmp user creation

4) Start snmp

[ ~]$ sudo service snmpd start
 Starting snmpd.
[ ~]$

Return ssh configuration Next net-snmp user creation