Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use SNMP to retrieve a list of extensions and their IP Address 1

Status
Not open for further replies.

tkrauss

IS-IT--Management
Jan 27, 2014
8
US
I am looking to run a command line script. (Not CLI) using windows task scheduler to build a list of extensions with the IP Address automatically.
I have been trying to use SNMP but am not able to find the extension using snmpwalk.

Any suggestions?

Thank you!
 
And just for bonus points, and cause I'm trying to get good with regular expressions...

if you go to CM's command line and type

sat>/home/youraccount/reg.txt

That will open a sat terminal and send the output to reg.txt. The screen will go blank because you're outputting it to a file, but if you then type

ossi <enter> (for terminal type)
clist reg <enter> t <enter>
wait a few seconds/minutes
clogoff <enter> t<enter> y <enter>

You should be back at the bash prompt with a file reg.txt listing out everything. And I whipped up this little regex in a few minutes to turn it to csv:

sed '1,11d' reg.txt|awk 'NR % 6 != 0'|awk 'NR % 5 != 0'|awk 'NR % 4 != 0'|awk 'NR % 3 != 0'|awk 'NR % 2 != 0'|sed 's/^.//'|tr "\\t" ","|head -n -3>reg.csv

It means delete the first 11 lines, then delete every 6th line, then every 5th line, then every 4th line then every 3rd line then every 2nd line then delete the first character (the 'd') of every line, then replace tabs with commas, then remove the last 3 lines of the file, then output to "reg.csv".

Find a way to embed that as a database function and build reporting out of it after, or script a cron job with expect in some other server to login to your CM and pull it and you're off to the races.
 

I receive the IP Address but am not able to receive the Station / Extension numbers.
This are the commands I have run.

snmpwalk -v2c -Os -c public -m G3-AVAYA-MIB -M mibs 172.20.53.15

snmpwalk -v2c -Os -c public -m NET-SNMP-MIB -M mibs 172.20.53.15

snmpwalk -v2c -Os -c public -m AVAYA-AURA-CM-MIB -M mibs 172.20.53.15



 
What version of CM are you running? I would think the AURA and NET-SNMP mibs don't work with the G3 MIB anymore.

And you've got to do some stuff in CM to turn SNMP on on the phones to be able to walk them, and different models might have different OIDs for that stuff.
 
6.3
I have enables SNMP. I have attached an output of what I am running as an example.

Thanks for the assistance!
 
I don't see your attachment, but there's two different releases of 6.3 - 6.3.0 that uses the g3mib and 6.3.1 that uses the new AURA mib.

The new one is a lot easier. Post a swversion or list conf soft or something. 03.0.124.0 is 6.3.0 on the old snmp.
 
Software version R016x.03.0.124.0

Do you know which mibs I need to have in my specific mib directory?

 
Probably just the g3 mib. The Aura and netsnmp ones don't apply to your release. Check on Avaya's support site - they've got a few examples if you look through the knowledge base articles.

I get that you're an NMS guy and want to do it by SNMP, I just find it so much easier to write a one-liner and get it right from CM.
 
System Manager has a report that can be scheduled that includes Station/Ext, Set Type, Net Rgn, Firmware Release, Station IP Address, Gatekeeper IP and System that it's registered to.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top