Skip to content

SNMP-Python/snmp-data-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

93 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SNMP analyzer tool ๐Ÿ

Installing dependencies and environment ๐ŸŒฒ:

Install git hooks for executing tests and the git commit message

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

Set-up 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
----------------------------------------------------

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

  •  
  •  
  •  
  •