- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script to gather some lan information in HPUX ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2009 12:54 AM
тАО07-15-2009 12:54 AM
I am trying to write a script to gather information about standby lan cards in clusters. I need to check which lans are standby and I need to obtain the values of MTU for these lans to pass them to a tcpdump:
tcpdump -i
I can obtain the standby lan cards from:
server1:/># cmviewcl -v |grep STANDBY | awk '{print$4}'
lan7
lan8
..and the MTU from:
server1:/># for i in `cmviewcl -v |grep STANDBY | awk '{print$4}'`^Jdo^Jnetstat -in | grep $i | awk '{print$1$2}'^Jdone
lan7*1500
lan8*1500
But I did not do shell scripting for a long time and I do not remember how to pass these values to the tcpdump. Any help will be appreciated !
Regards,
Solved! Go to Solution.
- Tags:
- tcpdump
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2009 01:45 AM - edited тАО08-28-2011 09:52 PM
тАО07-15-2009 01:45 AM - edited тАО08-28-2011 09:52 PM
Solution>I do not remember how to pass these values to the tcpdump.
for i in $(cmviewcl -v | grep STANDBY | awk '{print $4}'); do
netstat -in | grep $i | awk'{print $1, $2}') |
read LAN MTU dummy
tcpdump -i $LAN -n -v -s $MTU -c 1 'ether[20:2] == 0x2000'
done
(I'm not sure why you had a "*" between the two?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2009 02:03 AM
тАО07-15-2009 02:03 AM
Re: Script to gather some lan information in HPUX 11.11 - 11.23
netstat -in | grep $i | awk '{print $1, $2}') |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2009 02:33 AM
тАО07-15-2009 02:33 AM
Re: Script to gather some lan information in HPUX 11.11 - 11.23
Thank you very much! I had to add a "sed" to get rid of the "*", so the script is:
>for i in `cmviewcl -v |grep STANDBY | awk '{print$4}'`
>do
>netstat -in |sed 's/*//'| grep $i | awk '{print $1,$2}' | read LAN MTU dummy
>/usr/local/sbin/tcpdump -i $LAN -n -v -s $MTU -c 1 'ether[20:2] == 0x2000'
>done
..and now it works.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2009 03:31 AM
тАО07-15-2009 03:31 AM
Re: Script to gather some lan information in HPUX 11.11 - 11.23
You can change awk to do that, also the grep.
Where is the "*", attached to field $1 or $2?