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
mlib_ImageColorHSV2RGB(3MLIB)				    mediaLib Library Functions				     mlib_ImageColorHSV2RGB(3MLIB)

NAME
mlib_ImageColorHSV2RGB - HSV to RGB color conversion SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageColorHSV2RGB(mlib_image *dst, const mlib_image *src); DESCRIPTION
The mlib_ImageColorHSV2RGB() function performs a conversion from hue/saturation/value to red/green/blue. The source and destination images must be three-channel images. It uses the following equations: P = V*(1 - S) Q = V*(1 - S*fraction(H*6)) T = V*(1 - S*(1 - fraction(H*6))) R, G, B = V, T, P if 0 <= H < 1/6 R, G, B = Q, V, P if 1/6 <= H < 2/6 R, G, B = P, V, T if 2/6 <= H < 3/6 R, G, B = P, Q, V if 3/6 <= H < 4/6 R, G, B = T, P, V if 4/6 <= H < 5/6 R, G, B = V, P, Q if 5/6 <= H < 1 where 0 <= H < 1 and 0 <= S, V, P, Q, T, R, G, B <= 1. Assuming a pixel in the source image is (h, s, v) and its corresponding pixel in the destination image is (r, g, b), then for MLIB_BYTE images, the following applies: H = h/256 S = s/255 V = v/255 r = R*255 g = G*255 b = B*255 for MLIB_SHORT images, the following applies: H = (h + 32768)/65536 S = (s + 32768)/65535 V = (v + 32768)/65535 r = R*65535 - 32768 g = G*65535 - 32768 b = B*65535 - 32768 for MLIB_USHORT images, the following applies: H = h/65536 S = s/65535 V = v/65535 r = R*65535 g = G*65535 b = B*65535 and for MLIB_INT images, the following applies: H = (h + 2147483648)/4294967296 S = (s + 2147483648)/4294967295 V = (v + 2147483648)/4294967295 r = R*4294967295 - 2147483648 g = G*4294967295 - 2147483648 b = B*4294967295 - 2147483648 PARAMETERS
The function takes the following arguments: dst Pointer to destination image. src Pointer to source image. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageColorHSV2RGB_Fp(3MLIB), mlib_ImageColorRGB2HSV(3MLIB), mlib_ImageColorRGB2HSV_Fp(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_ImageColorHSV2RGB(3MLIB)
All times are GMT -4. The time now is 02:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy