Quantcast
Channel: Infoblox Community - Infoblox Community Blog
Viewing all articles
Browse latest Browse all 76

NetMRI Scripting: Modify Interface

$
0
0

This script will grab the CDP neighbor name and add it to the interface that it's configured on.


Script-Filter:
    $vendor eq "Cisco" and $sysdescr like /IOS/
    
    
########################################################################
Action:
    Execute Command Batch
    
Action-Commands:
    sh int trunk | inc trunking
    
Output-Triggers:
Parse Output
########################################################################
    
Trigger:
    Parse Output
    
Trigger-Variables:
    #This regex finds the interfaces
    $cdpport /((Gi|Fa)+\d+(\/\d{1,2}|\/\d{1,2}\/\d+|\/\d{1,2}\.\d+|\/\d{1,2}\:\d+)?|\w+-\w+\d{1,3})/
    
Trigger-Template:
    [[$cdpport]]\s.+on\s.+802.1q\s.+trunking\s.+
    
Trigger-Commands:
    sh cdp ne $cdpport
    
Output-Triggers:
    Show CDP
    
#####################
Trigger:
    Show CDP
    
Trigger-Variables:
    $cdpname /\w.+/
    
Trigger-Template:
Device.+
[[$cdpname]]\..+\..+
.+
    
Trigger-Commands:
    DEBUG: conf t
    DEBUG: int $cdpport
    DEBUG: desc $cdpname
    
File attachments: 
Archived: 
Select a category: 
Section: 

Viewing all articles
Browse latest Browse all 76

Trending Articles