First/Fresh Install and several problems I can't resolve

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

Moderators: Developers, Moderators

Post Reply
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

First/Fresh Install and several problems I can't resolve

Post by shelzmike »

Never used Cacti before, so this if my first install.

Installed using the walk-through here: https://www.techrepublic.com/article/ho ... on-ubuntu/ (I think this is important as I am unsure if there is something missing here that I am unaware of).

Ubuntu 16.04.4
Apache2 (2017-09-18T15:09:02)
MariaDB (MySQL - Confused on this part as I followed the tutorial, but not very familiar with MariaDB or if it makes a difference, though I will say it doesn't seem at all related to my issues).
PHP 7.0

I got everything configured, devices/graphs created, etc.

When I try to view a graph, I get the error: ERROR: Opening '/var/www/html/rra/switch01.rrd' No such file or directory.

Poking around, I saw a few things.

1.) My Main Poller status was sitting at Status 'Unknown/Down'. I ran poller.php and this status changed to Running. In my logs, I see where it says it is creating the graphs:

Code: Select all

2018/02/25 22:37:22 - WEBLOG CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start='-86400' --end='-300' --pango-markup --title='switch01 - Traffic - gigabitethernet1/24/72' --vertical-label='bits per second' --slope-mode --base=1000 --height=200 --width=700 --rigid --alt-autoscale-max --lower-limit='0' --color BACK#F3F3F3 --color CANVAS#FDFDFD --color SHADEA#CBCBCB --color SHADEB#999999 --color FONT#000000 --color AXIS#2C4D43 --color ARROW#2C4D43 --color FRAME#2C4D43 --border 1 --font TITLE:11:'Arial' --font AXIS:8:'Arial' --font LEGEND:8:'Courier' --font UNIT:8:'Arial' --font WATERMARK:6:'Arial' --slope-mode --watermark 'Generated by Cacti®' DEF:a='/var/www/html/rra/switch01_traffic_in_6.rrd' Graphs[switch01 - Traffic - gigabitethernet1/24/72, switch01 - Traffic - gigabitethernet1/24/72]DS[switch01 - Traffic - gi1/24]:'traffic_in':MAX DEF:b='/var/www/html/rra/switch01_traffic_in_6.rrd' Graphs[switch01 - Traffic - gigabitethernet1/24/72, switch01 - Traffic - gigabitethernet1/24/72]DS[switch01 - Traffic - gi1/24]:'traffic_in':AVERAGE DEF:c='/var/www/html/rra/switch01_traffic_in_6.rrd' Graphs[switch01 - Traffic - gigabitethernet1/24/72, switch01 - Traffic - gigabitethernet1/24/72]DS[switch01 - Traffic - gi1/24]:'traffic_out':MAX DEF:d='/var/www/html/rra/switch01_traffic_in_6.rrd' Graphs[switch01 - Traffic - gigabitethernet1/24/72, switch01 - Traffic - gigabitethernet1/24/72]DS[switch01 - Traffic - gi1/24]:'traffic_out':AVERAGE CDEF:cdefa='a,8,*' CDEF:cdefb='b,8,*' CDEF:cdeff='c,8,*' CDEF:cdefg='d,8,*' LINE1:cdefa#00CF00FF:'' AREA:cdefb#00CF007F:'Inbound ' GPRINT:cdefb:LAST:'Current\:%8.2lf %s' GPRINT:cdefb:AVERAGE:'Average\:%8.2lf %s' GPRINT:cdefb:MAX:'Maximum\:%8.2lf %s\n' LINE1:cdeff#002A97FF:'' AREA:cdefg#002A977F:'Outbound' GPRINT:cdefg:LAST:'Current\:%8.2lf %s' GPRINT:cdefg:AVERAGE:'Average\:%8.2lf %s' GPRINT:cdefg:MAX:'Maximum\:%8.2lf %s\n'
*Note there are multiples of these.

When I checked again, I get the same message for the graph. Checked the rra directory and there is nothing there! (Obviously this is the problem with why my graphs are not showing).

2.) I am not sure where to view or set the poller logs (are they different than Settings->General->Generic Log Level)? When I view Cacti log, I don't see any real messages other than what I see in the log tab on the web interface (just more of the above and mainly good things - no errors to speak of).

3.) After a little while, the poller eventually went back to Status "Unknown/Down"

Can anyone shed any light on this? I have tried to debug and search the web for hours now and have come up with a whole lot of nothing, or actually a whole lot of everything that just doesn't seem relevant to my situation. Thanks!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: First/Fresh Install and several problems I can't resolve

Post by netniV »

What this really sounds like is that you a missing the cron file which should be at /etc/cron.d/cacti

That file tells the system to run the poller and without running the poller, you get no RRD's.
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
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

I will take a look at that this evening when I get home. However, preemptively asking this here, when I run poller.php manually (and it spits the log files out above as though it is building the graphs and rrd files), shouldn't they still be created in the rra directory? I'll check and see what I have for going though and let you know. Thanks!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: First/Fresh Install and several problems I can't resolve

Post by netniV »

Yes, but when running the poller, it should be as the cron user and that user should have write privileges to the RRA/RRD's.
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
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

netniV wrote:What this really sounds like is that you a missing the cron file which should be at /etc/cron.d/cacti

That file tells the system to run the poller and without running the poller, you get no RRD's.
You are correct on this - I just checked and cacti is not in /etc/cron.d
netniV wrote:Yes, but when running the poller, it should be as the cron user and that user should have write privileges to the RRA/RRD's.
So you mentioned something here that I am totally missing - the cron user. What user is this referring to? Is this something that is created with cacti install? I totally didn't see anything about any users except for those referring to the web login and the DB user.

My RRA directory looks to have suspicious permissions that do not look correct, but don't know what I have missed.

There are no files inside rra directory, but the directory itself has the following perms:

Code: Select all

drwxr-xr-x  2 www-data www-data   4096 Feb 24 21:50 rra
I believe this is incorrect.

Really, what I feel like has happened is that I followed a bad walkthrough for the install that either a.) doesn't work fully or left some items out based on what they wanted to achieve. I feel like wiping it out and starting all over, but not fully sure the best way to go about doing that (I am OK at Linux in general, but this walkthrough was a bit more than I understood and I was just copying, pasting, and hoping :)

Can I fix the problems mentioned here, or is a clean install on tap here? Thanks again!
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

OK, so I decided that there was so much jacked up that I backed out and started over again. This time I think I am on a much better path; however, confused at where to make the changes for tuning the DB.

In the header of this section, is says to configure it at /etc/my.cnf but there is nothing there.

Looking in /etc/mysql, I see this:

Code: Select all

drwxr-xr-x 2 root root 4096 Feb 26 22:35 conf.d
-rw------- 1 root root  277 Feb 24 21:24 debian.cnf
-rwxr-xr-x 1 root root 1426 Jan 16 11:46 debian-start
-rw-r--r-- 1 root root 1141 Feb 26 22:42 mariadb.cnf
drwxr-xr-x 2 root root 4096 Feb 26 22:41 mariadb.conf.d
lrwxrwxrwx 1 root root   24 Feb 24 21:17 my.cnf -> /etc/alternatives/my.cnf
-rw-r--r-- 1 root root  839 Jan 21  2017 my.cnf.fallback
Not sure why my.cnf is linked somewhere else, but in any event, when i

Code: Select all

sudo nano my.cnf
and add the following:

Code: Select all

max_heap_table_size = 98M
tmp_table_size = 64M
join_buffer_size = 64M
innodb_buffer_pool_size = 485M
innodb_doublewrite = off
innodb_additional_mem_pool_size = 80M
innodb_flush_log_at_timeout = 3
innodb_read_io_threads = 32
innodb_write_io_threads = 16
Nothing changes (yep, I do remember to restart mysql and apache2)

I also made the same changes in mariadb.conf.d/50-server.cnf, nothing changes.

So where exactly are the settings it is currently pulling (pictured below) and where can I change them?

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

Re: First/Fresh Install and several problems I can't resolve

Post by netniV »

Personally, I would put your custom settings in a separate cacti.cnf file under /etc/mysql/conf.d/

That way, you never have to worry about a package maintainer overwriting your custom SQL settings.

Also, make sure you have the file looking like:

Code: Select all

[mysqld]
max_heap_table_size=98M
tmp_table_size=64M
join_buffer_size=64M
innodb_buffer_pool_size=488M
innodb_doublewrite=OFF
innodb_flush_log_at_timeout=3
innodb_read_io_threads=32
innodb_write_io_threads=16
Note the all important mysqld heading.
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
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

netniV wrote: Note the all important mysqld heading.
I was totally overthinking the problem - I haven't had a chance to look at it, but I believe I left this off! Will check this evening and see. Thanks again!
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

Well, doesn't appear to be that easy. I took your advice and added a cacti.cnf under conf.d/ and added the proper heading and settings and it still hasn't changed. I feel like I am missing something super simple. Will keep digging...

EDIT:

Ok, digging deeper is confusing me even more. So, even though the currently running variables are sticking at what I have in my image above, when I run

Code: Select all

mysqld --print-defaults
I see that it is pulling up the proper variables that I changed.

Code: Select all

mysqld would have been started with the following arguments:
--max_heap_table_size=98M --tmp_table_size=64M --join_buffer_size=64M --innodb_buffer_pool_size=488M --innodb_doublewrite=OFF --innod            b_flush_log_at_timeout=3 --innodb_read_io_threads=32 --innodb_write_io_threads=16 --user=mysql --pid-file=/var/run/mysqld/mysqld.pid             --socket=/var/run/mysqld/mysqld.sock --port=3306 --basedir=/usr --datadir=/var/lib/mysql --tmpdir=/tmp --lc-messages-dir=/usr/share/m            ysql --skip-external-locking --bind-address=127.0.0.1 --key_buffer_size=16M --max_allowed_packet=16M --thread_stack=192K --thread_cac            he_size=8 --myisam-recover=BACKUP --query_cache_limit=1M --query_cache_size=16M --log_error=/var/log/mysql/error.log --expire_logs_da            ys=10 --max_binlog_size=100M --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --max_heap_table_size=98M --tmp_tab            le_size=64M --join_buffer_size=64M --innodb_buffer_pool_size=488M --innodb_doublewrite=OFF --innodb_flush_log_at_timeout=3 --innodb_r            ead_io_threads=32 --innodb_write_io_threads=16

EDIT2:

Well I figured out that the reason the options weren't pulling in wasn't anything to do with the .cnf file - it is because restarting mysql isn't actually restarting it, even though it doesn't show errors. I figured this out by just issuing a stop then checked the processes and see mysql still running. So I kill -9 the PID and it basically did kill it but IMMEDIATELY restarted it under another PID. That being said, this of course now pulled in my options. However, I clearly need to find out why mysql is starting on its own.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: First/Fresh Install and several problems I can't resolve

Post by netniV »

So have you now managed to complete the installation?
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
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

No, not fully. Not sire what happened, but my MariaDB install was all jacked up. Took me all night to figure out the best thing to do is purge and reinstall. This corrected all the issues I was having with it. Noticed the same thing is happening with apache2 (i.e. not stopping, starting, restarting when commanded to). Will reinstall that tonight, but think it is all working better now. I am assuming my initial problems will be resolved, but won't k ow until this evening most likely. Thanks again.
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

OK, I finally got everything working for the most part. Spine, MariDB, Cacti, Apache2, etc. all working. Now my poller is running and graphing localhost just fine (linux machine template). For some reason though, my Bits on a specific switchport for a Cisco device has nan entries and no data showing on the graph. Nothing in the log sticks out. Will do more troubleshooting tomorrow.
shelzmike
Posts: 12
Joined: Sun Feb 25, 2018 10:27 pm

Re: First/Fresh Install and several problems I can't resolve

Post by shelzmike »

I think I just didn't give it enough time. It is all working now. Now to figure out how to change to 1 minute polling and I'll be good. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest