First of all, please move this thread if its the wrong place.
I have a requirement to delevop an SNMP Agent on a unix device which send SNMP trap to NMS(Nagios) as a result to some trigger for measuring
CPU,Mem and HD. As a beginner, ive been doin alot of reading on the internet most of all on net-snmp wiki, manpage snmpd.conf .
Questions:
- does the configuration down below looks correct for triggern with DisMan "monitor" directive ?
- Iam able to receive traps (/var/log) when hrProcessorLoad is >60, but i couldnt work out with laTable for load average. what iam doing wrong?
here it the /etc/snmpd.conf
Any advice is appreciated!
I have a requirement to delevop an SNMP Agent on a unix device which send SNMP trap to NMS(Nagios) as a result to some trigger for measuring
CPU,Mem and HD. As a beginner, ive been doin alot of reading on the internet most of all on net-snmp wiki, manpage snmpd.conf .
Questions:
- does the configuration down below looks correct for triggern with DisMan "monitor" directive ?
- Iam able to receive traps (/var/log) when hrProcessorLoad is >60, but i couldnt work out with laTable for load average. what iam doing wrong?
here it the /etc/snmpd.conf
![]() |
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
############################################################################### # 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: # # Make sure at least one sendmail, but less than or equal to 10 are running. #proc sendmail 10 1 #proc sshd proc cron #proc snmp 1 1 ############################################################################### # disk checks # # disk PATH [MIN=DEFDISKMINIMUMSPACE] # # PATH: mount path to the disk in question. # MIN: Disks with space below this value will have the Mib's errorFlag set. # Default value = DEFDISKMINIMUMSPACE. # Check the / partition and make sure it contains at least 10 megs. #disk / 10000000 #disk /var 5% #includeAllDisks 10% ############################################################################### # load average checks # # load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE] # # 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 10 5 # ----------------------------------------------------------------------------- # Inteface up and down # Trap server information #trapsink 20.10.43.3 public #trap2sink localhost public #informsink localhost public trapsess -Ci -v 3 -u disman -l authPriv -a SHA -A mypassword -x AES -X password localhost #trapcommunity public authtrapenable 1 rouser disman auth iquerySecName disman defaultMonitors yes #linkUpDownNotifications no monitor -u disman -r 30 machineTooBusy hrProcessorLoad > 60 #not working #monitor -u disman -o dskPath -o dskAvail -o dskTotal "dskTable" dskErrorFlag 0 1 #monitor -u disman -o dskPath -o dskErrorMsg "dskTable" dskErrorFlag != 0 #monitor -u disman -o memErrorName -o memSwapErrorMsg "memory" memSwapError != 0 #monitor -u disman -o laNames -o laErrMessage "laTable" laErrorFlag != 0 ########################################################################### # SECTION: Agent Operating Mode # # This section defines how the agent will operate when it # is running. # master: Should the agent operate as a master agent or not. # Currently, the only supported master agent type for this token # is "agentx". # # arguments: (on|yes|agentx|all|off|no) master agentx # agentaddress: The IP address and port number that the agent will listen on. # By default the agent listens to any and all traffic from any # interface on the default SNMP port (161). This allows you to # specify which address, interface, transport type and port(s) that you # want the agent to listen on. Multiple definitions of this token # are concatenated together (using ':'s). # arguments: [transport:]port[@interface/address],... #agentAddress udp:161 dontLogTCPWrappersConnects 1 |
Any advice is appreciated!