-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Ray,

Ohh - great! Thanks you! It seems, you are the first one, using a PIDDIR 
outside VARDIR/run :)

The patch is again appended as diff for all others having PIDDIR set other than 
VARDIR/run

Thanks

        - Peter

Ray Burkholder wrote:
>> Ray Burkholder wrote:
>>> At what point in the cycle between data capture and data viewing is 
>>> the live profile rrd data be updated?
>>>
>>> If I run './nfsend once' on each five minute interval, I 
>> can get the 
>>> rrd
>> Why do you run './nfsend once'??  There is no reason unless 
>> for maintainance work or very special setups.
> 
> I was playing with things trying to get things running.  This seemed to be
> the only way to make things work.
> 
>> You are missing the periodic updater and control process: 'nfsend'
>> Beside the collectors, you should see two nfsen processes running:
>>
>> netflow  28838  2.3  0.0 133288 20608 ?        Ss   Jun10 
>> 476:13 /usr/bin/perl -w /data/nfsen/bin/nfsend
>> netflow  28839  0.0  0.0 125724 14672 ?        Ss   Jun10   
>> 0:28 /data/nfsen/bin/nfsend-comm
>>
>> Check your log file, what went wront. nfsend sends famous 
>> last words to syslog if it dies.
> 
> Nfsend never issued any famous last words.  But stepping through the code
> made me realize that there a few changes needed to nfsend.  The
> etc/nfsen.conf file has a $piddir variable.  Nfsend does not, but should,
> use that variable.  Here is a diff delta to get nfsend to use the same pid
> directory as the other tools.  This is nfsend in 1.3.2.
> 
> nm02:/usr/local/nfsen/bin# diff nfsend.old nfsend
> 103c103
> <       unlink "$NfConf::VARDIR/run/nfsend.pid";
> ---
>>       unlink "$NfConf::PIDDIR/nfsend.pid";
> 748c748
> <       if ( -f "$NfConf::VARDIR/run/$pidfile" ) {
> ---
>>       if ( -f "$NfConf::PIDDIR/$pidfile" ) {
> 750,751c750,751
> <               open PID, "$NfConf::VARDIR/run/$pidfile" ||
> <                       die "Can't read pid file
> '$NfConf::VARDIR/run/$pidfile': $!\n";
> ---
>>               open PID, "$NfConf::PIDDIR/$pidfile" ||
>>                       die "Can't read pid file '$NfConf::PIDDIR/$pidfile':
> $!\n";
> 757c757
> <                       unlink "$NfConf::VARDIR/run/$pidfile";
> ---
>>                       unlink "$NfConf::PIDDIR/$pidfile";
> 769c769
> <       daemonize("$NfConf::VARDIR/run/$pidfile");
> ---
>>       daemonize("$NfConf::PIDDIR/$pidfile");
> 839,840c839,840
> < if ( $arg ne 'once' && -f "$NfConf::VARDIR/run/$pidfile" ) {
> <     unlink "$NfConf::VARDIR/run/$pidfile";
> ---
>> if ( $arg ne 'once' && -f "$NfConf::PIDDIR/$pidfile" ) {
>>     unlink "$NfConf::PIDDIR/$pidfile";
> 
> 
> I now see nfsend in my process list.
> 
> 

- --
_______ SWITCH - The Swiss Education and Research Network ______
Peter Haag,  Security Engineer,  Member of SWITCH CERT
PGP fingerprint: D9 31 D5 83 03 95 68 BA  FB 84 CA 94 AB FC 5D D7
SWITCH, Werdstrasse 2, P.O. Box,  CH-8021   Zurich, Switzerland
E-mail: [email protected] Web: http://www.switch.ch/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iQCVAwUBSkIcCP5AbZRALNr/AQJWIAQAlvickxvgvUmKMYLh+fscwbvrFg4CUG1D
2tJVhUZSNvPA/PBJmYwKIa7LsWfTga3Tqrqw4u8NVL4pYdQupSDUuM5DVs1IM5Jy
xXd2DD1mHMHs8G3hPxEcf6EE3Byk/ATlzo2mbIROfyzUnotBGTTzm1kxlmJZbHD7
JtbfJ3cZ740=
=VCot
-----END PGP SIGNATURE-----
--- nfsend.orig 2009-06-24 14:25:34.000000000 +0200
+++ nfsend      2009-06-24 14:26:12.000000000 +0200
@@ -100,7 +100,7 @@
                kill 'TERM', $comm_pid || warn "Can't signal comm server: $! ";
                wait;   # for comm server to terminate
        }
-       unlink "$NfConf::VARDIR/run/nfsend.pid";
+       unlink "$NfConf::PIDDIR/nfsend.pid";
 };
 
 sub SIG_CHILD {
@@ -745,16 +745,16 @@
 # When starting up, check if all the profiles are up to date till the last 
timeslot
 # then periodically update the profiles
 if ( $forever ) {
-       if ( -f "$NfConf::VARDIR/run/$pidfile" ) {
+       if ( -f "$NfConf::PIDDIR/$pidfile" ) {
                # there is a pid file .. check for the process
-               open PID, "$NfConf::VARDIR/run/$pidfile" || 
-                       die "Can't read pid file 
'$NfConf::VARDIR/run/$pidfile': $!\n";
+               open PID, "$NfConf::PIDDIR/$pidfile" || 
+                       die "Can't read pid file '$NfConf::PIDDIR/$pidfile': 
$!\n";
                my $pid = <PID>;
                chomp $pid;
                close PID;
                if ( kill( 0, $pid) == 0  ) {
                        print "Unclean shutdown of nfsend[$pid]\n";
-                       unlink "$NfConf::VARDIR/run/$pidfile";
+                       unlink "$NfConf::PIDDIR/$pidfile";
                } else {
                        print "nfsend[$pid] already running\n";
                        exit;
@@ -766,7 +766,7 @@
        # Check if configured sub hierarchy matches
        CheckSubHierarchy($hints);
 
-       daemonize("$NfConf::VARDIR/run/$pidfile");
+       daemonize("$NfConf::PIDDIR/$pidfile");
 
     if (!defined($comm_pid = fork)) {
         print STDERR "cannot fork: $!";

Attachment: patch-nfsen-1.3.2-001.txt.sig
Description: video/flv

------------------------------------------------------------------------------
_______________________________________________
Nfsen-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss

Reply via email to