Cannot get Flow-capture service to start.
Moderators: Developers, Moderators
-
- Posts: 7
- Joined: Fri Jul 14, 2023 10:07 am
Cannot get Flow-capture service to start.
I am by no means a Linux expert but I am trying. I might be a 2 out of 5.
I got the plugin installed but I cannot seem to get the service to crank over. I edited the path and I know that is correct. Here is what I have as far as when I try and start the service:
● flow-capture.service - Flow Capture Service for Cacti
Loaded: loaded (/lib/systemd/system/flow-capture.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2023-07-14 11:31:01 CDT; 1s ago
Process: 16628 ExecStart=/usr/bin/php -q /opt/cacti/plugins/flowview/service/flow-capture --systemd (code=exited, status=255/EXCEPTION)
CPU: 93ms
In here, I see PHP Warnings that point to "/var/www/html/cacti/include/cli_check.php" and my actual path for this install of Cacti on NEMS is /opt/cacti but I do not see where to change that.
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit flow-capture.service has finished with a failure.
░░
░░ The job identifier is 155590 and the job result is failed.
Jul 14 11:31:25 kah-netmon01.khilzinger.local systemd[1]: flow-capture.service: Scheduled restart job, restart counter is at 1744.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ Automatic restarting of the unit flow-capture.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jul 14 11:31:25 kah-netmon01.khilzinger.local systemd[1]: Stopped Flow Capture Service for Cacti.
░░ Subject: A stop job for unit flow-capture.service has finished
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A stop job for unit flow-capture.service has finished.
░░
░░ The job identifier is 155652 and the job result is done.
Jul 14 11:31:25 kah-netmon01.khilzinger.local systemd[1]: Starting Flow Capture Service for Cacti...
░░ Subject: A start job for unit flow-capture.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit flow-capture.service has begun execution.
░░
░░ The job identifier is 155652.
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(/var/www/html/cacti/include/cli_check.php): failed to open stream: No such file or directory in /opt/cacti/plugins/flowview/service/flow-capture on lin>
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(): Failed opening '/var/www/html/cacti/include/cli_check.php' for inclusion (include_path='.:/usr/share/php') in /opt/cacti/plugins/flowview/service/fl>
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(/var/www/html/cacti/lib/poller.php): failed to open stream: No such file or directory in /opt/cacti/plugins/flowview/service/flow-capture on line 34
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(): Failed opening '/var/www/html/cacti/lib/poller.php' for inclusion (include_path='.:/usr/share/php') in /opt/cacti/plugins/flowview/service/flow-capt>
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: NOTE: Starting Flow Collection
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Fatal error: Uncaught Error: Call to undefined function db_fetch_assoc() in /opt/cacti/plugins/flowview/service/flow-capture:71
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: Stack trace:
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: #0 /opt/cacti/plugins/flowview/service/flow-capture(46): start()
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: #1 {main}
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: thrown in /opt/cacti/plugins/flowview/service/flow-capture on line 71
Jul 14 11:31:26 kah-netmon01.khilzinger.local systemd[1]: flow-capture.service: Control process exited, code=exited, status=255/EXCEPTION
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ An ExecStart= process belonging to unit flow-capture.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 255.
Jul 14 11:31:26 kah-netmon01.khilzinger.local systemd[1]: flow-capture.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit flow-capture.service has entered the 'failed' state with result 'exit-code'.
Jul 14 11:31:26 kah-netmon01.khilzinger.local systemd[1]: Failed to start Flow Capture Service for Cacti.
░░ Subject: A start job for unit flow-capture.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit flow-capture.service has finished with a failure.
░░
░░ The job identifier is 155652 and the job result is failed.
Jul 14 11:31:27 kah-netmon01.khilzinger.local sudo[17084]: khilzinger : TTY=pts/0 ; PWD=/opt/cacti/plugins/flowview/service ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Jul 14 11:31:27 kah-netmon01.khilzinger.local sudo[17084]: pam_unix(sudo:session): session opened for user root(uid=0) by khilzinger(uid=1002)
I got the plugin installed but I cannot seem to get the service to crank over. I edited the path and I know that is correct. Here is what I have as far as when I try and start the service:
● flow-capture.service - Flow Capture Service for Cacti
Loaded: loaded (/lib/systemd/system/flow-capture.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2023-07-14 11:31:01 CDT; 1s ago
Process: 16628 ExecStart=/usr/bin/php -q /opt/cacti/plugins/flowview/service/flow-capture --systemd (code=exited, status=255/EXCEPTION)
CPU: 93ms
In here, I see PHP Warnings that point to "/var/www/html/cacti/include/cli_check.php" and my actual path for this install of Cacti on NEMS is /opt/cacti but I do not see where to change that.
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit flow-capture.service has finished with a failure.
░░
░░ The job identifier is 155590 and the job result is failed.
Jul 14 11:31:25 kah-netmon01.khilzinger.local systemd[1]: flow-capture.service: Scheduled restart job, restart counter is at 1744.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ Automatic restarting of the unit flow-capture.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jul 14 11:31:25 kah-netmon01.khilzinger.local systemd[1]: Stopped Flow Capture Service for Cacti.
░░ Subject: A stop job for unit flow-capture.service has finished
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A stop job for unit flow-capture.service has finished.
░░
░░ The job identifier is 155652 and the job result is done.
Jul 14 11:31:25 kah-netmon01.khilzinger.local systemd[1]: Starting Flow Capture Service for Cacti...
░░ Subject: A start job for unit flow-capture.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit flow-capture.service has begun execution.
░░
░░ The job identifier is 155652.
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(/var/www/html/cacti/include/cli_check.php): failed to open stream: No such file or directory in /opt/cacti/plugins/flowview/service/flow-capture on lin>
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(): Failed opening '/var/www/html/cacti/include/cli_check.php' for inclusion (include_path='.:/usr/share/php') in /opt/cacti/plugins/flowview/service/fl>
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(/var/www/html/cacti/lib/poller.php): failed to open stream: No such file or directory in /opt/cacti/plugins/flowview/service/flow-capture on line 34
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Warning: include_once(): Failed opening '/var/www/html/cacti/lib/poller.php' for inclusion (include_path='.:/usr/share/php') in /opt/cacti/plugins/flowview/service/flow-capt>
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: NOTE: Starting Flow Collection
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: PHP Fatal error: Uncaught Error: Call to undefined function db_fetch_assoc() in /opt/cacti/plugins/flowview/service/flow-capture:71
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: Stack trace:
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: #0 /opt/cacti/plugins/flowview/service/flow-capture(46): start()
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: #1 {main}
Jul 14 11:31:26 kah-netmon01.khilzinger.local php[17043]: thrown in /opt/cacti/plugins/flowview/service/flow-capture on line 71
Jul 14 11:31:26 kah-netmon01.khilzinger.local systemd[1]: flow-capture.service: Control process exited, code=exited, status=255/EXCEPTION
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ An ExecStart= process belonging to unit flow-capture.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 255.
Jul 14 11:31:26 kah-netmon01.khilzinger.local systemd[1]: flow-capture.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit flow-capture.service has entered the 'failed' state with result 'exit-code'.
Jul 14 11:31:26 kah-netmon01.khilzinger.local systemd[1]: Failed to start Flow Capture Service for Cacti.
░░ Subject: A start job for unit flow-capture.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit flow-capture.service has finished with a failure.
░░
░░ The job identifier is 155652 and the job result is failed.
Jul 14 11:31:27 kah-netmon01.khilzinger.local sudo[17084]: khilzinger : TTY=pts/0 ; PWD=/opt/cacti/plugins/flowview/service ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Jul 14 11:31:27 kah-netmon01.khilzinger.local sudo[17084]: pam_unix(sudo:session): session opened for user root(uid=0) by khilzinger(uid=1002)
Re: Cannot get Flow-capture service to start.
Did you edit both the path here
https://github.com/Cacti/plugin_flowvie ... ervice#L32
and here
https://github.com/Cacti/plugin_flowvie ... apture#L31
As its likely the 2nd one that is throwing the error.
https://github.com/Cacti/plugin_flowvie ... ervice#L32
and here
https://github.com/Cacti/plugin_flowvie ... apture#L31
As its likely the 2nd one that is throwing the error.
-
- Posts: 7
- Joined: Fri Jul 14, 2023 10:07 am
Re: Cannot get Flow-capture service to start.
Do you know the exact file names to edit? I am not understanding the two links as far as file names.
-
- Posts: 7
- Joined: Fri Jul 14, 2023 10:07 am
Re: Cannot get Flow-capture service to start.
Or, I would take a complete uninstall and reinstall.
Re: Cannot get Flow-capture service to start.
The name of the file is in the link and on the page the link points to. The locations are different in every system, but you pasted the locations in the top 10 lines of your output.
/opt/cacti/plugins/flowview/service/flow-capture
/lib/systemd/system/flow-capture.service (this one looks incomplete, so you might just search for flow-capture.service)
/opt/cacti/plugins/flowview/service/flow-capture
/lib/systemd/system/flow-capture.service (this one looks incomplete, so you might just search for flow-capture.service)
-
- Posts: 7
- Joined: Fri Jul 14, 2023 10:07 am
Re: Cannot get Flow-capture service to start.
Ah, yes. I did check both of those and the paths look identical and correct in both locations. By the way, thank you for taking the time to reply back on this.
[Unit]
Description=Flow Capture Service for Cacti
After=network.target mariadb.service
[Service]
User=root
TimeoutStartSec=0
Type=forking
KillMode=process
WorkingDirectory=/tmp
ExecStart=/usr/bin/php -q /opt/cacti/plugins/flowview/service/flow-capture --systemd
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
[Unit]
Description=Flow Capture Service for Cacti
After=network.target mariadb.service
[Service]
User=root
TimeoutStartSec=0
Type=forking
KillMode=process
WorkingDirectory=/tmp
ExecStart=/usr/bin/php -q /opt/cacti/plugins/flowview/service/flow-capture --systemd
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
-
- Posts: 7
- Joined: Fri Jul 14, 2023 10:07 am
Re: Cannot get Flow-capture service to start.
I really think once I get this service to start up, my issues should be done.
Re: Cannot get Flow-capture service to start.
NP. What do you have in
/opt/cacti/plugins/flowview/service/flow-capture
for
$cacti_base
it defaults to
$cacti_base = '/var/www/html/cacti';
which from the error messages is where it is dying. You will want to make sure that points to /opt/cacti
/opt/cacti/plugins/flowview/service/flow-capture
for
$cacti_base
it defaults to
$cacti_base = '/var/www/html/cacti';
which from the error messages is where it is dying. You will want to make sure that points to /opt/cacti
-
- Posts: 7
- Joined: Fri Jul 14, 2023 10:07 am
Re: Cannot get Flow-capture service to start.
LIGHTBULB! That was where the problem was...now just waiting for my listener to start populating that tab. I also just figured out how to fix syslog, too, so it starts.
Now it starts but I get these logs in Cacti:
2023-07-18 20:37:39 - CMDPHP SQL Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[913]:db_execute(), /lib/database.php[355]:db_execute_prepared())
2023-07-18 20:37:39 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '2023-07-18 20:34:00.000', '2023-07-18 20:34:00.000', 1, 0, 0, 0, , 0)' at line 1
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[877]:CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': count(): Parameter must be an array or an object that implements Countable in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 877
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[857]:unpack(), CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': unpack(): Type C: not enough input, need 1, have 0 in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 857
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[877]:CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': count(): Parameter must be an array or an object that implements Countable in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 877
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[857]:unpack(), CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': unpack(): Type C: not enough input, need 1, have 0 in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 857
Line 877: $field = unpack($t['unpack'], $field);
Now it starts but I get these logs in Cacti:
2023-07-18 20:37:39 - CMDPHP SQL Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[913]:db_execute(), /lib/database.php[355]:db_execute_prepared())
2023-07-18 20:37:39 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '2023-07-18 20:34:00.000', '2023-07-18 20:34:00.000', 1, 0, 0, 0, , 0)' at line 1
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[877]:CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': count(): Parameter must be an array or an object that implements Countable in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 877
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[857]:unpack(), CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': unpack(): Type C: not enough input, need 1, have 0 in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 857
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[877]:CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': count(): Parameter must be an array or an object that implements Countable in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 877
2023-07-18 20:37:39 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/flowview/flow_collector.php[347]:process_fv10(), /plugins/flowview/flow_collector.php[857]:unpack(), CactiErrorHandler())
2023-07-18 20:37:39 - ERROR PHP WARNING in Plugin 'flowview': unpack(): Type C: not enough input, need 1, have 0 in file: /opt/cacti/plugins/flowview/flow_collector.php on line: 857
Line 877: $field = unpack($t['unpack'], $field);
Re: Cannot get Flow-capture service to start.
What version of flowview are you using? This may be one for @TheWitness to look at, as one of the errors is dealing the sql query that is built, and the other is an issue with parsing the flow data.
-
- Posts: 7
- Joined: Fri Jul 14, 2023 10:07 am
Re: Cannot get Flow-capture service to start.
It says 3.3. I had a tough time getting it. The certificate had expired. Is there a better version and, if so, the web address to get it?
Re: Cannot get Flow-capture service to start.
Ya, that version was released in 2021, but TheWitness hasn't pushed out a new version since then. You can try the develop branch here, there have been a few fixes since the 3.3 release, but I don't think any of them pretained to your issue.
https://github.com/cacti/plugin_flowview/tree/develop
Click the green CODE button, and then click the "Download Zip". Copy the files over the top of your current flowview files, and then fix the paths again.
https://github.com/cacti/plugin_flowview/tree/develop
Click the green CODE button, and then click the "Download Zip". Copy the files over the top of your current flowview files, and then fix the paths again.
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Re: Cannot get Flow-capture service to start.
Grab the latest development, and you MUST edit the service file to include the 'proper' paths. Read the README that comes with it. I'm pretty sure if you have your Cacti in /opt/ you have to change a few settings in the flow capture service definition and possibly the PHP file. Can not remember.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 2 guests