LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Closed Thread
  Search this Thread
Old 02-02-2012, 06:01 PM   #1
creatureofthedark
Member
 
Registered: Jan 2007
Distribution: LFS / Ubuntu / CentOs
Posts: 56

Rep: Reputation: 15
how do you setup snmpd to send traps when /var has less then 10% capacity left


hey,

iv been working on this for god knows how long and been googleing for the past few months now.... all i seem to come up with is how to setup snmp traps with IOS or snmpwalk info...

I am trying to make an automated monitoring system for my final year computer systems and networking project at university..

currently i have setup a small test bed consisting of a web-server and a monitoring server... on the web-server i have installed snmpd and used the following config file

Code:
com2sec local     127.0.0.1/32    public
com2sec local     192.168.2.0/24   public

trap2sink 192.168.2.51 public
trapsink 192.168.2.51 public

group MyROGroup v1         local
group MyROGroup v2c        local
group MyROGroup usm        local

view all    included  .1                               80

access MyROGroup ""      any       noauth    exact  all    none   none

rocommunity  public
syslocation  "North"
syscontact  david@the-ward-network.co.uk

###############################################################################
#
#  SYSTEM INFORMATION
#

#  Note that setting these values here, results in the corresponding MIB objects being 're$
#  See snmpd.conf(5) for more details
sysLocation    Sitting on the Dock of the Bay
sysContact     Me <me@example.org>
                                                 # Application + End-to-End layers
sysServices    72


#
#  Process Monitoring
#
                               # At least one  'mountd' process
proc  mountd
                               # No more than 4 'ntalkd' processes - 0 is OK
proc  ntalkd    4
                               # At least one 'sendmail' process, but no more than 10
proc  sendmail 10 1

#  Walk the UCD-SNMP-MIB::prTable to see the resulting output
#  Note that this table will be empty if there are no "proc" entries in the snmpd.conf file


#
#  Disk Monitoring
#
                               # 10MBs required on root disk, 5% free on /var, 10% free on$
disk       /     10000
disk       /var  5%
includeAllDisks  10%

#  Walk the UCD-SNMP-MIB::dskTable to see the resulting output
#  Note that this table will be empty if there are no "disk" entries in the snmpd.conf file


#
#  System Load
#
                               # Unacceptable 1-, 5-, and 15-minute load averages
load   12 10 5
on the monitoring server i have setup snmptrapd below
Code:
authCommunity log,execute,net public
traphandle default python /home/creature/snmptest.py
snmptest.py looks like
Code:
def main():

        running = True
        output = open ('/tmp/traps', 'a')
        while running:
                try:
                        input = raw_input()
                        output.write(input + "\n")
                except EOFError:
                        running = False
        output.close()

if __name__ == '__main__':
        main()
this code was taken from http://www.youtube.com/watch?v=S0ibDVFnUws

the only issue is i only seem to be getting uptime alerts and not anything else..... i don't think iv even configured uptime traps in the snmpd.conf file....

can anyone tell me what im doing wrong?? or if what i am doing is even possible??

as far as i can tell no one seems to know.....

thanks in advance
 
Old 02-02-2012, 09:39 PM   #2
creatureofthedark
Member
 
Registered: Jan 2007
Distribution: LFS / Ubuntu / CentOs
Posts: 56

Original Poster
Rep: Reputation: 15
as I think this may be in the wrong place i am going to post in the networking section of this forum... I apologise im just making a mess here....
 
Old 02-03-2012, 10:54 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Please don't cross-post messages. When you make a mistake like this, just click the "report" button and ask the moderators to correct it for you. They have the power to move your post to the appropriate forum.

I'm going to go ahead and report this thread as a duplicate, so they can close it.
 
Old 02-03-2012, 12:22 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
As David said! Next time report your own post and ask for moving, please. Discussion follows here: http://www.linuxquestions.org/questi...y-left-927307/.
 
  


Closed Thread



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
Filter snmpd entries from /var/log/messages investmentbnker75 Linux - General 6 03-18-2011 04:10 PM
How can I send snmp traps based on syslog messages flyswb Linux - Newbie 1 10-24-2010 09:10 AM
SNMP library to send *only* traps for Embedded Linux darshan_ghumare Programming 0 07-10-2010 09:26 AM
SNMPD errors in /var/log/messages investmentbnker75 Linux - Server 1 08-29-2008 01:17 AM
Sending traps in snmpd.conf rbh123 Linux - Networking 0 09-18-2006 09:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:21 PM.

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