Get IOS version via snmp

The following allows you to grab the IOS version of a list of cisco devices.

akonkol
February 16, 2012


#!/bin/bash

while read line; do
   printf $line
   snmpget -v2c -c '%{snmp_community}%' $line 1.3.6.1.2.1.1.1.0 | grep -i ios | awk -F, '{print $2,$3}'
done < %{file_with_list_of_routers}%