Ethernet Switching
Highlighted
Ethernet Switching

Finding a device that was just plugged in - interface up/down

‎09-05-2014 01:28 PM

Sorry - another Cisco tech joining the Juniper party.  Apologies if this isn't in the best place...

 

I'm trying to find a device that was just plugged into a switch stack so I can update the access VLAN for the device.  If you'd forgive a Cisco reference, there I would just "show log" and look for "Gi1/0/1 up" or some such thing, and then I know what port just came up to support the device and could go from there.

 

Any suggestions on doing something similar with an EX4200?  Code 12.3

3 REPLIES 3
Highlighted
Ethernet Switching

Re: Finding a device that was just plugged in - interface up/down

[ Edited ]
‎09-06-2014 03:33 AM

Hi,

 

It's almost the same with Juniper. Try show log messages | match <search word> (In this case perhaps "ifOperStatus")

If you're familiar with unix you can also do start shell and go to /var/log and find stuff from logfiles with unix tools like grep and tail etc.

 

If you are satisfied with the answer, please click "Accepted as Solution". Kudos also welcome!

 

 

Regards,
Tero S
Highlighted
Ethernet Switching
Solution
Accepted by topic author ^^
‎08-26-2015 01:27 AM

Re: Finding a device that was just plugged in - interface up/down

‎09-06-2014 04:11 AM

The messages logfile can get pretty big, and depending upon how often it rolls, interface changes might not be there.  You can create your own logs, so here's what we do to create an log file just for interface changes:

 

set system syslog file interface-changes any any

set system syslog file interface-changes match SNMP_TRAP_LINK

 

The last line says to only match log entries that have the string SNMP_TRAP_LINK, which will catch the interface ups and downs. 

 

Now you can simply do:

 

show log interface-changes

 

Rob

 

Highlighted
Ethernet Switching

Re: Finding a device that was just plugged in - interface up/down

‎09-10-2014 04:05 PM

Why thank you.  Making my own log file sounds pretty neat - when you do such a thing do you need to consider CPU resources and such?  In the past I've been concerned about "protecting the CPU" though I don't understand how Juniper hardware works.

Feedback