Total novice initial install issue.

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

Moderators: Moderators, Developers

Post Reply
Author
Message
DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Total novice initial install issue.

#1 Post by DalePenn » Tue Dec 03, 2019 3:17 pm

Folks,

I am mainly a software developer, and have zero experience with MySQL/php. I have installed cacti on the local system (running Redhat 6.10) per the instructions at

https://docs.cacti.net/manual:088:1_ins ... stallation

I used yum to install all the required packages. It all seemed to make sense except maybe the SNMP configuration, so I left that at the default installed configuration for now.

But when I point my browser to Cacti I get a "FATAL:Connection to Cacti database failed. Please ensure:"

"the PHP MySQL module is installed and enabled" - as far as I can tell the module is installed according to yum, and the mysql.ini file matches what the instructions told me to install in the /etc/php.d directory.

"the database is running" - I can run service mysqld status that indicates it is running, and I set up the cacti database per the instructions. I can also on the user account I am using run mysql -p cacti, submit my password, and then do a status command which shows the database as cacti. So I assume the database is valid.

"the credentials in config.php are valid" - This is where I think the issue is. I originally followed the instruction on setting up the instructions under step 4 to the letter using [email protected] as the user name, but then I went back and used my user account name and password, I.e.
mysql> GRANT ALL ON cacti.* TO <useraccountname>@localhost IDENTIFIED BY '<userpassword>';
filling in useraccountname and userpassword with my real values.

Then, in the config.php in the cacti/include directory, I set $database_username to the '<useraccountname>' and $database_password to '<userpasswork>' (again filling in the real values).

As noted above I can access mysql with that username and password and see the cacti database (at least status it). Any ideas how I can further confirm what is or is not working ? (the cacti/log directory has nothing but an index.php file so no sign of anything there).

Thanks for the help.
Dale Pennington

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#2 Post by DalePenn » Tue Dec 03, 2019 4:35 pm

I have some more info. Poking around the php files, I found the db_connect_real function in database.php, which had some additional debug if you enabled DEBUG_READ_CONFIG_OPTION which is defined in config.php.

When I did, I got some new errors in /tmp/cacti-option.log where I get the complaint "DATABASE MODULE MISSING". This error is generated at about line 53 in database.php, so it appears the MySQL module for php is not loading, and I do not know why or where to troubleshoot more. I have confirmed that /etc/php.d has a mysql.ini file defined, and the .so referenced in it (mysql.so) is loaded on the system (in /usr/lib64/php/modules).

To check the version I ran php --version and got 5.3.3.

Next I checked for the extension_dir variable which was not defined in the php.ini file. I originally did not set it as the instructions indicated it was only needed for "early versions of php". When I did (I set it to /etc/php.d) I all of the sudden got a lot of "Unable to load dynamic library /etc/php.d/<libraryname>.so, including mysql.so.

Not sure if I am barking up the wrong tree, or if there is some way to specify a path to those files that will work. I tried playing with LD_LIBRARY_PATH, but that did not appear to help.

Any additional suggestions are welcome.

Thanks,
Dale Pennington

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#3 Post by DalePenn » Wed Dec 04, 2019 9:54 am

OK, got past the PHP issue (took some looking up places other than the PHP manual). Not totally sure how I did it, but setting extensions_dir definitely would be a problem.

Now I am at a point where I am told that PHP 5.4 or greater is required. Since I have 5.3.3 this is a stopper for now (while I figure out how to get it upgraded on my RH 6.10 system).

However the requirements page on the site does not indicate this. It says 4.3.6 or greater, with 5.0 or greater preferred. Should probably be updated.

Thanks,
Dale

adiviso82
Posts: 18
Joined: Wed Aug 05, 2015 3:12 pm

Re: Total novice initial install issue.

#4 Post by adiviso82 » Wed Dec 04, 2019 5:10 pm

Hi Dale,

Try this guide to upgrade your php
https://doc.owncloud.org/server/8.1/adm ... ation.html

Regards,
Adrian

tertius
Cacti User
Posts: 75
Joined: Wed Mar 01, 2017 2:34 pm

Re: Total novice initial install issue.

#5 Post by tertius » Thu Dec 05, 2019 12:30 pm

It makes no sense to install a new cacti onto an obsolete operating system base (Redhat 6).
You should install at least on RHEL 7, if not RHEL 8. With both, you just need to add the EPEL repository to yum/dnf, and install cacti with "yum install cacti". Required dependencies are pulled automatically. For the dbms it might be required to do a "yum install mariadb" in addition.

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#6 Post by DalePenn » Thu Dec 05, 2019 1:44 pm

I ended up dropping back to 1.1.18, which appears to be working, sort of.

Now I am not apparently getting any of the SNMP statistics off the switch, and am not sure why.

I can SNMP get for ifInOctects.<index> and get a value, but I am not sure what index the poller is actually using.

When I turn on debug, I see a line

PING : Device[3] SNMP: Device responded to SNMP

but no lines of parsing the data it should have been gathering (or complaints about failure either). Also the rrd files are not updated. It looks as if the rrd file was populated once (when I created the graph/data source), but never updated by poller. Not sure where to look at this point. The one thing I am not sure of is the data source, which lists the indexvalue as "gigabitethernet1/0/1" and index type as "ifDesr". Does that mean is queries for "ifInOctets.gigabitethernet1/0/1", or does it get the proper index and ask for "ifInOctets.1" (former failes, latter works when tried with snmpget).

Thanks for the assist.

Dale

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#7 Post by DalePenn » Fri Dec 06, 2019 10:25 am

OK,

This morning after a system reboot (we power down the lab at night), the data gathering is proceeding properly. It is almost as if the changes when I add a device are only properly handled when there is a stop/start of something. Can't be the poller, as that runs at 5 minute intervals via crond, so what it is I might be needing to manually start/restart when I change a sensor configuration ?

Thanks,
Dale

netniV
Cacti Guru User
Posts: 3132
Joined: Sun Aug 27, 2017 12:05 am

Re: Total novice initial install issue.

#8 Post by netniV » Sun Dec 08, 2019 12:14 pm

That would likely be reindexing which depends on what you set your device to do. By default, it is probably set to reindex only on a reboot, hence you saw the change. But either way, 1.1.18 is obsolete now, and 0.8.8 is very obsolete so aside from passing comments, there's little support for those versions. Should you move to newer systems, they will have issues with new versions of MariaDB and PHP

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#9 Post by DalePenn » Mon Dec 09, 2019 11:38 am

So I understand, but we are running on some older systems (RH 6.10), so I am somewhat limited in what I can do.

I am guessing the when to Reindex setting is somewhat hidden, as the closest thing I saw was under Device Defaults with a setting Re-index Method for Data Queries which has the options Uptime,Index Count,Verify All, and None (with the setting at Uptime).

The goal I am trying to work towards is doing High Speed Data Collection, but I do not know how to set that up (was not in the docs). Changing the setting to High Speed from System Default appears to have no affect on the logging, so I am gonna browse the forums to see if they have any ideas.

Thanks,
Dale Pennington

netniV
Cacti Guru User
Posts: 3132
Joined: Sun Aug 27, 2017 12:05 am

Re: Total novice initial install issue.

#10 Post by netniV » Mon Dec 09, 2019 5:21 pm

So, high speed data collection has zero to do with the reindex method. If you set it the reindex method it will do the following
  • index count, then if the number of indexes changes, it will check everything again
  • uptime, if rebooted or restarted uptime will be less than the last polled value, check everything again
  • Verify all, I have a super beastly system so just reindex all the time
  • None, don't you ever think about reindexing

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#11 Post by DalePenn » Tue Dec 10, 2019 9:06 am

Thanks for the info.

So far I cannot seem to get the High Collection Rate profile to actually work. I have one data source set to that profile (its a bytes in/out measurement on a port of a SNMP switch). I can see the Poller running at 30 sec intervals in the cacti.log, but that devices's data still seems to be updating at 5 minute intervals. I get this both from the .csv dump of the graph, as well as looking at the rrdtool fetch <filename> AVERAGE command in the debug. The first column looks like a time that is advancing at steps of 300 (although I could be misinterpreting it).

Poller settings are poll every 30 seconds with cron job still set at 5 minutes.

Thanks for the help,

Dale

netniV
Cacti Guru User
Posts: 3132
Joined: Sun Aug 27, 2017 12:05 am

Re: Total novice initial install issue.

#12 Post by netniV » Tue Dec 10, 2019 12:40 pm

If you switched your profile polling time, then you will either need to fill in the gaps within the RRA or delete it and let Cacti recreate it with teh correct RRA values. You can see if it's correct or not by looking at the data source debug information when editing the data source.

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#13 Post by DalePenn » Tue Dec 10, 2019 1:06 pm

That did appear to be an issue. While my Data sources has --step 30, doing rrdtool info on the files showed step 300. So I deleted those files and now I just need to get them populated again (may need another reboot to get it going again). Then hopefully I will see the 30 second data

DalePenn
Posts: 9
Joined: Tue Dec 03, 2019 2:55 pm

Re: Total novice initial install issue.

#14 Post by DalePenn » Tue Dec 10, 2019 3:57 pm

Looks like uptime is not just rebooting, as I did it twice I am still not getting the data. Might be clock rollover that is being used. But I have yet to figure out a method of getting it to work other than waiting for the next day, which would really be an issue.

Post Reply