Anuket Project

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This plugin utilizes the Netlink library to monitor network interface up/down status.  Current configuration options include:

  1. Interface: A network interface to monitor for status changes.

If no interfaces are configured, then all interfaces will be monitored.  While running, two threads are used:

  1. The main read thread, to read semaphore-protected shared memory.
  2. A blocking listening thread that waits for interface status messages on a Netlink socket.  When a message is received, it is placed in shared memory (a ring buffer).

A linked list of interface name and status combinations is stored in shared memory.  The Netlink-listening thread waits for incoming messages and either:

  1. Ignores the message if it doesn't pertain to a monitored interface.
  2. If the interface is monitored and the name is not already in the linked list, adds the interface name and status to the aforementioned list.
  3. If the interface is monitored and the name is already in the linked list, updates the status for the corresponding entry.

Whenever a monitored interface's status changes, the corresponding entry is flagged as unsent.  The read thread wakes at the plugin interval and loops through the linked list of interface names and statuses.  Any unsent status change is dispatched via a notification, and the interface status is then marked as sent.

  • No labels