LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-20-2016, 03:17 PM   #1
Traps
LQ Newbie
 
Registered: Jan 2016
Location: Germany
Distribution: Ubuntu 14.04 LTS
Posts: 4

Rep: Reputation: Disabled
Question measuring Cpu,Mem and Hdd


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

Last edited by Traps; 01-20-2016 at 03:22 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions on measuring CPU on Windows and Linux (for comparison) Gödel Linux - Newbie 4 08-01-2012 04:18 AM
possible HW list OC; by MoBo, CPU, Mem, BIOS CPU x Addition HCL (stock BIOS settings) digital8doug Linux - General 17 12-15-2006 07:01 PM
threadwise measuring of CPU/MEM usage (prstat) raees Linux - Software 1 06-28-2005 08:32 PM
measuring cpu- and tower-temperature? ungua Linux - Software 3 10-04-2004 04:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration