We have just gotten some nice HP ProCurve J8697A 5406zl switch’s
I’m have setup a quick script on my RedHat Nagios server to query our switch’s about what MAC’s are behind each port:
for ip in $nets; do
snmpwalk -v 1 -Os $ip -c $comm .22.214.171.124.126.96.36.199.3.1.1 | while read line
echo $line | cut -d= -f2 | cut -d: -f2 | cut -d" " -f2- | tr " " : | cut -d: -f1-6
echo $line | cut -d= -f 1 | cut -d. -f 7-
snmpwalk -v 1 -Os $ip -c $comm .188.8.131.52.184.108.40.206.3.1.2.$first | cut -d" " -f4
snmpwalk -v 1 -Os $ip -c $comm .220.127.116.11.18.104.22.168.4.1.2.$Bridge | cut -d" " -f4
snmpwalk -v 1 -Os $ip -c $comm .22.214.171.124.126.96.36.199.1.1.1.$ifIndex | cut -d" " -f4
echo "$mac $ip $ifName"
EX: 00:06:5B:FC:7A:93 switch1 D18
(meaning that MAC 00:06:5B:FC:7A:93 is located in switch switch1 in port D18)
Anyone who knows a link to a working MIB ?
I would now like to take it a bit further and put a nice picture of each switch into NagVis and have a field telling me what DNS-hostname is located behind each port in the switch.
I have tried to make a full snmpwalk but i can’t find anything matching IP (therefor currently getting the MAC) - anyone who know if this is possible on my switch’s (do our Network Service Provider need to allow more snmpinfo for my RO-snmp account or can this only be done on routers or not at all ? [telnet/ssh to the switch’s are not an option as our Network Service Provider is not allowing this])
If it is possible only to get the MAC via snmp i need to convert MAC to DNS hostname.
This can be done with arp, but will only give me the hosts that my monitoring server has been communicating with recently (within the last 8 minutes?) and it will only be hosts on the same network as my monitoring server…
I could then multihome my monitoring server to each and every network we have or i could install something like arpwatch on “outsourced” server in each network and gather the information from them… neither I think is optimal though (multihoming will make monitoring of routing difficult and “outsourcing” makes a dependency to the servers)
Anyone who has already done similar or knows of a better approach ?
Thanks in advance