help me configure plugins flowview 1.0-1

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
luisma75111
Posts: 13
Joined: Fri Oct 05, 2012 9:29 am

help me configure plugins flowview 1.0-1

Post by luisma75111 »

Hi

I have installed cacti version 0.8.7g
plugins flowview-v1.0-1.tgz


1. Plugin enable flowview
enable-flowview .png
enable-flowview .png (89.05 KiB) Viewed 13025 times
2. Create the directory

mkdir -p /var/flows/myrouter
create-directory.png
create-directory.png (53.39 KiB) Viewed 13025 times
3. Install the package flow-tools

4. Rewrite the flow-capture file

cp /usr/share/cacti/site/plugins/flowview/flow-capture /etc/init.d/

5. Configure the flow-capture.conf

nano /etc/flow-tools/flow-capture.conf

add

-V 5 -E 5G -N 3 -w /var/flows/myrouter 0.0.0.0/10.0.108.4/2055

6. Database amount

cd /usr/share/cacti/site/plugins/flowview

shell# mysql -u root -p

mysql> create database flowview;
mysql> use flowview;
mysql> source flowview.sql;

7. Restart the service

/etc/init.d/flow-capture start

NOTE: Starting Flow Tools
NOTE: Making directory '/var/flows/myrouter//var/flows/myrouter'
PHP Warning: mkdir(): No such file or directory in /etc/init.d/flow-capture on line 54




I think these are the right steps but the show is to see who can help me
What else should I do? :cry:
flows.png
flows.png (38.43 KiB) Viewed 13025 times

thanks
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: help me configure plugins flowview 1.0-1

Post by paulgevers »

luisma75111 wrote:NOTE: Making directory '/var/flows/myrouter//var/flows/myrouter'
PHP Warning: mkdir(): No such file or directory in /etc/init.d/flow-capture on line 54
Have you verified what is on line 54 and have you maybe created this file or folder by hand?
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
luisma75111
Posts: 13
Joined: Fri Oct 05, 2012 9:29 am

Re: help me configure plugins flowview 1.0-1

Post by luisma75111 »

the original file in line 54 contains

mkdir ("$path/$folder");

is changed to

mkdir ("/var/flows/myrouter")

restart and I get

NOTE: Making directory '/ var / flows / myrouter / / var / flows / myrouter'
PHP Warning: mkdir (): No such file or directory in / etc / init.d / flow-capture on line 54

also try the original script I get the same error

according to the help file of Jimmy Conner

Next copy the 'flow-capture' file in the flowview plugin directory to '/etc/init.d/'
or the appropriate location. You have to edit this file to set the cacti base path.

need to edit the file, but not in that line of script
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: help me configure plugins flowview 1.0-1

Post by paulgevers »

luisma75111 wrote:the original file in line 54 contains

mkdir ("$path/$folder");

is changed to

mkdir ("/var/flows/myrouter")

restart and I get

NOTE: Making directory '/ var / flows / myrouter / / var / flows / myrouter'
PHP Warning: mkdir (): No such file or directory in / etc / init.d / flow-capture on line 54
You are still getting the error, I bet it is a permission issue. Please try to create the folder by hand. (And revert the script.
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
luisma75111
Posts: 13
Joined: Fri Oct 05, 2012 9:29 am

Re: help me configure plugins flowview 1.0-1

Post by luisma75111 »

changes back to the original script

create the file by hand

mkdir -p /var/flows/myrouter

/etc/init.d/flow-capture restart

NOTE: Stopping Flow Tools
NOTE: Starting Flow Tools
WARNING: No configured flows
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: help me configure plugins flowview 1.0-1

Post by gandalf »

Moving to plugins
R.
luisma75111
Posts: 13
Joined: Fri Oct 05, 2012 9:29 am

Re: help me configure plugins flowview 1.1-1

Post by luisma75111 »

tar xvf flowview-v1.1-1.tgz

mv flowview /usr/share/cacti/site/plugins

cp /usr/share/cacti/site/plugins/flowview/flow-capture /etc/init.d/

I then edit the flow-capture

nano /etc/init.d/flow-capture

but not that I modify lines for the cactus begins to show catches



1 #!/usr/bin/php
2 <?php
3 /*
4 # description: Start Flow-Capture
5 # chkconfig: 2345 95 00
6 */
7
8 $cacti_base = '/usr/share/cacti/site';
9
10 include_once($cacti_base . '/include/global.php');
11
12 $tools_path = read_config_option("path_flowtools");
13
14 if (isset($_SERVER['argv'][1])) {
15 switch (strtolower($_SERVER['argv'][1])) {
16 case 'start':
17 start();
18 break;
19 case 'stop':
20 stop();
21 break;
22 case 'restart':
23 restart();
24 break;
25 default:
26 echo "Usage: /etc/init.d/flow-capture {start|stop|restart}\n";
27 break;
28 }
29 }
30
31 function start() {
32 global $tools_path, $cacti_base;;
33
34 echo "NOTE: Starting Flow Tools\n";
35 $devices = db_fetch_assoc("SELECT * FROM plugin_flowview_devices");
36 if (!empty($devices)) {
37 $path = db_fetch_cell("SELECT value FROM `settings` WHERE name = 'path_flows_dir'");
38 if ($path == '')
39 break;
40 if (substr($path, -1) == '/') {
41 $path = substr($path, 0, -1);
42 }
43 foreach ($devices as $device) {
44 $port = $device['port'];
45 $folder = $device['folder'];
46 $nest = $device['nesting'];
47 $v = $device['version'];
48 $from = $device['allowfrom'];
49 $comp = $device['compression'];
50 $rotate = $device['rotation'];
51 $expire = $device['expire'] * ($rotate + 1);
52 if (!is_dir("$path/$folder")) {
53 echo "NOTE: Making directory '$path/$folder'\n";
54 mkdir("$path/$folder");
55 }
56 if (is_dir("$path/$folder")) {
57 echo "NOTE: Launching flow-capture as '$tools_path/flow-capture -w $path/$folder 0/$from/$port -S5 -V$v -z $comp -n $rotate -e $expire -N $nest'\n";
58 shell_exec($tools_path . "/flow-capture -w $path/$folder 0/$from/$port -S5 -V$v -z $comp -n $rotate -e $expire -N $nest");
59 }
60 }
61 }else{
62 echo "WARNING: No flows configured\n";
63 }
64 }
65
66 function stop() {
67 global $tools_path, $cacti_base;;
68
69 echo "NOTE: Stopping Flow Tools\n";
70 $devices = db_fetch_assoc("SELECT * FROM plugin_flowview_devices");
71 if (!empty($devices)) {
72 shell_exec('killall -9 ' . $tools_path . '/flow-capture');
73 }
74 }
75
76 function restart() {
77 stop();
78 start();
79 }
luisma75111
Posts: 13
Joined: Fri Oct 05, 2012 9:29 am

Re: help me configure plugins flowview 1.0-1

Post by luisma75111 »

unsuccessfully tried yet
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: help me configure plugins flowview 1.0-1

Post by cigamit »

first, your path is wrong in the settings. Change the path to /var/flows/

then, the other thing you have not shown, is what listeners you have setup in the plugin. Make sure the directory in the listener is set to "myrouter" not the full path.
luisma75111
Posts: 13
Joined: Fri Oct 05, 2012 9:29 am

Re: help me configure plugins flowview 1.0-1

Post by luisma75111 »

first, your path is wrong in the settings. Change the path to /var/flows/ ( ready and modify it )

then, the other thing you have not shown, is what listeners you have setup in the plugin. Make sure the directory in the listener is set to "myrouter" not the full path. ( these are the steps I'm working )


1. edit nano /etc/flow-tools/flow-capture.conf

add

-V 5 -E 5G -N 3 -w /var/flows 0.0.0.0/10.0.108.4/2055

2. then

/etc/init.d/flow-capture restart

Stopping flow-capture: flow-capture.
Starting flow-capture: flow-capture.

3. verify the catch in the directory created

root@debian:/var/flows# ls
2012

4. So far so good but it is not what I need then

cp /usr/share/cacti/site/plugins/flowview/flow-capture /etc/init.d/

5. restart

/etc/init.d/flow-capture restart

NOTE: Stopping Flow Tools
NOTE: Starting Flow Tools
NOTE: Making directory '/var/flows//var/flows'
PHP Warning: mkdir(): No such file or directory in /etc/init.d/flow-capture on line 54

6. line 54 contains

nano -c /etc/init.d/flow-capture

line 54

mkdir("$path/$folder");

7. Here the problem is not that line must be modified

as you can see them and leave the scritp I'm using
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: help me configure plugins flowview 1.0-1

Post by cigamit »

luisma75111 wrote: NOTE: Making directory '/var/flows//var/flows'
PHP Warning: mkdir(): No such file or directory in /etc/init.d/flow-capture on line 54
As I said above, your path is wrong. The plugin creates the path by taking what you have in settings and then adding the "device path" you setup in the listeners in the plugin.
So in settings your path should be
/var/flows/
and the "path" in the listener you created should be
myrouter
don't include a full path in that.
luisma75111
Posts: 13
Joined: Fri Oct 05, 2012 9:29 am

Re: help me configure plugins flowview 1.0-1

Post by luisma75111 »

ok

So in settings your path should be
/var/flows/
ejemplo1.png
ejemplo1.png (23.76 KiB) Viewed 12938 times
and the "path" in the listener you created should be
myrouter

mkdir /myrouter

nano /etc/flow-tools/flow-capture.conf

add

-V 5 -E 5G -N 3 -w /myrouter 0.0.0.0/10.0.108.4/2055


cp /usr/share/cacti/site/plugins/flowview/flow-capture /etc/init.d/

root@debian:/# /etc/init.d/flow-capture restart

NOTE: Stopping Flow Tools
NOTE: Starting Flow Tools
WARNING: No flows configured


Now I get it
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests