no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | monitors:cisco-ip-flow [2016/12/23 13:52] (current) – created nickoarg | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== IP Top Talkers - Cisco ====== | ||
| + | |||
| + | ^ Author | [[ nbarberis@gestionamas.com.ar | Nicolas Barberis ]] | | ||
| + | ^ Compatibility | Xymon 4.3.27 | | ||
| + | ^ Requirements | BASH, snmpget, snmpwalk | | ||
| + | ^ Download | None | | ||
| + | ^ Last Update | 2016-12-23 | | ||
| + | |||
| + | ===== Description ===== | ||
| + | This test was developed in order to get the Top-Talkers list from a cisco device vía SNMP. Tested on a Cisco 2911 with IOS 15.3 | ||
| + | |||
| + | ===== Installation ===== | ||
| + | === Client side === | ||
| + | (Client side being the Cisco router) | ||
| + | |||
| + | < | ||
| + | interface Vlan1 | ||
| + | !config to verify the traffic-wise top user | ||
| + | ! assuming vlan1 to be the LAN side | ||
| + | ip flow egress | ||
| + | ! ip flow egress means "the traffic going out of this iface to the user" | ||
| + | ip flow-top-talkers | ||
| + | top 10 | ||
| + | sort-by bytes | ||
| + | </ | ||
| + | |||
| + | === Server side === | ||
| + | Copy paste the script to $XYMONHOME/ | ||
| + | |||
| + | Add the topt tag to the desireddevices (topt: "top 10") | ||
| + | |||
| + | |||
| + | ===== Source ===== | ||
| + | ==== iptop.sh ==== | ||
| + | |||
| + | <hidden onHidden=" | ||
| + | < | ||
| + | #!/bin/bash | ||
| + | # | ||
| + | # Author: Nicolas Barberis(nbarberis@gestionamas.com.ar) | ||
| + | # Description: | ||
| + | # | ||
| + | # You need to setup ip flow on the cisco router for the MIBS to be available: | ||
| + | # interface Vlan1 | ||
| + | # !config to verify the internet top user | ||
| + | # ! assuming vlan1 to be the LAN side | ||
| + | # ip flow egress | ||
| + | # ip flow-top-talkers | ||
| + | # top 10 | ||
| + | # sort-by bytes | ||
| + | # | ||
| + | |||
| + | BBHTAG=topt | ||
| + | COLUMN=$BBHTAG | ||
| + | |||
| + | COMMUNITY=public | ||
| + | |||
| + | $XYMONHOME/ | ||
| + | do | ||
| + | set $L # To get one line of output from bbhostgrep | ||
| + | |||
| + | HOSTIP=" | ||
| + | MACHINEDOTS=" | ||
| + | MACHINE=`echo $2 | $SED -e' | ||
| + | |||
| + | COLOR=green | ||
| + | MSG=" | ||
| + | |||
| + | MSG=$(echo -e " | ||
| + | |||
| + | for INDEX in `/ | ||
| + | do | ||
| + | |||
| + | IP_ORIG_HEX=$(/ | ||
| + | IP_ORIG_OCT=$((16# | ||
| + | IP_DEST_HEX=$(/ | ||
| + | IP_DEST_OCT=$((16# | ||
| + | PORT=$(/ | ||
| + | BYTES=$(/ | ||
| + | KB=$((BYTES/ | ||
| + | KBTOT+=$((KB)) | ||
| + | # | ||
| + | |||
| + | CCOLOR=" | ||
| + | COLOR=green | ||
| + | # if [ $KBTOT > 950000000 ] | ||
| + | # then | ||
| + | # | ||
| + | # | ||
| + | # elif | ||
| + | # | ||
| + | # | ||
| + | # fi | ||
| + | |||
| + | STATUSTRANSLATED=${STATUSCODES[$STATUS]} | ||
| + | #MSG=$(echo -e " | ||
| + | MSG=$(echo -e " | ||
| + | |||
| + | done | ||
| + | |||
| + | MSG=$(echo -e " | ||
| + | |||
| + | $XYMON $XYMSRV " | ||
| + | |||
| + | ${MSG} | ||
| + | " | ||
| + | # uncomment to debug the message sent to xymon | ||
| + | # echo $XYMON $XYMSRV " | ||
| + | done | ||
| + | |||
| + | exit 0 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== Known Bugs and Issues ===== | ||
| + | *Make sure about your path to snmpget and snmpwalk. Adjust accordingly. | ||
| + | |||
| + | ===== To Do ===== | ||
| + | * Set the test color to go along with the if-load column | ||
| + | |||
| + | ===== Credits ===== | ||
| + | |||
| + | ===== Changelog ===== | ||
| + | |||
| + | * **2016-12-23** | ||
| + | * Initial release | ||