How to retrieve network link status from Kernel?


 
Thread Tools Search this Thread
Operating Systems Solaris How to retrieve network link status from Kernel?
# 1  
Old 01-18-2010
How to retrieve network link status from Kernel?

I have need for a reliable and easy way to get from within a script, or a java class, the status of the network interface cards (whether the link is up, or down).
I believe the kernel status would be quicker to know if they were up or down rather than if a ping simply didnt respond back.
My brain lately has been on hold and need some ideas and mabye code sample. Thanks.
# 2  
Old 01-18-2010
This will display the link status for all network interfaces from the kernel:
Code:
kstat -c net -s link_up

# 3  
Old 01-18-2010
Try,

dladm show-dev| awk '{print $1,t,$2,t,$3}'

if using Solaris 10.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Link aggregation and status of network interfaces in “ipadm” command

I am again rephrasing the issue that we are facing: We are creating link aggregations with two interfaces named net0 & net5: # dladm create-aggr -m dlmp -l net0 -l net5 -l net2 aggr1 Setting prob targets for aggr1: # dladm set-linkprop -p probe-ip=+ aggr1 Setting failure detection... (3 Replies)
Discussion started by: amitanshu.verma
3 Replies

2. Shell Programming and Scripting

Network script for ping status

Actually I am using Red hat Linux 4.4 version. I want to check the 16 client pc status of connection from server.Whether the connection is available or not.I tried to develop the shell script for this code.But It don't work properly.I am a self study learner.Please give me a shell script for this... (9 Replies)
Discussion started by: kannansoft1985
9 Replies

3. Red Hat

RHEL4 on VM cannot get status network link down

Hi All, RHEL4 on VM cannot get status network link down. when I unplug network cable. - ESX found interface down - but VM RHEL4 not detect that !, It show still up (mii-tool) Please help share you idea for my case. ESXi 5.1.0, RHEL4 Thank you, (3 Replies)
Discussion started by: arm_naja
3 Replies

4. Solaris

Link status turning up and down continously

Hi All, Happy New Year. I have a weird situation in one of my servers.The OS is solaris 10 We don't have bcme1 interface configured/plumbed on that system but every 5 second i get this message in /var/adm/messages Jan 4 20:22:45 XXXX bcme: NOTICE: bcme1 : Link is Up (1000Mbps, Full... (3 Replies)
Discussion started by: Jartan
3 Replies

5. Solaris

HOW-TO Retrieve all network interfaces??!

Yes. But just wait a bit. How to do it via system calls? I'm just a newbie in Unix\Linux\Solaris e.t.c. programming. Can anyone help me? I need an advice probably how to do it or may be what API to read... :) Please, help... (2 Replies)
Discussion started by: LocalStorm
2 Replies

6. UNIX for Advanced & Expert Users

Speed of network link

Sorry to keep bothering you guys like this with all these boring, related questions. But here's one that should be more readily answerable. What command or file should i use to get the speed/data rate of a network link? This is the capacity speed for instance 10Mbps or 100 Mbps in the case of the... (2 Replies)
Discussion started by: mint1981
2 Replies

7. Shell Programming and Scripting

Multiple Network Card Status Script

I have multiple Sun Solaris 8 systems running multiple network cards. (Mix of quad and gig cards.) What I would like to do is create a monitor script to ensure high availability of these cards. Has anyone ever had a situation like this? I was thinking of using the ping command, but am... (1 Reply)
Discussion started by: Krusty
1 Replies

8. UNIX for Advanced & Expert Users

Network Status

Hi, My system ( Solaris 2.6, Entrerprise 250 ) shows lot of connections in TIME_WAIT status against service localhost.8007 and localhost.45221 What are these services and where can I get the cross references. I have checked up in /etc/services and there is no such entry. Infact... (5 Replies)
Discussion started by: shibz
5 Replies
Login or Register to Ask a Question