NUT - Network UTility

Network

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

4
Score 77.8%
Description:

Update:
* [nuts] added support for wildcard and regexp device names
* [libnut*] switch to dynamic linked client library
+ added development lib
* [qnut] made settings more "standardized"
+ added support for compile flag to be not compatible with old settings: QNUT_SETTINGS_NOCOMPAT
* [qnut] changed scripting settings to more general device settings
+ device details cleanup
+ Former scripts witch were executed on device state change are substituted by command lists. In each list the user can now specify witch commands will be executed and each entry can either be a specific command or a directory with executables.
* some gerenal polishing, cleanup and as always: bugfixes

What NUT does:
* manages your network devices (dhcp with fallback, static, zeroconf); currently only supports IPv4 on Linux
* executes admin and user defined scripts for each device state
* manages your wireless connections (WPA supplicant)
* supports multiple network configurations (environments) for each device
* supports multiple ip-addresses (interfaces) for each environment

The idea behind:
If you have different working places, for example at home and university you have to mount network shares etc. manualy.
With NUT you don't have to do that anymore.

You can define environments that get selected by the server according to different statements.
So far the following statements are supported:
check for essid, check for ip, check for ip with mac-address.
Those statements can be combined with boolean operators.

Every time an event occures, scripts are executed accordingly (like the /etc/network scripts in debian).
The follwing events exist:
device state change: deactivated, activated, carrier, unconfigured, up
interface changes (admin only): ifup/ifdown,deactivated, activated, carrier, unconfigured, up

Requires:
* Qt 4.x (>= 4.4.0 recommended) with D-Bus support
* resolvconf
* libnl (server): please use stable version 1.1 (from http://people.suug.ch/~tgr/libnl/)
* libiw (client)

Consists of 6 Parts:
* nuts: Server
* libnutcommon: Library needed from server and client (static)
* libnutclient: Client library (static)
* libnutwireless: Client library for wpa_supplicant (static)
* qnut: Graphical client
* cnut: Console client

For some more general information have a look in this gentoo forum thread:
http://forums.gentoo.org/viewtopic-t-631415.html

See the download section for a config example for nuts.

Gentoo related:
Nut is also in the devnull overlay. To add it (using layman) do the following:
# layman -f && layman -a devnull
(Further instructions at http://devnull.core.ws/EbuildRepository)
To get an tagged version, just rename the ebuild to net-misc/nut-"version" (i.e. net-misc/nut-0.5.0)

Arch-Linux
An installation how-to for arch can be found at:
http://chakra-project.org/wiki/index.php/Get_NET_with_NUT

Known bugs:
* a fallback timeout of less than 10 seconds does not work (you can specify a timeout of less than 10 seconds but it's going to be ignored and set to 10 seconds)
* the new wlan stack isn't supported yet. Due to the almost non-existing compatibility between the old and new wlan stack, scanning for networks returns wrong results. All other wlan related things should work

Feel free to contact us if you find other bugs.

toadhall

8 years ago

Hi,

I just wondered, last entries from 2009 - is this project dead? I was thinking of giving it a go...

Report

IceRain

10 years ago

Hi, i packed nut to rpm and installed it.
Copied
install -m 644 resources/nuts-dbus.conf /etc/dbus-1/system.d/

install -m 644 nuts/dispatch /etc/nuts/dispatch
install -m 644 nuts/events/all/* /etc/nuts/events/all/
install -m 644 nuts/nuts.config /etc/nuts/

When i started /usr/sbin/nuts from root, i get:
Trying to set watch dir to "/var/run"
Pid file name is "dbus.pid"
Filedescriptor for inotify is 23
Connected SocketNotifier for inotify
Set dbus pid to: -1
(Inotify) Setting up watches
Setup Pid file dir watch with 1
Device(eth1) gotCarrier
Set next environment 0
Interface_IPv4::start
Device(eth1) is up!



And than i started /usr/bin/qnut from root:
Trying to set watch dir to "/var/run"
Pid file name is "dbus.pid"
Enabling DBusMonitor
Filedescriptor for inotify is 11
Connected SocketNotifier for inotify
Set dbus pid to: -1
(Inotify) Setting up watches
Setup Pid file dir watch with 1
Enabled DBusMonitor
setInformation()
Placing getDeviceList Call

And nothing more.

"QNUT - Qt client for Network UTility Server (NUTS) (v0.5.3) started"
in qnut's log tab.

Fri Nov 27 17:25:50 2009
My nuts.config file:
device "eth1" {
static {
ip 192.168.1.2;
netmask 255.255.255.0;
gateway 192.168.1.1;
dns-server 78.138.135.10;
};
};

ADSL modem with router and i have private adress, and haven't public.

Report

IceRain

10 years ago

(Inotify) Event occured
(Inotify) Reading
(Inotify) Read Resource temporarily unavailable 32
Filename is
"utmp"
Size: 4
(Inotify) modify file
Watch file descriptor is 1 from event 1
(Inotify) Done processing event

sometimes in nuts log

Report

IceRain

10 years ago

Oh, Sorry.My mistake...
I didn't copy cnut.bash_completion to /etc/bash_completion.d/

Report

C

Inphos

10 years ago

Does it work? The gentoo ebuild may be of some help to install nut properly.

Report

IceRain

10 years ago

Yes. All works. But in spec file i used mkdir for making folders.And depend "ntpdate-debian" is not correct, because you should edit scriptfile, id you have other distro...


My specfile:

http://www.pastebin.org/58674

P.S I translated qnut into Russian. Can you take that translation?

Report

IceRain

10 years ago

http://www.pastebin.org/58686
corrected one line)

Report

IceRain

10 years ago

qmake-qt4
make

../libnutclient/libnutclient.so: undefined reference to `iw_init_event_stream'
../libnutclient/libnutclient.so: undefined reference to `iw_ether_ntop'
../libnutclient/libnutclient.so: undefined reference to `iw_print_stats'
../libnutclient/libnutclient.so: undefined reference to
`iw_extract_event_stream'
../libnutclient/libnutclient.so: undefined reference to `iw_get_basic_config'
../libnutclient/libnutclient.so: undefined reference to `iw_freq2float'
../libnutclient/libnutclient.so: undefined reference to `iw_sockets_open'
../libnutclient/libnutclient.so: undefined reference to `iw_get_range_info'


rpm -qa|grep libnl
libnl-1.1-alt2.qa1
libnl-devel-1.1-alt2.qa1

rpm -qa|grep libNL
libNL-1.68-alt1
libNL-devel-static-1.68-alt1
libNL-devel-1.68-alt1

rpm -qa|grep wireless-tools
wireless-tools-29-alt8

rpm -qa|grep libwireless
libwireless-29-alt8
libwireless-devel-29-alt8

Help please!(NUT version 0.5.3)

Report

C

Inphos

10 years ago

Hi,
could you post the complete buildlog somewhere? (i.e. pastebin)

Report

IceRain

10 years ago

Hi, here you are!
http://www.pastebin.org/54823

Report

C

Inphos

10 years ago

Hi, we think, we've fixed the problem. Please try to build the latest head. You also need to install openresolv.

Report

IceRain

10 years ago

Yes, thanks to you. Now it builds correctly.

Report

IceRain

10 years ago

My qt version is 4.5.3...I'm going to pack it to rpm in this week.

Report

C

Inphos

10 years ago

Hi,
we're sorry, but we couldn't find a solution to your problem so far.
According to your compiler-output linking should work if you installed the correct library (libiw). The order of the linker flags are the same on our machines.

Which version of qt are using (though this shouldn't cause the problems)?

Wirelesstools, libwireless and libwireles-devel aren't corrupted?

Report

C

Inphos

10 years ago

Hi,
I put it in the bug tracker (https://redmine.stbuehler.de/issues/20) and we'll try to solve this soon.

We may need you're assistance though as it compiles on debian and gentoo.

Report

mattepiu

10 years ago

Gcc-4.1.1 complaints about sprintf not defined, followinf patch fixes (and is safe to add even with previous gcc..):


--- libnutcommon/macaddress.h.orig 2009-09-23 19:36:03.000000000 +0200
+++ libnutcommon/macaddress.h 2009-09-23 19:36:17.000000000 +0200
@@ -4,6 +4,7 @@
#include <QString>
#include <QDBusArgument>
#include <QHash>
+#include <stdio.h>
extern "C" {
#include <net/ethernet.h>
}

Report

Amnon82

10 years ago

I'm a maintainer from the chakra-project
Michal and I just finished a PKGBUILD for arch linux.

You can read our progress here:

http://chakra-project.org/bbs/viewtopic.php?id=765

I still dont get wlan working on my machine. With wicd it works. We patched your app a little to fit the arch way.

... hope it is just a missconfiguration.

Arch-People, can you test our PKGBUILDs I committed to AUR? Report back with any comment ....

Report

Amnon82

10 years ago

I got it working. Check out our wiki:

http://chakra-project.org/wiki/index.php/Get_NET_with_NUT

Report

C

Inphos

10 years ago

Nice. Thank you very much for your work. I will add a link to your page in the app description :)

Report

DRerAGO

10 years ago

How can I install NUT on Arch?
Thanks

Report

FrozenFox

10 years ago

I actually made NUT pkgbuilds and such. I will post them up on the forums in the pkgbuilds section a little bit later if the bug (assuming its a bug and not an error on my part) where the client can't find the server is resolved. I will test again soon and find out.

Report

FrozenFox

10 years ago

On adding another minor patch to include stdio.h in macaddress.h, it compiles as expected.. however, same problem as the last version.

QNUT - Qt client for Network UTility Server (NUTS) (v0.5.0) started
Fri May 8 19:47:16 2009
Please start nuts. Starting idle mode

It IS bloody running! The process exists, and so does /var/run/daemons/nuts :p

Also, I'm not sure why it has 0.5.0 there, as it's certainly the 0.5.1 unless the link is lying and nut-0.5.1.tar.bz2 is 0.5.1.

Report

C

Inphos

10 years ago

Hi,
thanks for trying to create a pkgbuild.
Unfortunatelly we never encountered the problems you have. It compiles fine on 3 different debian pcs (amd64+i686) and on 2 different gentoo pcs (amd64+i686).
We can confirm that it works on at least 5 debian and 2 gentoo machines.
Have you tried running nuts in a console as well as qnut? nuts config files and dbus config files are put in the right place? qnut has sufficient rights (though it looks like as if nuts can't connect to dbus)?

Report

FrozenFox

10 years ago

Grrrrr, that's SO SO irritating when these sites erase my comment because it took a while to type and I need to log in again. 2ifh2io3ho32ifh32fff3-29jf-49of4

My prior post should've been: I'm not sure why it has 0.5.0 there; it's certainly 0.5.1 unless the link is lying and nut-0.5.1.tar.bz2 is 0.5.0.

Anyway..

"Have you tried running nuts in a console as well as qnut?"

Yes. It reports:

Try setting watch dir to "/var/run"
Pid file name is "dbus.pid"
Filedescriptor for inotify is 23
Connected SocketNotifier for inotify
Set dbus pid to: 4901
(Inotify) Setting up watches
Setup Pid file dir watch with 1
Device(eth0) gotCarrier
Set next environment 0
Interface_IPv4::start
Device(eth0) is up!

Btw, might I suggest "Trying to set watch dir to" instead of its current message? I got the impression that it was telling -me- to do something, not that the program was trying to do something (which seems to be the actual behavior) and spent some time looking around to be sure.

"nuts config files and dbus config files are put in the right place?"

Nuts config file is in the right place, as the devices in it are reported as "up" and nuts no longer nags about it. As for dbus stuff, I don't know what you're referring to or where to start looking, but something like that was mentioned on the KDEmod/Chakra forum link. I'll wait for them to post their stuff, which will probably fix that. Or post mine in a week or so if someone else wants to try to figure it out if they haven't done that by then. In any case, answering that question might help others with the same issue on other distros.

"qnut has sufficient rights (though it looks like as if nuts can't connect to dbus)?"

Running qnut with kdesu produced the same results, as did making the group mentioned a few posts above and adding myself to it (+ reboot just in case).

Report

C

Inphos

10 years ago

I can't reply to your last comment so I'll this here.
I've tried it myself to find out which files are realy necessary. Here's what I did:
daniel@daniel ~/nut $ git clone git://stbuehler.de/nut.git
remote: Counting objects: 6472, done.
remote: Compressing objects: 100% (1913/1913), done.
remote: Total 6472 (delta 4791), reused 6104 (delta 4527)
Receiving objects: 100% (6472/6472), 5.11 MiB | 686 KiB/s, done.
Resolving deltas: 100% (4791/4791), done.
daniel@daniel ~/nut $ cd nut
daniel@daniel ~/nut/nut $ ls
cnut debian docs gentoo libnutclient libnutcommon libnutwireless nut.pro nuts presentation qnut resources
daniel@daniel ~/nut/nut $ qmake -r
Reading /home/daniel/nut/nut/libnutcommon/libnutcommon.pro
Reading /home/daniel/nut/nut/libnutwireless/libnutwireless.pro
Reading /home/daniel/nut/nut/libnutclient/libnutclient.pro
Reading /home/daniel/nut/nut/nuts/nuts.pro
Reading /home/daniel/nut/nut/qnut/qnut.pro
Reading /home/daniel/nut/nut/cnut/cnut.pro
daniel@daniel ~/nut/nut $ make
<a lot of compiler output>
daniel@daniel ~/nut/nut $ cd qnut/
daniel@daniel ~/nut/nut/qnut $ ./qnut
Try setting watch dir to "/var/run"
Pid file name is "dbus.pid"
Enabling DBusMonitor
Filedescriptor for inotify is 9
Connected SocketNotifier for inotify
Set dbus pid to: 3486
(Inotify) Setting up watches
Setup Pid file dir watch with 1
Enabled DBusMonitor
Cannot open file '/usr/share/qnut/icons/qnut_small.svg', because: No such file or directory
Cannot open file '/usr/share/qnut/icons/qnut_small.svg', because: No such file or directory
<after nut start>
setInformation()
Placing getDeviceList Call
essid feteched
Properties feteched
config feteched
essid feteched
Properties feteched
"Environmentname: "
activeenv fetched
activeenv fetched
InterfaceInit completed
Feteched all Interfaces
EnvironmentInit completed: ""
Device init completed: "eth0"

As root:
daniel nut # mkdir /etc/nuts
daniel nut # echo 'device "eth0";' > /etc/nuts/nuts.config
daniel nut # cp resources/nuts-dbus.conf /etc/dbus-1/system.d/
daniel nut # cd nuts/
daniel nuts # ./nuts
Try setting watch dir to "/var/run"
Pid file name is "dbus.pid"
Filedescriptor for inotify is 23
Connected SocketNotifier for inotify
Set dbus pid to: 3486
(Inotify) Setting up watches
Setup Pid file dir watch with 1
Device(eth0) gotCarrier
Set next environment 0
Interface_IPv4::start

The netdev goup has been created before.

qnut doesn't have any symbol, but that doesn't matter, it works anyway.

Report

12345678910
113
product-maker StarterX4 May 25 2015 3 bad
product-maker hello98 Nov 05 2013 9 excellent
product-maker mea5 Nov 05 2013 9 excellent
product-maker VilleVallo Oct 28 2013 9 excellent
product-maker mannfree Oct 28 2013 9 excellent
product-maker qwertzui Oct 28 2013 9 excellent
product-maker freelancer96 Oct 28 2013 9 excellent
product-maker popcon Oct 25 2013 9 excellent
product-maker frodoom Oct 25 2013 9 excellent
product-maker nobrain Oct 25 2013 9 excellent
product-maker dergnome Oct 25 2013 9 excellent
product-maker Mira Oct 24 2013 9 excellent
product-maker thwald Oct 23 2013 9 excellent
product-maker sixsixfive Oct 21 2013 9 excellent
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
brezerk
Jun 14 2010
IceRain
Dec 29 2009
kochka22
Dec 26 2009
Frank
Jan 02 2009
File (click to download) Version Description PackagetypeArchitectureRelease Channel Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.5.3
updated Nov 18 2009
added Mar 31 2008
downloads 24h
0
mediaviews 24h 0
pageviews 24h 5
System Tags app software