[Nfsen-discuss] strange message when using the testplugin tool
Netflow visualisation and investigation tool
Brought to you by:
phaag
|
From: Maurizio M. <mau...@da...> - 2006-08-18 17:16:05
|
Hi,
I get this strange message when using the testplugin tool:
[flowtest@srv3 bin]$ ./testPlugin -p dummy_plugin1 -P 'live' -t 200608171200
Name "NfConf::BACKEND_PLUGINDIR" used only once: possible typo at
./testPlugin line 129.
Load plugin 'dummy_plugin1' : Success
Can't locate object method "Init" via package "dummy_plugin1" (perhaps
you forgot to load "dummy_plugin1"?) at ./testPlugin line 96.
the dummy_plugin1 is really dummy (I just wanted to print the timeslot
in a file. But id doesn't seem to work):
#!/usr/bin/perl
package demoplugin;
use strict;
use NfSen;
use NfConf;
#
# The plugin may send any messages to syslog
# Do not initialize syslog, as this is done by
# the main process nfsen-run
use Sys::Syslog;
Sys::Syslog::setlogsock('unix');
sub run {
my $profile = shift;
my $timeslot = shift; # Format: yyyymmddHHMM
# Do whatever you want to do.
my $out_file_name =
"/opt/flowtest/tools/nfsen/1.2.4/plugins/prova_out_plugin";
open (out_file, ">$out_file_name") || die 'could not open output file';
print out_file "Current timeslot: $timeslot\n";
close (out_file);
}
sub Init {
return 1;
}
1;
If I try to install and load the plugin, nothing happens, despite not
receiving any error message...
nfsen.conf:
@plugins = (
['live','dummy_plugin1'],
);
[flowtest@srv3 bin]$ ./nfsen reload
Restart nfsen-run
Restart nfsen-run[23908]
any hint?
Thanks,
Maurizio
|