2.3.cdpr-CiscoDiscoveryProtocolReporter

玄學醬發表於2018-01-01
$ sudo apt-get install cdpr
		
$ sudo cdpr
[sudo] password for neo:
cdpr - Cisco Discovery Protocol Reporter
Version 2.4
Copyright (c) 2002-2010 - MonkeyMental.com

1. eth0 (No description available)
2. tun0 (No description available)
3. usbmon1 (USB bus number 1)
4. usbmon2 (USB bus number 2)
5. usbmon3 (USB bus number 3)
6. usbmon4 (USB bus number 4)
7. usbmon5 (USB bus number 5)
8. lo (No description available)
Enter the interface number (1-8):1
Using Device: eth0
Waiting for CDP advertisement:
(default config is to transmit CDP packets every 60 seconds)
Device ID
  value:  4A3750G
Addresses
  value:  193.168.0.254
Port ID
  value:  GigabitEthernet1/0/15

		

通過cdprs.php收集CDP資料,很容易改寫,實現寫入資料庫

/usr/share/doc/cdpr/examples/

$ find /usr/share/doc/cdpr/examples/
/usr/share/doc/cdpr/examples/
/usr/share/doc/cdpr/examples/cdprs
/usr/share/doc/cdpr/examples/cdprs/cdprs.cgi.gz
/usr/share/doc/cdpr/examples/cdprs/cdprs.php
/usr/share/doc/cdpr/examples/cdpr.conf
		

這個功能可以實現後自動繪製網路拓撲,分析收集的資料,然後通過Graphviz繪製網路拓撲圖。

原文出處:Netkiller 系列 手札
本文作者:陳景峰
轉載請與作者聯絡,同時請務必標明文章原始出處和作者資訊及本宣告。