Update:
I have tested this, and indeed it looks like port-tracker doesn't work
with nfsen 1.3.9 / nfdump 1.7.1 out-of-the-box.
I don't know what your system shows, but I get these in syslog:
Mar 6 16:50:15 noc nfsen[15762]: /usr/local/bin/nftrack -L local3 -M
/var/nfsen/profiles-data/live/bdr1 -r nfcapd.202303061645 -d
/var/ports-db -A -t 202303061645 -s -p -w /var/ports-db/portstat.txt
...
Mar 6 16:50:15 noc nfsen[15762]: nftrack exited with value 255
Mar 6 16:50:15 noc nfsen[15762]: /usr/local/bin/nftrack -d
/var/ports-db -S -p -w /var/ports-db/portstat24.txt
Mar 6 16:50:15 noc nfsen[15762]: nftrack exited with value 0
Hence: the second instance of nftrack (which updates portstat24.txt)
works, but the first one doesn't.
Using strace, I can see that nftrack is failing with this error:
[pid 17817] newfstatat(AT_FDCWD, "/var/nfsen/profiles-data/live/bdr1",
{st_mode=S_IFDIR|0775, st_si
ze=58, ...}, 0) = 0
[pid 17817] newfstatat(AT_FDCWD, "nfcapd.202303061655", 0x7ffc5cec5f60,
0) = -1 ENOENT (No such fil
e or directory)
[pid 17817] write(2, "path does not exist: nfcapd.202303061655\n", 41) = 41
[pid 17817] exit_group(255) = ?
[pid 17817] +++ exited with 255 +++
I guess there has been a change in behaviour: it's complaining that the
named file does not exist, without trying the full path
/var/nfsen/profiles-data/live/bdr1/2023/03/06/nfcapd.202303061655
Looking in the source code for nftrack in v1.6.25, I can see:
- the -r flag just sets variable 'rfile'
- rfile is passed as the middle argument to SetupInputFileSequence (char
*single_file)
- if this file can't be opened, then GuessSubDir is called
- this tries a range of subdirectory patterns from subdir_def, including
"%Y/%m/%d"
A similar GuessSubDir logic exists in nfdump master branch. However, it
is defeated by this additional check:
case 'r':
* if (!CheckPath(optarg, S_IFREG)) exit(255);*
flist.single_file = strdup(optarg);
break;
I think that removing that line and recompiling nfdump would sort the
problem, and a quick test suggests that it does:
Mar 06 17:15:15 noc nfsen[21205]: PortTracker run: Profile: live, Time:
202303061710
Mar 06 17:15:15 noc nfsen[21205]: /usr/local/bin/nftrack -L local3 -M
/var/nfsen/profiles-data/live/bdr1 -r nfcapd.202303061710 -d
/var/ports-db -A -t 202303061710 -s -p -w /var/ports-db/portstat.txt
Mar 06 17:15:17 noc nfsen[21205]: nftrack exited with value 0
Mar 06 17:15:17 noc nfsen[21205]: /usr/local/bin/nftrack -d
/var/ports-db -S -p -w /var/ports-db/portstat24.txt
Mar 06 17:15:17 noc nfsen[21205]: nftrack exited with value 0
Mar 06 17:15:17 noc nfsen[21205]: PortTracker run: Done.
I'll raise this on the nfdump tracker.
Regards,
Brian.
_______________________________________________
Nfsen-discuss mailing list
Nfsen-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss