Can't configure remote poller

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

Moderators: Developers, Moderators

stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Can't configure remote poller

Post by stormonts »

We have setup a Linux server that matches the software configuration of our main Cacti poller. On the remote poller, config.php has been edited to point to the main server as noted below:

Code: Select all

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

$database_type     = 'mysql';
$database_default  = 'cacti1x';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'pw_here';
$database_port     = '3306';
$database_ssl      = false;

/* when the cacti server is a remote poller, then these entries point to
 * the main cacti server.  otherwise, these variables have no use.
 * and must remain commented out. */

$rdatabase_type     = 'mysql';
$rdatabase_default  = 'cacti1x';
$rdatabase_hostname = 'util-st-01';
$rdatabase_username = 'cactiuser';
$rdatabase_password = 'pw_here';
$rdatabase_port     = '3306';
$rdatabase_ssl      = false;
However the Cacti Installation Wizard says "Remote Database: Connection Failed" when I try and test the connection. I know that the password is correct as is the DB name and hostname (tried FQDN as well but that didn't help either). What am I missing?
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

Why I decide to do this on a Friday, I will never know.

I was able to finally get the remote site linked up by editing the config on the remote poller to make the username "cactiuser@cacti-btp-1" and on the master end, executing the "GRANT ALL ON cacti1x.* TO cactiuser@btp-cacti-1" command, but then the logs on the master server filled with a number of "MySQL server has gone away" errors and other messages. I deleted the remote data collector from the site and Cacti seems to be back again except for the fact that I have set my user settings to "Modern" and the default theme in Cacti is "Modern", except it keeps displaying in classic. In addition, when I go to "System Utilities" and then "Log Administration", the log screen never shows up.
choefing
Posts: 29
Joined: Tue May 04, 2010 4:47 am

Re: Can't configure remote poller

Post by choefing »

I'm pretty sure you want to GRANT "youruser"@"localhost" AND "youruser"@"remotehost" .. and, things always break on friday ;)
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

So the theme issue seemed to magically fix itself. The issue where I click on Log Administration still shows a bar go across the top of the screen, but then the log never loads.

Regarding permissions, on the main server I had executed "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';" when we first set things up, then I executed "GRANT ALL ON cacti.* TO cactiuser@cacti-btp-01 IDENTIFIED BY 'somepassword';" which then let the remote site connect to the main one. On the remote site do I need to execute the same command but with the name of the cactiuser from the main site? Does the main site directly access the remote DB or are the results stored in memory on the remote site and then sent to the main DB?
choefing
Posts: 29
Joined: Tue May 04, 2010 4:47 am

Re: Can't configure remote poller

Post by choefing »

I can't say for sure and the lack of documentation regarding this feature (either this or i wasnt able to find it) doenst help as well.
My first installation of an additional poller broke cacti completetly.
Second attempt was to grant access to local and remote on BOTH. When installing i set the poller ID manually to 2 on the 2nd poller.
It works somehow, im not sure how and why, but I don't think we will consider it to be worth in an live installation for now.
I'd really would like to see this feature documented AND/OR quite clear how to setup, but additionally, the lack of support for plugins doesnt help either.
NOTE: None of the Core Cacti Plugins, to date, have been re-designed to work with Remote Data Collectors. Therefore, Plugins such as MacTrack, and HMIB, which require direct access to devices will not work with Remote Data Collectors at this time. However, plugins such as Thold will work so long as the Remote Data Collector is in 'online' mode.
For me, the installation and configuration SHOULD be pretty straight forward. Hope i got it right.
- Grant cactiuser access to cacti local and remote for both
- Install Primary + spine and configure for local and remote (config.php and spine.conf)
- Install secondary + spine and configure for local and remote (config.php and spine.conf)
- Check your data collectors
- enable BOOST
- cross fingers ;)

Not quite sure due to what reason, but running spine setuid as cactiuser doesn't seem to work for me.
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

The only other plugin that we use is thold, which looks to be in the clear.

Strangely, if I edit config.php and change it to poller "2", going to the URL for the first time on the remote poller doesn't take me to the installation wizard, it just takes me straight to the console. If i leave the poller setting at "1", then I get the Cacti installation wizard where I can select that it is a "Remote Poller". I thought it would still give me the install wizard regardless of the poller setting.

So I'm going to try (on Monday), exporting the main Cacti DB, then try the setup again giving the main cactiuser permission on the remote DB and the remote cacti user permission on the main DB.
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

Progress, kind of.

I was able to get the remote poller connected and at first the Data Collectors screen showed them both as idle, but then it changed the main poller to "Unknown/Down".
remote.png
remote.png (40.58 KiB) Viewed 11255 times
collectors.png
collectors.png (18.58 KiB) Viewed 11255 times
Looking at the log, I started to see these errors as soon as I go the remote collector connected:
logs2.png
logs2.png (146.14 KiB) Viewed 11252 times
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

Same issue with 1.1.3. Is this a config issue on my end? Any suggestions on where to start looking?
error.png
error.png (220.07 KiB) Viewed 11129 times
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

Issue continues with 1.1.5. Is it because we are doing 1 minute poling in both locations? Are there just too many SQL writes going on at once?
1.1.5.png
1.1.5.png (156.61 KiB) Viewed 11053 times
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

More on this, since it seems like things are closer. As soon as I enable the remote poller (cacti-btp-01), that poller runs and processes devices assigned to it, but the main poller (util-st-01) goes to unknown/down and stops processing devices. I have tried various combinations of RBD and DB configs (none seem to make any difference). Below are the current settings:

config.php on the remote poller (cacti-btp-01):

Code: Select all

$database_type     = 'mysql';
$database_default  = 'cacti1x_btp';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'password';
$database_port     = '3306';
$database_ssl      = false;

/* when the cacti server is a remote poller, then these entries point to
 * the main cacti server.  otherwise, these variables have no use.
 * and must remain commented out. */


$rdatabase_type     = 'mysql';
$rdatabase_default  = 'cacti1x';
$rdatabase_hostname = 'util-st-01';
$rdatabase_username = 'cactiuser';
$rdatabase_password = 'password';
$rdatabase_port     = '3306';
$rdatabase_ssl      = false;

/* the poller_id of this system.  set to '1' for the main cacti
 * web server.  otherwise, you this value should be the poller_id
 * for the remote poller. */

$poller_id = 2;
spine.conf on the remote poller (cacti-btp-01):

Code: Select all

DB_Host                 localhost
DB_Database           cacti1x_btp
DB_User                 cactiuser
DB_Pass                 password
DB_Port                 3306

RDB_Host                localhost
RDB_Database         cacti1x_btp
RDB_User                cactiuser
RDB_Pass                password
RDB_Port                3306
config.php on the main poller (util-st-01):

Code: Select all

$database_type     = 'mysql';
$database_default  = 'cacti1x';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'password';
$database_port     = '3306';
$database_ssl      = false;

/* when the cacti server is a remote poller, then these entries point to
 * the main cacti server.  otherwise, these variables have no use.
 * and must remain commented out. */

#$rdatabase_type     = 'mysql';
#$rdatabase_default  = 'cacti';
#$rdatabase_hostname = 'localhost';
#$rdatabase_username = 'cactiuser';
#$rdatabase_password = 'cactiuser';
#$rdatabase_port     = '3306';
#$rdatabase_ssl      = false;

/* the poller_id of this system.  set to '1' for the main cacti
 * web server.  otherwise, you this value should be the poller_id
 * for the remote poller. */

$poller_id = 1;
spine.conf on the main cacti poller (util-st-01):

Code: Select all

DB_Host                 localhost
DB_Database           cacti1x
DB_User                 cactiuser
DB_Pass                 password
DB_Port                 3306


RDB_Host                cacti-btp-01
RDB_Database            cacti1x_btp
RDB_User                cactiuser
RDB_Pass                password
RDB_Port                3306
I have verified that I can successfully connect to the mysql server on each poller remotely using the command "mysql -u cactiuser -p -h cacti-btp-01" (or mysql -u cactiuser -p -h util-st-01) and I can.

SQL users on the remote poller (cacti-btp-01):

Code: Select all

mysql> select user,host from mysql.user;
+-----------+------------+
| user      | host       |
+-----------+------------+
| cactiuser | localhost  |
| mysql.sys | localhost  |
| root      | localhost  |
| cactiuser | util-st-01 |
+-----------+------------+
4 rows in set (0.00 sec)
Grants on the remote poller (cacti-btp-01):

Code: Select all

mysql> show grants for 'cactiuser'@'util-st-01';
+---------------------------------------------------------------------+
| Grants for cactiuser@util-st-01                                     |
+---------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'cactiuser'@'util-st-01'                      |
| GRANT ALL PRIVILEGES ON `cacti1x_btp`.* TO 'cactiuser'@'util-st-01' |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)
SQL users on the main poller (util-st-01):

Code: Select all

mysql> select user,host from mysql.user;
+-----------+-----------------------+
| user      | host                  |
+-----------+-----------------------+
| root      | 127.0.0.1             |
| cactiuser | cacti-btp-01          |
|           | localhost             |
| cactiuser | localhost             |
| mysql.sys | localhost             |
| root      | localhost             |
|           | util-st-01            |
| root      | util-st-01            |
+-----------+-----------------------+
8 rows in set (0.00 sec)

Grants on the main poller (util-st-01):
[code]
mysql> show grants for 'cactiuser'@'cacti-btp-01';
+-------------------------------------------------------------------+
| Grants for cactiuser@cacti-btp-01                                 |
+-------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'cactiuser'@'cacti-btp-01'                  |
| GRANT ALL PRIVILEGES ON `cacti1x`.* TO 'cactiuser'@'cacti-btp-01' |
+-------------------------------------------------------------------+
2 rows in set (0.00 sec)
Piratos
Posts: 28
Joined: Thu May 03, 2007 6:22 am

Re: Can't configure remote poller

Post by Piratos »

Dear stormonts,

Did you solve this in the end? If you did, could you explain how you did solve it?


If not, maybe your spine.conf on the remote poller (cacti-btp-01) is incorrect:

Code: Select all

RDB_Host                localhost
RDB_Database            cacti1x_btp
I would expect the RDB_Host (the remote database hostname) cannot be 'localhost'.
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

No, I was not able to get it working. Below is the current spine.conf on the remote poller (cacti-btp-01):

Code: Select all

DB_Host                 localhost
DB_Database             cacti1x_btp
DB_User                 cactiuser
DB_Pass                 <PW here>
DB_Port                 3306


RDB_Host                util-st-01
RDB_Database            cacti1x
RDB_User                cactiuser
RDB_Pass                <PW here>
RDB_Port                3306
In the case of a remote poller, the "RDB" section of the settings refers to the "main" poller (util-st-01) as that system is remote to the remote poller (cacti-btp-01) correct? Just as they are reversed on the main poller (shown below):

Code: Select all

DB_Host                 localhost
DB_Database             cacti1x
DB_User                 cactiuser
DB_Pass                 <PW here>
DB_Port                 3306


RDB_Host                cacti-btp-01
RDB_Database            cacti1x_btp
RDB_User                cactiuser
RDB_Pass                <PW here>
RDB_Port                3306
Piratos
Posts: 28
Joined: Thu May 03, 2007 6:22 am

Re: Can't configure remote poller

Post by Piratos »

That is indeed what I would expect.

You are not using an IP-address or fully qualified domain name (FQDN) but "util-st-01" and "cacti-btp-01" for the remote database hostname. Are you sure they can reach each other?
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Re: Can't configure remote poller

Post by stormonts »

Yes, they can ping each other and "mysql -u cactiuser -p -h cacti-btp-01" (or mysql -u cactiuser -p -h util-st-01) from the opposite server establishes a connection successfully.
Piratos
Posts: 28
Joined: Thu May 03, 2007 6:22 am

Re: Can't configure remote poller

Post by Piratos »

Dear stormonts,

What Poller Type do you use? Your log shows "CDMPHP", but you are also editing spine.conf.

Have you tried setting the Poller Type to spine? And enabling On-demand RRD Updating?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests