nfsen icon indicating copy to clipboard operation
nfsen copied to clipboard

NfSen error

Open fatherfbi opened this issue 2 years ago • 4 comments

Hi Peter! There are 2 errors

root@nfsen:/# /opt/nfsen/bin/nfsen reconfig Argument "-z=lz4" isn't numeric in numeric eq (==) at /opt/nfsen/libexec/NfConf.pm line 236.

Start/restart collector on port '9422' for (nas2)Use of uninitialized value $nfdump_version in numeric eq (==) at /opt/nfsen/libexec/NfSenRC.pm line 88. Use of uninitialized value $nfdump_version in numeric eq (==) at /opt/nfsen/libexec/NfSenRC.pm line 121. -l is a legacy option and may get removed in future. Please use -w to set output directory [225518]

fatherfbi avatar Mar 11 '24 10:03 fatherfbi

I'm seeing similar problems using FreeBSD's 1.3.11 package. It seems to stem from the fact that the hints file in /usr/local/var/nfsen/profiles-stat doesn't appear to have any useful data in it. It's read by the code for multiple tasks but I don't know where it's supposed to get updated with relevant local configuration values.

# nfsen reconfig
/
Remove configured sources: xxxx
Continue? [y/n] y
Delete source(s): xxxx:
Delete source 'xxxx' Use of uninitialized value $port in concatenation (.) or string at /usr/local/libexec/nfsen/NfSenRC.pm line 365.
Use of uninitialized value $port in exists at /usr/local/libexec/nfsen/Nfsources.pm line 275.

# service nfsen restart
Shutdown nfcapd: ()[20288]. .
Shutdown nfsend:[58729].
Starting nfcapd:(xxxx)Use of uninitialized value $nfdump_version in numeric eq (==) at /usr/local/libexec/nfsen/NfSenRC.pm line 88.
Use of uninitialized value $nfdump_version in numeric eq (==) at /usr/local/libexec/nfsen/NfSenRC.pm line 121.
-l is a legacy option and may get removed in future. Please use -w to set output directory

kjeacle avatar Mar 19 '24 15:03 kjeacle

@fatherfbi - hmm -- I assume, your nfsen version is too old or nfdump too new. You should use the latest main repo. That should work with nfdump-1.7.x.

phaag avatar Mar 23 '24 13:03 phaag

@phaag I use nfdump v1.7.4 and nfsen v1.3.10, system Ubuntu 22.04.4 LTS

fatherfbi avatar Mar 23 '24 15:03 fatherfbi

FWIW, the FreeBSD issue is that there is no install.pl used or included in the binary package so the hints file is never initialised. Not ideal but the following code will set some hardcoded values so that the other components don't complain.

#!/usr/bin/env perl

use lib "/usr/local/libexec/nfsen";
use NfSen;

my $hints = NfSen::LoadHints();

$$$hints{'subdirlayout'} = 1;
$$$hints{'nfdump'} = 7;
$$$hints{'version'} = "1.3.11";
$$$hints{'installed'} = time();

NfConf::LoadConfig("/path/to/nfsen.conf");
foreach my $source ( sort keys %NfConf::sources ) {
    my $port = $NfConf::sources{$source}{'port'};
    $$$hints{'sources'}{$source} = $port;
}

NfSen::StoreHints();

kjeacle avatar May 02 '24 12:05 kjeacle

So, maybe the FreeBSD package could be patched accordingly.

phaag avatar Jun 01 '24 07:06 phaag