Sponsored Content
Full Discussion: awk parse snmp results
Top Forums Shell Programming and Scripting awk parse snmp results Post 302952359 by wanttolearn1 on Tuesday 18th of August 2015 08:26:40 AM
Old 08-18-2015
awk parse snmp results

i run the command
snmptable -v2c -c public myIP IF-MIB::ifTable
the result look like this :
Code:
SNMP table: IF-MIB::ifTable

 ifIndex                                    ifDescr         ifType ifMtu    ifSpeed    ifPhysAddress ifAdminStatus ifOperStatus 
       1        Unit: 1 Slot: 0 Port: 1 10G - Level ethernetCsmacd  1518 4294967295 f8:b1:56:56:47:4            up           up  
       2        Unit: 1 Slot: 0 Port: 2 10G - Level ethernetCsmacd  1518 4294967295 f8:b1:56:56:47:4            up           up
       3        Unit: 1 Slot: 0 Port: 3 10G - Level ethernetCsmacd  1518 4294967295 f8:b1:56:56:47:4            up           up
       4        Unit: 1 Slot: 0 Port: 4 10G - Level ethernetCsmacd  1518 4294967295 f8:b1:56:56:47:4            up         down
       5        Unit: 1 Slot: 0 Port: 5 10G - Level ethernetCsmacd  1518 4294967295 f8:b1:56:56:47:4            up           up

how can i get a row by the first column certain value (ifIndex), and a certain column in that row?

Last edited by Scrutinizer; 08-18-2015 at 10:06 AM.. Reason: quote tags changed to code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK - no search results

Hi all, I'm new to awk and I'm experiencing syntax error that I don't know how to resolve. Hopefully some experts in this forum can help me out. I created an awk file that look like this: $ cat myawk.awk BEGIN { VAR1=PATTERN1 VAR2=PATTERN2 } /VAR1/ { flag=1 } /VAR2/ { flag=0 } {... (7 Replies)
Discussion started by: hk18
7 Replies

2. Shell Programming and Scripting

Shell Script Needed to Parse Results

Raw Results: results|192.168.2|192.168.2.1|general/udp|10287|Security Note|For your information, here is the traceroute from 192.168.2.24 to 192.168.2.1 : \n192.168.2.24\n192.168.2.1\n\n results|192.168.2|192.168.2.1|ssh (22/tcp)|22964|Security Note|An SSH server is running on this port.\n... (2 Replies)
Discussion started by: jroberson
2 Replies

3. Shell Programming and Scripting

need a little help with results from awk

Hi there all, I am using a line to get some replys from my PS I do ps -ef |awk '{printf $9}' But my result is 1 big line. No spaces between the lines or someting for example:... (2 Replies)
Discussion started by: draco
2 Replies

4. Shell Programming and Scripting

Parse file using awk and work in awk output

hi guys, i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 this the file raw format: Number of... (6 Replies)
Discussion started by: dagigg
6 Replies

5. Shell Programming and Scripting

awk script to parse results from TWO files

I am trying to parse two files and get data that does not match in one of the columns ( column 3 in my case ) Data for two files are as follows A.txt ===== abc 10 5 0 1 16 xyz 16 1 1 0 18 efg 30 8 0 2 40 ijk 22 2 0 1 25 B.txt ===== abc... (6 Replies)
Discussion started by: roger67
6 Replies

6. IP Networking

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (0 Replies)
Discussion started by: prabakar4all
0 Replies

7. Red Hat

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (1 Reply)
Discussion started by: prabakar4all
1 Replies

8. Shell Programming and Scripting

Substitute from awk results

Hi, The following awk command : asmcmd lsdg | awk '{print $13;}' | grep -i ${SID} return the following output . An Empty line + two lines contain "/" at the end of the line INDEVDATA/ INDEVFRA/ I need to remove the "/" as well as the empty line. Please advise Thanks (3 Replies)
Discussion started by: Yoav
3 Replies

9. UNIX for Dummies Questions & Answers

Need to transfer all kernel logs (var/log/messages) to the snmp listener as snmp trap

i am working with embedded system -Dell DCS management sub system. my question is as below: currently we are using linux kernel 2.6.30 build and we have a kernel logs stored to the /var/log/messages path. now we have to transfer all this logs to the specified SNMP target as a part of SNMP... (4 Replies)
Discussion started by: vipul_prajapati
4 Replies

10. AIX

AIX native SNMP producing limited results when walking MIB tree

The company I work for has various AIX servers that I've recently migrated to AIX 7.1 (from 6.1). Some are powerHA clusters some are not. Likewise, the systems engineer that I replaced had net-snmp installed on said clustered systems. Long story short I am re-invoking AIX's native SNMP (v3) for... (1 Reply)
Discussion started by: davix
1 Replies
libstmf(3LIB)							Interface Libraries						     libstmf(3LIB)

NAME
libstmf - SCSI Target Mode Framework library SYNOPSIS
cc [ flag... ] file... -lstmf [ library... ] #include <libstmf.h> DESCRIPTION
Functions in this library provide configuration management of the SCSI Target Mode Framework (STMF), allowing clients to manage the provi- sioning of logical units and targets to the initiator clients of the framework. Definitions Host Group A Host Group is a set of one or more initiator ports that are combined together for the purposes of applying access controls to a Logi- cal Unit object and assigning a logical unit number to the Logical Unit. The assigned logical unit number will be reported to the mem- bers of that Host Group via the SCSI REPORT LUN command. Host Groups can contain initiator ports that are not visible to the SCSI Tar- get Mode Framework. Initiator ports might not be a member in more than one group. A Host Group is associated with a given Logical Unit via a view entry. Host Group names are unique within the framework. Logical Unit A Logical Unit object is provided to the SCSI Target Mode Framework for the purposes of executing SCSI commands. Library clients can manage a Logical Unit object's accessibility to one or more SCSI initiator clients. libstmf library clients cannot add or remove Logi- cal Unit objects from the system. Every Logical Unit object within the SCSI Target Mode Framework is owned by a logical unit provider whose identity is available via the properties on the Logical Unit object. Logical Unit Number A Logical Unit Number is the SCSI identifier of a logical unit within a target. Target Port A Target port object is provided to the SCSI Target Mode Framework for the purposes of receiving SCSI commands on a particular logical unit. Library clients can manage a Logical Unit object's availability to one or more Target port objects. Library clients cannot add or remove Target objects from the system. Every Target port object within the SCSI Target Mode Framework is owned by a Local Port provider whose identity is available via the properties on the Target port object. Target Port Group A Target Port Group is a set of one or more Target ports that are combined together for the purposes of applying availability to a Log- ical Unit object. A Target Port Group may be applied to any given Logical Unit via a view entry. Target ports may not be a member in more than one Target Port Group. Target Port Group names are unique within the framework. View A View is a list of logical units exposed to a list of initiator ports through a list of targets. View Entry A View Entry object defines the association of an host group, a target group and a logical unit number with a specified logical unit. When a view entry is created for a logical unit, a caller can assign all targets and/or all initiator ports to the logical unit thus making the logical unit accessible to all target ports and/or all initiator ports. A logical unit may have one or more view entries associated with it. Any two view entries are considered to be in conflict when an attempt is made to duplicate the association of any given initiator port, target port and logical unit. Attempting this will result in an error returned from the call to stmfAddViewEn- try(3STMF). INTERFACES
The shared object libstmf.so.1 provides the public interfaces defined below. See Intro(3) for additional information on shared object interfaces. stmfAddToHostGroup stmfAddToTargetGroup stmfAddViewEntry stmfClearProviderData stmfCreateHostGroup stmfCreateTargetGroup stmfDeleteHostGroup stmfDeleteTargetGroup stmfDevidFromIscsiName stmfDevidFromWwn stmfFreeMemory stmfGetHostGroupList stmfGetHostGroupMembers stmfGetLogicalUnitList stmfGetLogicalUnitProperties stmfGetProviderData stmfGetProviderDataProt stmfGetState stmfGetTargetGroupList stmfGetTargetGroupMembers stmfGetTargetList stmfGetTargetProperties stmfGetViewEntryList stmfOfflineLogicalUnit stmfOfflineTarget stmfOnlineLogicalUnit stmfOnlineTarget stmfRemoveFromHostGroup stmfRemoveFromTargetGroup stmfRemoveViewEntry stmfSetProviderData stmfSetProviderDataProt FILES
/lib/libstmf.so.1 shared object /lib/64/libstmf.so.1 64-bit shared object ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWstmf | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
Intro(3), stmfAddViewEntry(3STMF), attributes(5) SunOS 5.11 7 Oct 2008 libstmf(3LIB)
All times are GMT -4. The time now is 02:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy