Why does the lines in bold repeat? I have tried different combinations with no luck in figuring it out. The lines in italics are correct, but the lines in bold are at the beginning and do not need to be there. Thank you very much .
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Hello!
I need to delete one line in a file which matches one very precise instance of a string only. When searching the forum I unfortunately only found a solution which would delete each line on which a particular string occurs.
Let's assume I have a file composed of thousands of lines... (4 Replies)
Say the input was as follows:
Brat 20 x 1000 32rf
Pour 15 p 1621 05pr
Dart 10 z 1111 22xx
My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour"
I currently have this line but it is... (6 Replies)
I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work.
Brief overview:
I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Hi,
I have an issue to combine multiple lines of a file. I have records as below.
Fields are delimited by TAB. Each lines are ending with a new line char (\n)
Input
--------
ABC 123456 abcde 987
890456 7890 xyz
ght gtuv
ABC 5tyin 1234 789
ghty kuio
ABC ghty jind 1234
678 ght
... (8 Replies)
Hi,
I want to achieve something similar to what described in another post:
The difference is I want to add the line if the pattern is not found.
File 1:
A123, valueA, valueB
B234, valueA, valueB
C345, valueA, valueB
D456, valueA, valueB
E567, valueA, valueB
F678, valueA, valueB
... (11 Replies)
Hi All,
I'm having a hard time finding a starting point for my issue. I have a 30k line file (fspsec.txt) that I would like to parse into smaller files based on any character existing in field 1.
ACCOUNTANT LEVEL 1 (ACCT.ACCOUNTANT)
OPERATORS: DOEJO (418)
TOOLS: Branch Maintenance
... (2 Replies)
In the perl below, which does execute, I am having trouble with the else in Rule 3. The digit in f{8} is extracted and used to update f accordinly along with the value in f.
There can be either - * or + before the number that is extracted but the same logic applies, that is if the value is greater... (5 Replies)
I have been reading old posts and trying to come up with a solution for the below: Use a tab-delimited input file to assign
point to variables that are used to update a specific field, Rank. I really couldn't find too much in the way of assigning points
to variable, but made an attempt at an awk... (4 Replies)
I have an input file with
A=xyz
B=pqr
I would want the value in Second Field (xyz or pqr) updated with a value present in Shell Variable based on the value passed in the first field. (A or B )
while read line
do
NEW_VALUE = `some functionality done on $line`
If $line=First Field-... (1 Reply)
Discussion started by: infernalhell
1 Replies
LEARN ABOUT DEBIAN
snmp::info::fdp
Info::FDP(3pm) User Contributed Perl Documentation Info::FDP(3pm)NAME
SNMP::Info::FDP - SNMP Interface to Foundry Discovery Protocol (FDP) using SNMP
AUTHOR
Bruce Rodger, Max Baker
SYNOPSIS
my $fdp = new SNMP::Info (
AutoSpecify => 1,
Debug => 1,
DestHost => 'router',
Community => 'public',
Version => 2
);
my $class = $fdp->class();
print " Using device sub class : $class
";
$hasfdp = $fdp->hasFDP() ? 'yes' : 'no';
# Print out a map of device ports with FDP neighbors:
my $interfaces = $fdp->interfaces();
my $fdp_if = $fdp->fdp_if();
my $fdp_ip = $fdp->fdp_ip();
my $fdp_port = $fdp->fdp_port();
foreach my $fdp_key (keys %$fdp_ip){
my $iid = $fdp_if->{$fdp_key};
my $port = $interfaces->{$iid};
my $neighbor = $fdp_ip->{$fdp_key};
my $neighbor_port = $fdp_port->{$fdp_key};
print "Port : $port connected to $neighbor / $neighbor_port
";
}
DESCRIPTION
SNMP::Info::FDP is a subclass of SNMP::Info that provides an object oriented interface to FDP information through SNMP.
FDP is a Layer 2 protocol that supplies topology information of devices that also speak FDP, mostly switches and routers. It has similar
functionality to Cisco's CDP, and the SNMP interface is virtually identical. FDP is implemented in Foundry devices, including the Bigiron
and Fastiron range.
Create or use a device subclass that inherits this class. Do not use directly.
Each device implements a subset of the global and cache entries. Check the return value to see if that data is held by the device.
Inherited Classes
None.
Required MIBs
FOUNDRY-SN-SWITCH-GROUP-MIB
Needs a reasonably recent MIB. Works OK with B2R07604A.mib, but doesn't work with B2R07600C.
GLOBAL METHODS
These are methods that return scalar values from SNMP
$fdp->hasFDP()
Is FDP is active in this device?
Accounts for SNMP version 1 devices which may have FDP but not fdp_run()
$fdp->fdp_run()
Is FDP enabled on this device?
("fdpGlobalRun")
$fdp->fdp_interval()
Interval in seconds at which FDP messages are generated.
("fdpGlobalMessageInterval")
$fdp->fdp_holdtime()
Time in seconds that FDP messages are kept.
("fdpGlobalHoldTime")
$fdp->fdp_id()
Returns FDP device ID.
This is the device id broadcast via FDP to other devices, and is what is retrieved from remote devices with $fdp->id().
("fdpGlobalDeviceId")
Overrides
CDP compatibility
$fdp->c_interval()
Interval in seconds at which FDP messages are generated.
("fdpGlobalMessageInterval")
$fdp->c_holdtime()
Time in seconds that FDP messages are kept.
("fdpGlobalHoldTime")
$fdp->c_id()
Returns FDP device ID.
This is the device id broadcast via FDP to other devices, and is what is retrieved from remote devices with $fdp->id().
("fdpGlobalDeviceId")
$cdp->cdp_run()
Is FDP enabled on this device?
TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash.
Overrides
CDP compatibility
$fdp->c_capabilities()
Returns Device Functional Capabilities. Results are munged into an ascii binary string, 7 digits long, MSB. Each digit represents a
bit from the table below.
From <http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm#18843>:
(Bit) - Description(0x40) - Provides level 1 functionality.(0x20) - The bridge or switch does not forward IGMP Report packets on non router ports.(0x10) - Sends and receives packets for at least one network layer protocol. If the device is routing the protocol, this bit should not
be set.(0x08) - Performs level 2 switching. The difference between this bit and bit 0x02 is that a switch does not run the Spanning-Tree
Protocol. This device is assumed to be deployed in a physical loop-free topology.(0x04) - Performs level 2 source-route bridging. A source-route bridge would set both this bit and bit 0x02.(0x02) - Performs level 2 transparent bridging.(0x01) - Performs level 3 routing for at least one network layer protocol.
Thanks to Martin Lorensen "martin -at- lorensen.dk" for a pointer to this information.
("fdpCacheCapabilities")
$fdp->c_domain()
The CDP version of this returns remote VTP Management Domain as defined in "CISCO-VTP-MIB::managementDomainName"
("fdpCacheVTPMgmtDomain")
$fdp->c_duplex()
Returns the port duplex status from remote devices.
("fdpCacheDuplex")
$fdp->c_id()
Returns remote device id string
("fdpCacheDeviceId")
$fdp->c_if()
Returns the mapping to the SNMP Interface Table.
Note that a lot devices don't implement $fdp->fdp_index(), So if it isn't around, we fake it.
In order to map the fdp table entry back to the interfaces() entry, we truncate the last number off of it :
# it exists, yay.
my $fdp_index = $device->fdp_index();
return $fdp_index if defined $fdp_index;
# if not, let's fake it
my $fdp_ip = $device->fdp_ip();
my %fdp_if
foreach my $key (keys %$fdp_ip){
$iid = $key;
## Truncate off .1 from fdp response
$iid =~ s/.d+$//;
$fdp_if{$key} = $iid;
}
return \%fdp_if;
$fdp->c_index()
Returns the mapping to the SNMP2 Interface table for FDP Cache Entries.
Most devices don't implement this, so you probably want to use $fdp->fdp_if() instead.
See fdp_if() entry.
("fdpCacheIfIndex")
$fdp->c_ip()
Returns remote IP address
("fdpCacheAddress")
$fdp->c_platform()
Returns remote platform id
("fdpCachePlatform")
$fdp->c_port()
Returns remote port ID
("fdpDevicePort")
$fdp->c_proto()
Returns remote address type received. Usually IP.
("fdpCacheAddressType")
$fdp->c_ver()
Returns remote hardware version
("fdpCacheVersion")
$fdp->c_vlan()
Returns the remote interface native VLAN.
("fdpCacheNativeVLAN")
perl v5.12.4 2011-09-28 Info::FDP(3pm)