Hi,

As far as I understand, this module requires MySQL account with access to all databases that are to be monitored.

At my hosting company (rackspacecloud.com), each of the databases is on a different server, name and password, so I need to be able to enter these 3 parameters for each of the sites that I intend to monitor. This should be quite easy to code -- or not?

Comments

boran’s picture

This is a feature I'd like too, although, apart from the security implications, it requires firewalls ports for mysql to be open, and the relevant grants. Seem to me like a web based API would be needed between sites in different networks..

btopro’s picture

Status: Active » Postponed

yeah, i'm not sure that's feasible unfortunately because of the issues pointed out in reply 1. The database server that site 1 sits on would have to have access to the db that site 2 through n would be on which there's no guarantee of unfortunately. I agree this is needed but would need a patch from someone in order to investigate if it's working as we're a 1 server setup and I don't have anything distributed I could try it out on.

btopro’s picture

hmm... in thinking about this a little more, this might not be that difficult. You can already define for 1 site's ability to connect to multiple other ones via the $db_url['default'] method. If the Network manager had an option in the root site that was "which db_url is this on" it could connect to each database per the db_url specified in the array. This would also make it so that you wouldn't need to have the same user account on each one. This also has far less security implications because you'd have to have access to the settings.php file for the server anyway to set it up.

A little more configuration for the admin settings it up but it def. would solve the current symlink / shared hosting issues for connecting to "remote" and distributed sites to get their index of sites.

inders’s picture

Hi,

I agree with btopro . We can use settings.php for placing connections with other drupal installations.

In settings.php place code for $db_url such as:-

    //Db url is an array here
    $db_url = array (
        "default" => "mysqli://user1:pass1@localhost/inder_indersingh",
        "hpmandi" => "mysqli://user2:pass2@localhost/inder_hpmandi",
        "vichar" => "mysqli://user1:pass1@localhost/inder_merevichar",
        "iuser" => "mysqli://user3:pass3@localhost/inder_indiauser",
        "ipoly" => "mysqli://user1:pass1@localhost/inder_indiapoly"

    );

And in code you can use something like:-

           global $db_url;
           $db_url_array=array();
           if ( is_array($db_url)) {
                $db_url_array=($db_url);
           }
           else{
               $db_url_array[]=$db_url;
           }
           //db_set_active('default'); //This is by default
           if ( $site_key=array_search($site_db_url, $db_url_array)){
                    db_set_active($site_key);
                    //Do Anything You Like with drupla database
           }
           db_set_active('default');// Come back To your Original database

I posted a node here:
http://drupal.org/node/766212

And this methd i have used for remote_db_block.module

Live Example Site:-
http://indersingh.com

Block for Merevichar/Thoughts come from another installation.

Note:- Make sure thatconnection strings you provide are valid drupal databases. Otherwise you can get a Screenfull errors without themes. Such as... Table system dosnt exist...

Thanks
-Inder Singh

ergophobe’s picture

It would be great to do something like Inder Singh suggests because lots of people (i.e. me) don't have access to the information_schema database.

In the meantime, you might put a "Requirements" section on the module page just to save people from downloading. In my case, I typically don't see the README file because I install with drush, so I only look at it once the install fails.

asb’s picture

+1