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?
- I didnt figure out on how to send "continuously" traps with the "monitor" directive - is it possible to set back the condition to false ?
- Ive read the standard for sending traps is a simple bash script with cron and the exec command. how does that work ?
- How can i send a keep alive to the NMS Machine ?
here is the /etc/snmpd.conf where the "monitor" directive is checking the hrProcessorLoad Load.
Code:
###############################################################################
# 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! Thanks