Monday, June 4, 2012

Nsn - network status notifier


nsn is a tool written for reporting changes in network interfaces. Nsn can be used to monitor changes in

- interfaces
- addresses
- routes
- neighbor cache
- rules

and possibly some other network stack related features.

Nsn can also be used to execute commands when state changes are observed.
Nsn is written in c, and usees netlink sockets to receive change notifications from kernel. Hence nsn is quite natural continuation to my netlink introduction post, and its sources are written so they can be used as simple netlink socket usage example.

12.09.2012 - Created version 0.2-1 which performs some checks for compatibility at compile time => does not require such state of the art kernel to compile. Also compiled against older kernel to make static binary work with older kernels.
28.08.2012 - I added version 0.2 as a downloadable tarball. It contains sources and a statically linked binary for x86. NOTE: NSN requires pretty new linux kernel to operate. You can download tarball from here:

nsn can be obtained from svn repository:
Trunk (constantly changing - I suggest using most recent tag for other but development purposes)and
Download with svn client by typing

svn checkout
Version 0.2

Download with svn client by typing

svn checkout
Version 0.1:
Download with svn client by typing
svn checkout

You can also try downloading static binary for x86 architecture:
But this leaves you without man pages, sources and Makefile.
Compilation should be equally easy (just go to folder trunk and type make and optionally make install which generates man pages and installs binaries). NSN really depends only on librt (for getting accurate timings for events) and compilation should thus be fairly painless. In case you find any problems, just give me a nudge in comment section below =) Oh, I keep forgetting -static flag in Makefile. If you fail with linking, please try changing line

LDFLAGS=-lrt -static

NOTE: This is just first development version, thus it may not be bugfree. Also there is no tags created from trunk yet, so software is subject to frequent changes. I'll update links here when first frozen version is out.
NOTE2: today 07. June 2012 I created first tag since I need to leave the trunk in non compiling state for a day or two... Sorry for premature tag mates :( I'll try to put up 0.2 as quickly as I can
NOTE3: I had forgot -static flag to 0.1 tag and it may cause problems with linking.
Man page also available online at



  1. Trunk is compiling again. And most of the features for version 0.2 are in (although untested). Trunk can be found from

  2. Please leave me a note if you encounter any bugs. (Mazziesaccount, gmail). Of course it would also be nice to hear if this worked for you =)