Fresh install cacti. Why this error? +deb based

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
dmz
Posts: 1
Joined: Sun Nov 25, 2018 5:58 am

Fresh install cacti. Why this error? +deb based

Post by dmz »

The thing is:
-I'm on a raspberry pi 3 b+ with raspbian stretch. Since using:

Code: Select all

sudo apt install cacti
only allows me to install the 0.8.8 version, I figured it would be better if I follow a tutorial for installing from source, so I could get cacti 1.1.38.

-Followed every step in there. Weird that in a virtual machine with raspbian stretch, when importing cacti database with this step, it was only 3 seconds:

Code: Select all

mysql -u root -p cacti < /opt/cacti/cacti.sql
But in raspbian it actually let the terminal hanged. But no problem(I think) since It copied at least ~3.9Mb.

-The tutorial said to do this

Code: Select all

nano /etc/crontab
Add: */5 * * * * www-data php /<cacti-path>/cacti/poller.php > /dev/null 2>&1
-Instead of that, I did

Code: Select all

crontab -e 
Add: */5 * * * * www-data php /<cacti-path>/cacti/poller.php > /dev/null 2>&1
Followed the tutorial, installed cacti, but I got the typical error
Error opening '/<cacti-path>/cacti/rra/*.rrd No such file or directory
Like this image:https://user-images.githubusercontent.c ... 2fa6e2.png

Since I used cacti too for a school project and the poller was the source of near all my problems (the new graphs didn't create unless I started the poller from root terminal, but afterwards they were updating with no problems), I did

Code: Select all

sudo /usr/bin/php /opt/cacti/poller.php
And the graphs appeared.

The problem is, now I have all this rubish in my crontabs

Code: Select all

#in crontab -e
*/1 * * * * www-data php /opt/cacti/poller.php > /dev/null 2>&1
*/1 * * * * cactiuser php /opt/cacti/poller.php > /dev/null 2>&1
#in /etc/crontab
*/1 * * * * root /usr/bin/php /opt/cacti/poller.php > /dev/null 2>&1
The graphs keep updating but I don't know which crontab is updating succesfully. I didn't create a cacti user for terminal, but I read it's neccessary to create a 'cactiuser' since the crontab needs to have a 'cactiuser' user doing the polling.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Fresh install cacti. Why this error? +deb based

Post by netniV »

I am assuming that you understood to replace <cacti_path> with the actual path to cacti, eg, /usr/share/cacti/ ? Also, for debian based installs, Paul Gever's produces the packages for that. I guess whether you see it or not would depend on the version of debian being installed.

Check the following two links for the two cacti packages:
https://tracker.debian.org/pkg/cacti-spine
https://tracker.debian.org/pkg/cacti
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Fresh install cacti. Why this error? +deb based

Post by paulgevers »

Replacing cacti installed from a deb package by a version from this site isn't trivial. I recommend removing any trace from the Debian package before installing the version from here: $(apt purge cacti). Please make sure that the MySQL database and user are also removed.

That said, I provide backports. See the link in my signature. Should work on Rasbian as well as far as I know.
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
robvas
Posts: 6
Joined: Tue Dec 04, 2018 12:16 pm

Re: Fresh install cacti. Why this error? +deb based

Post by robvas »

dmz wrote:The thing is:
The problem is, now I have all this rubish in my crontabs

Code: Select all

#in crontab -e
*/1 * * * * www-data php /opt/cacti/poller.php > /dev/null 2>&1
*/1 * * * * cactiuser php /opt/cacti/poller.php > /dev/null 2>&1
#in /etc/crontab
*/1 * * * * root /usr/bin/php /opt/cacti/poller.php > /dev/null 2>&1
The graphs keep updating but I don't know which crontab is updating succesfully. I didn't create a cacti user for terminal, but I read it's neccessary to create a 'cactiuser' since the crontab needs to have a 'cactiuser' user doing the polling.
/var/log/cron.log should tell you the user which the cron job runs as

Mine has this:

Code: Select all

Dec  4 12:20:02 devel CROND[83551]: (cacti) CMD (/usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1)
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Fresh install cacti. Why this error? +deb based

Post by netniV »

robvas wrote:
dmz wrote:The thing is:
The problem is, now I have all this rubish in my crontabs

Code: Select all

#in crontab -e
*/1 * * * * www-data php /opt/cacti/poller.php > /dev/null 2>&1
*/1 * * * * cactiuser php /opt/cacti/poller.php > /dev/null 2>&1
#in /etc/crontab
*/1 * * * * root /usr/bin/php /opt/cacti/poller.php > /dev/null 2>&1
The graphs keep updating but I don't know which crontab is updating succesfully. I didn't create a cacti user for terminal, but I read it's neccessary to create a 'cactiuser' since the crontab needs to have a 'cactiuser' user doing the polling.
/var/log/cron.log should tell you the user which the cron job runs as

Mine has this:

Code: Select all

Dec  4 12:20:02 devel CROND[83551]: (cacti) CMD (/usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1)
I would imagine your poller is being run three times concurrently by three different users. As with Highlander, there can be only one! Pick one and remove the others. If you are using the debian/ubuntu packages, I believe that should be cacti. IMHO, root should never be used to run the poller and if using spine, that will normally be configured with SetUID bit and drop privileges itself (as it needs them for ICMP ping).
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Fresh install cacti. Why this error? +deb based

Post by paulgevers »

Debian packages don't use anything from /opt/ so this isn't from any Debian package. In our packages the user which runs the cron is www-data:

Code: Select all

paul@testavoira ~ $ cat /etc/cron.d/cacti 
MAILTO=root
*/5 * * * * www-data php /usr/share/cacti/site/poller.php 2>&1 >/dev/null | if [ -f /usr/bin/ts ] ; then ts ; else tee ; fi >> /var/log/cacti/poller-error.log
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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests