Skip to content

SNMP-Python/snmp-data-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SNMP analyzer tool ๐Ÿ

Summary

Installing dependencies and environment for the snmp analyzer๐ŸŒฒ:

Install the development and build dependencies ๐Ÿ“ฆ

pip install -r requirements.txt

Install the git hooks for following the development standards ๐Ÿง

sudo npm install -g @commitlint/{config-conventional,cli}
pre-commit install && pre-commit autoupdate && pre-commit install --hook-type commit-msg

Set up the trap catcher ๐Ÿฅ…

Copy snmpd.conf file into /usr/share/snmp changing trap2sink interface for receiver interface (trap sender interface).

trap2sink rocom trap_sender_interface
sudo cp snmpd.conf /usr/share/snmp

Copy snmptrapd.conf file into /etc/snmp

cd traps
sudo cp snmptrapd.conf /etc/snmp

Create scripts folder in /etc/snmp

cd /etc/snmp
sudo mkdir scripts

Change trapsh.sh echo path inside the script

echo "" >> /home/youruser/logs.txt

Put trapsh.sh script into /etc/snmp/scripts

cd traps
sudo cp trapsh.sh /etc/snmp/scripts

Run snmpd and snmpdtrap services

systemctl start snmpd
systemctl start snmptrapd

Run the script trapsparser.py located inside /traps

With logs.txt in the same folder

python3 traps_parser.py

Check the output and see all traps info ๐Ÿฆ†

----------------------------------------------------
IF STATE CHANGE
ROUTER ID:  12.0.0.1
INTERFACE ID:  12.0.0.1
INTERFACE STATE: BACKUP_DESIGNATED_ROUTER
----------------------------------------------------
IF STATE CHANGE
ROUTER ID:  12.0.0.1
INTERFACE ID:  11.0.0.2
INTERFACE STATE: BACKUP_DESIGNATED_ROUTER
----------------------------------------------------
NEIGHBOR STATE CHANGE
ROUTER ID:  13.0.0.1
OSPF ROUTER STATE: FULL
----------------------------------------------------

Usage ๐Ÿ“•

In this section you'll find some examples about how to use the python-snmp-analyzer tool. Be aware that you have to install the dependencies before you run the tool.

Execute the tool with the default values

python main.py

Execute the tool and add directly an ip address

python main.py --ip 10.0.0.4

Execute the tool and save the output to a file

python main.py --output output.txt

Execute the tool and save the routes that the program discovers to your routing table

python main.py --add-routes

Search for help

python main.py --help

License ๐Ÿ‘ฎ

The project is licensed under the GNU General Public License v3.0. See the LICENSE file for more information.

About

A program that analyzes the network by asking Cisco routers using the snmp protocol ๐ŸŒ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •