Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Jan 23, 2019 10:52 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Question on How to Install Cacti 1.2 beta
PostPosted: Tue Oct 16, 2018 11:26 pm 
Offline

Joined: Tue Oct 16, 2018 11:04 pm
Posts: 5
Hi,

I've been having issues installing 1.1.38 on Ubuntu 18.04 but understand there may be some incompatibilities so thought I'd try 1.2

I've extracted the tar file but am unsure of what to do next, do I need to overwrite the 1.1.38 install ?

If someone could give me a quick rundown on how install 1.2 from the tar.gz that would be much appreciated.


Top
 Profile  
 
 Post subject: Re: Question on How to Install Cacti 1.2 beta
PostPosted: Wed Oct 17, 2018 6:19 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1933
I would extract that tar into the same directory as your 1.1.38 installation. Depending on what you have done with 1.1.38, you have two choices:

Start afresh (my preferred route if non-production)
If you have not really used the 1.1.38 installation, I would
  1. Using MySQL or phpMyAdmin, prime the database as an empty 1.2 DB by:
    • Removing all tables in the database that it points to.
    • Running: source <cacti>/cacti.sql
  2. Navigate to http://<cacti>/install/
  3. Login and authenticate
  4. Step through the installation wizard
    • For automation
      • Set the automation network range
      • Enable scanning by default
      • Set any custom SNMP details required
    • For templates, select all
  5. Launch cacti once installed

Upgrade
If you really used and don't want to drop the 1.1.38 installation, you would follow the above steps skipping the database stuff. You won't get an option to automatically enable the automation stuff or import templates, but you can do that manually after the fact once the upgrade is complete.

_________________
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: Question on How to Install Cacti 1.2 beta
PostPosted: Wed Oct 17, 2018 7:28 am 
Offline

Joined: Tue Oct 16, 2018 11:04 pm
Posts: 5
Thanks for your answer! I was able to get 1.2 installed (i think!) but am receiving the same error as i was using in 1.1.38

"FATAL: Connection to Cacti database failed. Please ensure:

the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid."

I can access the db I created using the cli and can see all the tables using mariadb but cacti won't connect to it. I have also granted permissions to the cacti_user I created. I have verified credentials in include/config.php.

Any suggestions? I do notice the cacti.log is 0 bytes and is not growing, I noticed in the installation steps it says to grant cactiuser permissions to /log but does this just mean any user ? I have created a db cacti_user, do I need to create a specific cacti Ubuntu user account as well? Apologies if these questions sound a bit silly.

Thanks.


Top
 Profile  
 
 Post subject: Re: Question on How to Install Cacti 1.2 beta
PostPosted: Wed Oct 17, 2018 5:56 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1933
Check that you have configured the settings properly in the include/config.php file (not the config.php.dist file).

_________________
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: Question on How to Install Cacti 1.2 beta
PostPosted: Wed Oct 17, 2018 8:32 pm 
Offline

Joined: Tue Oct 16, 2018 11:04 pm
Posts: 5
netniV wrote:
Check that you have configured the settings properly in the include/config.php file (not the config.php.dist file).


I have double checked the settings and everything looks ok, I can access the DB using the MariaDB CLI using the same credentials. I am not seeing any failed logins in syslog and am seeing nothing in cacti.log, it is still only showing zero bytes... and other suggestions of what I can check?

/*
* Make sure these values reflect your actual database/host/user/password
*/

$database_type = 'mysqli';
$database_default = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cacti_user';
$database_password = '**hidden**';
$database_port = '3306';
$database_ssl = false;
$database_ssl_key = '';


Top
 Profile  
 
 Post subject: Re: Question on How to Install Cacti 1.2 beta
PostPosted: Thu Oct 18, 2018 9:35 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1933
Hmm, check what ports the SQL server is listening on. It may not be listening on localhost or via a socket.

_________________
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: Question on How to Install Cacti 1.2 beta
PostPosted: Fri Oct 19, 2018 2:10 am 
Offline

Joined: Tue Oct 16, 2018 11:04 pm
Posts: 5
netniV wrote:
Hmm, check what ports the SQL server is listening on. It may not be listening on localhost or via a socket.


A couple of notes, it appears to be listening on 3306 however the hostname in mariadb is not showing as localhost, it shows as lynx-panther, the computers name. I'm not sure how to change that, i ensured the /etc/hosts file was showing 127.0.0.1 as localhost.

I'm starting to suspect the problem goes deeper and I may have a FUBAR mysql install as if I try to reinstall mysql i get lots of errors (on my phone at the moment so I don't have the specific errors,) but if I reinstall mariadb-server (which is installing mysql dependencies presumably?) the install appears fine but I get the aforementioned behavior... I will try this weekend on a virtual machine from scratch and see how I go.

Thanks for your help.


Top
 Profile  
 
 Post subject: Re: Question on How to Install Cacti 1.2 beta
PostPosted: Sat Oct 20, 2018 2:53 am 
Offline

Joined: Tue Oct 16, 2018 11:04 pm
Posts: 5
I managed to sort out the issue, I started monitoring the apache2 error.log and was seeing PHP fatal errors, 'undefined class constant'. After a bit of research, it looked like pdo_mysql was the culprit. I ran sudo phpenmod pdo_mysql but was receiving an error that it was not in the 7.2 mods folder. I decided to completely remove php-common and other dependencies and reinstall php7.0 from scratch, after that and reinstalling cacti, i enabled the pdo mod and was off the races. A few permission issues I had to sort out and enabling other php plugins but now I think I'm finally there and am graphing my Mikrotik Interfaces :lol:

Thanks for your help netniV and if anyone else is getting the cacti cannot connect to database error in apache when everything else seems set up correctly, double check that pdo_mysql is installed and running!


Top
 Profile  
 
 Post subject: Re: Question on How to Install Cacti 1.2 beta
PostPosted: Thu Jan 03, 2019 1:56 am 
Offline

Joined: Fri Aug 17, 2012 10:19 am
Posts: 19
Location: Long Beach, CA
I upgraded from 1.1.18 to 1.20 today and recieved this error during installation.
lynx649 wrote:
"FATAL: Connection to Cacti database failed. Please ensure:

the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid."


I fixed the issue by commenting out the line pointing to mysqld.sock and uncommenting the line pointing to localhost (in config.php):
Code:
//$database_hostname = "/run/mysqld/mysqld.sock";
$database_hostname = "127.0.0.1";


Curious. I have this configured in spine.conf:
Code:
DB_Host         /run/mysqld/mysqld.sock


... and spine continues to function:
Code:
# spine -C ./spine.conf --snmponly
SPINE: Using spine config file [./spine.conf]
SPINE: Version 1.2.0 starting
SPINE: Time: 1.0402 s, Threads: 15, Devices: 3


The socket file exists, otherwise spine wouldn't work but here it is anyways:
Code:
# ls -l /run/mysqld/mysqld.sock
srwxrwxrwx 1 mysql mysql 0 Jan  2 22:20 /run/mysqld/mysqld.sock


Any ideas why I need to change the hostname in config.php?

Thanks

_________________
The answer to life, the universe and everything is int main() {}


Top
 Profile  
 
 Post subject: Re: Question on How to Install Cacti 1.2 beta
PostPosted: Thu Jan 03, 2019 11:02 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1933
There was a fix for something to do with using a socket (https://github.com/Cacti/cacti/issues/622) which was then updated in PR #1587 (https://github.com/Cacti/cacti/issues/1587) before being finally tweaked.

Code:
if (is_file($device) && filetype($device) == 'socket') {

_________________
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: Question on How to Install Cacti 1.2 beta
PostPosted: Thu Jan 03, 2019 12:29 pm 
Offline

Joined: Fri Aug 17, 2012 10:19 am
Posts: 19
Location: Long Beach, CA
new variable works (obv). makes sense that a new variable was added for using sockets.

thank you.

_________________
The answer to life, the universe and everything is int main() {}


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 12 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