Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Aug 22, 2017 7:51 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Can't configure remote poller
PostPosted: Fri Apr 07, 2017 3:11 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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:
* 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?


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Fri Apr 07, 2017 6:31 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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 "[email protected]" and on the master end, executing the "GRANT ALL ON cacti1x.* TO [email protected]" 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.


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Fri Apr 07, 2017 10:39 pm 
Offline

Joined: Tue May 04, 2010 4:47 am
Posts: 17
I'm pretty sure you want to GRANT "youruser"@"localhost" AND "youruser"@"remotehost" .. and, things always break on friday ;)


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Sat Apr 08, 2017 9:08 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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 [email protected] IDENTIFIED BY 'somepassword';" when we first set things up, then I executed "GRANT ALL ON cacti.* TO [email protected] 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?


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Sat Apr 08, 2017 11:34 am 
Offline

Joined: Tue May 04, 2010 4:47 am
Posts: 17
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.

Quote:
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.


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Sat Apr 08, 2017 12:21 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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.


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Tue Apr 11, 2017 7:50 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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".
Attachment:
remote.png
remote.png [ 40.58 KiB | Viewed 1269 times ]


Attachment:
collectors.png
collectors.png [ 18.58 KiB | Viewed 1269 times ]


Looking at the log, I started to see these errors as soon as I go the remote collector connected:

Attachment:
logs2.png
logs2.png [ 146.14 KiB | Viewed 1266 times ]


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Mon Apr 17, 2017 10:21 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
Same issue with 1.1.3. Is this a config issue on my end? Any suggestions on where to start looking?

Attachment:
error.png
error.png [ 220.07 KiB | Viewed 1143 times ]


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Wed Apr 26, 2017 9:35 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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?

Attachment:
1.1.5.png
1.1.5.png [ 156.61 KiB | Viewed 1067 times ]


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Wed Apr 26, 2017 5:26 pm 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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:
$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:
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:
$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:
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:
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:
mysql> show grants for 'cactiuser'@'util-st-01';
+---------------------------------------------------------------------+
| Grants for [email protected]                                     |
+---------------------------------------------------------------------+
| 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:
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 [email protected]                                 |
+-------------------------------------------------------------------+
| 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)


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Fri May 19, 2017 5:32 am 
Offline

Joined: Thu May 03, 2007 6:22 am
Posts: 26
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:
RDB_Host                localhost
RDB_Database            cacti1x_btp

I would expect the RDB_Host (the remote database hostname) cannot be 'localhost'.


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Fri May 19, 2017 6:49 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
No, I was not able to get it working. Below is the current spine.conf on the remote poller (cacti-btp-01):
Code:
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:
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


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Fri May 19, 2017 7:04 am 
Offline

Joined: Thu May 03, 2007 6:22 am
Posts: 26
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?


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Fri May 19, 2017 7:49 am 
Offline
Cacti User

Joined: Tue Mar 31, 2009 10:05 am
Posts: 231
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.


Top
 Profile  
 
 Post subject: Re: Can't configure remote poller
PostPosted: Fri May 19, 2017 9:54 am 
Offline

Joined: Thu May 03, 2007 6:22 am
Posts: 26
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 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