Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jun 25, 2019 11:41 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Fresh install cacti. Why this error? +deb based
PostPosted: Sun Nov 25, 2018 6:44 am 
Offline

Joined: Sun Nov 25, 2018 5:58 am
Posts: 1
The thing is:
-I'm on a raspberry pi 3 b+ with raspbian stretch. Since using:
Code:
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:
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:
nano /etc/crontab
Add: */5 * * * * www-data php /<cacti-path>/cacti/poller.php > /dev/null 2>&1


-Instead of that, I did
Code:
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
Quote:
Error opening '/<cacti-path>/cacti/rra/*.rrd No such file or directory
Like this image:https://user-images.githubusercontent.com/17400240/35805441-f2b9e1c8-0a8c-11e8-9d08-1e265b2fa6e2.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:
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:
#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.


Top
 Profile  
 
 Post subject: Re: Fresh install cacti. Why this error? +deb based
PostPosted: Mon Nov 26, 2018 4:38 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2523
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

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Fresh install cacti. Why this error? +deb based
PostPosted: Sun Dec 02, 2018 7:37 am 
Offline
Cacti Pro User

Joined: Tue Aug 29, 2006 4:09 pm
Posts: 590
Location: NL
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


Top
 Profile  
 
 Post subject: Re: Fresh install cacti. Why this error? +deb based
PostPosted: Tue Dec 04, 2018 12:33 pm 
Offline

Joined: Tue Dec 04, 2018 12:16 pm
Posts: 4
dmz wrote:
The thing is:
The problem is, now I have all this rubish in my crontabs
Code:
#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:
Dec  4 12:20:02 devel CROND[83551]: (cacti) CMD (/usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1)


Top
 Profile  
 
 Post subject: Re: Fresh install cacti. Why this error? +deb based
PostPosted: Wed Dec 05, 2018 2:44 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2523
robvas wrote:
dmz wrote:
The thing is:
The problem is, now I have all this rubish in my crontabs
Code:
#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:
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).

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Fresh install cacti. Why this error? +deb based
PostPosted: Wed Dec 05, 2018 2:57 pm 
Offline
Cacti Pro User

Joined: Tue Aug 29, 2006 4:09 pm
Posts: 590
Location: NL
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:
[email protected] ~ $ 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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group