Jump to content

Testing Trap With Linux Operating System: Difference between revisions

no edit summary
(Created page with "==Summary== This chapter is a guide on configuring SNMP Trap listening service on Linux OS. ===Preconditions=== To configure Trap listening service these packages are requi...")
 
No edit summary
Line 3: Line 3:
This chapter is a guide on configuring SNMP Trap listening service on Linux OS.
This chapter is a guide on configuring SNMP Trap listening service on Linux OS.


===Preconditions===
==Preconditions==


To configure Trap listening service these packages are required: ''' snmp ''', '''snmpd''', '''snmptt''', '''snmptrapd'''.
To configure Trap listening service these packages are required: ''' snmp ''', '''snmpd''', '''snmptt''', '''snmptrapd'''.
Line 13: Line 13:
'''Important note:''' before continuing make sure that SNMP Trap package is configured. SNMP configuration example can be found here [[SNMP configuration example]].
'''Important note:''' before continuing make sure that SNMP Trap package is configured. SNMP configuration example can be found here [[SNMP configuration example]].


===Editing configuration files===
==Editing configuration files==


====Snmpd.conf====
===Snmpd.conf===


This is not required for Trap listening service, but with this configuration '''snmpget''' command will be able to establish connection without requiring port number in the command line.
This is not required for Trap listening service, but with this configuration '''snmpget''' command will be able to establish connection without requiring port number in the command line.
Line 26: Line 26:


[[File:Networking device configurationexample traps with terminal snmpd config v1.png]]
[[File:Networking device configurationexample traps with terminal snmpd config v1.png]]
 
----
====Snmptrapd.conf====
===Snmptrapd.conf===


This is required to specify community you described in SNMP Trap package configuration, to describe Trap port and how to handle caught Trap messages.
This is required to specify community you described in SNMP Trap package configuration, to describe Trap port and how to handle caught Trap messages.
Line 48: Line 48:


[[File:Networking device configurationexample traps with terminal snmptrapd config v1.png]]
[[File:Networking device configurationexample traps with terminal snmptrapd config v1.png]]
 
----
====Creating Trap listening service====
===Creating Trap listening service===


This is required for launching Trap listening service with extra configurations, we will use it to describe the log file, where all traps will be recorded.
This is required for launching Trap listening service with extra configurations, we will use it to describe the log file, where all traps will be recorded.
Line 63: Line 63:
'''ExecStart=/usr/sbin/snmptrapd -Ln -f -Lf /var/log/snmptrapd.log'''
'''ExecStart=/usr/sbin/snmptrapd -Ln -f -Lf /var/log/snmptrapd.log'''


This configuration will write the log into ''' ''/var/log/'' ''' folder and into ''' ''snmptrapd.log'' ''' file.
This configuration will write the log into ''' ''/var/log/'' ''' folder and into ''' ''snmptrapd.log'' ''' file. You can change the log file directory and file name.
 
[[File:Networking device configurationexample creating snmptrapd service v1.png]]
----
===Loading MIB file===
MIB file will be used to translate OID codes to more readable format
0

edits