Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6549773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:08:03+00:00 2026-05-25T12:08:03+00:00

I am writing a Python Application running on linux. I want to be able

  • 0

I am writing a Python Application running on linux. I want to be able to register and be notified by the system if a network cable is plugged in/ out.

I am already using pyUdev (python bindings for libUdev) in order to get notified for USB plug in events. However, because the network eth0 module (for example) always remains loaded (regardless of the cable being plugged in) , I dont get the information I require. It only works for if up/down events.

I have read a lot of posts on Windows WMI providing this functionality but none on linux. Am I looking in the right direction?

A python way of doing this (a python library) would be ideal as I want to integrate this with my program.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:08:04+00:00Added an answer on May 25, 2026 at 12:08 pm

    There are many ways to get the “UP” status of a network interface via polling, ranging from simply parsing ifconfig output, to reading the status of /proc/net/… pseudo-files.

    However, for a way to be notified (i.e. not poll yourself) for such events, your best option on Ubuntu is to use the netplug package. It’s not installed by default, you need to:
    sudo apt-get install netplug

    Some documentation is here: http://manpages.ubuntu.com/manpages/lucid/man8/netplugd.8.html

    To set it up you need to tweak /etc/netplug/netplugd.conf and /etc/netplug/netplug scripts. For an example of those config files check out the section “Configuring netplug” at http://natisbad.org/dyn-net/index.html

    With /etc/netplug/netplug you can have your own python script called when the network goes down/up, so you can generate your kind of event for your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm re-writing a legacy Windows application using Python and running on Linux. Initially, the
I'm writing a GUI application in Python using wxPython and I want to display
I'm developing a long-running multi-threaded Python application for Windows, and I want the process
I'm running OS X 10.6.7, Python 2.6, and writing a small wxPython application that
I'm writing a Python application that takes a command as an argument, for example:
I am writing a simple Python web application that consists of several pages of
I'm writing a mapping application that I am writing in python and I need
I'm coding the menu for an application I'm writing in python, using wxPython libraries
I'm writing a web application in Python, intended for use by teachers and pupils
I'm writing a log collection / analysis application in Python and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.