OpenNetAdmin

Track. Automate. Configure.

Home About Features Community Develop
Download this project as a tar.gz file

dcm.pl and contexts

bluetesteur

20-12-2011 10:54:42

Hi every body,

first of all, thanks Matt for your very good job, ONA is so close to what we are looking to ;-)

Can any one explain how to change/switch contexts using dcm.pl tool, i think that it should be possible because a dcm release was done for this :
## 11/17/2005 - v1.12 - Brandon Zehm
## - Add option for displaying & switching ipdb contexts

but I don't found where and how do this switch ...

thanks for your help.

Sam

Matt

21-12-2011 23:41:47

Glad you like it so far!

Contexts are more of an experiment at this point (and thus, may never see light of day). The comment you see in dcm.pl is actually very old and not quite related to the current implementation of a context. Contexts are a method of using one ONA code base install against multiple backend database instances. They are whole separate copies of each other at the data level. You could use them to track overlapping sets of data or maybe something like internal/external sets of data. There is currently no method to enable it other than manually editing the /opt/ona/www/local/config/database_settings.inc.php file to reflect the contexts.

Also, in addition, I still have to make a few changes to dcm.pl to actually allow you to specify which context to use. So the note you saw actually does not currently apply to things.

SOOOOO.. long answer short, its kinda sorta there and is not a mainline feature. so I would suggest avoiding it unless you have a serious need for it :)..

Here is an example database_settings file that would turn on contexts (BEWARE ALL WHO ENTER HERE!!!!):


$ona_contexts=array (
'DEFAULT' =>
array (
'databases' =>
array (
0 =>
array (
'db_type' => 'mysqlt',
'db_host' => 'localhost',
'db_login' => 'ona_sys',
'db_passwd' => '',
'db_database' => 'ona_default',
'db_debug' => false,
),
),
'description' => 'Default data context',
'context_color' => '#D3DBFF',
),
'EXTERNAL' =>
array (
'databases' =>
array (
0 =>
array (
'db_type' => 'mysqlt',
'db_host' => 'localhost',
'db_login' => 'ona_sys',
'db_passwd' => '',
'db_database' => 'ona_external',
'db_debug' => false,
),
),
'description' => 'External data context',
'context_color' => '#D3DBAA',
),
);

bluetesteur

02-01-2012 09:56:52

Thanks Matt, for your answers.

Contexts are really useful for me, I need to manage several customers Ip datas with overlapping.
I would use dcm.pl tool to import datas into each context, but it seems that I have to do this in one shoot by changing database_settings.inc.php for each import on each context (Am i right ?)

Sam

Matt

02-01-2012 10:44:07

Yep the contexts should help you with the overlapping customer data.

You are correct that at the current time since dcm.pl is not currently capable of switching the contexts on its own, you would have to manually do it via database_settings.inc.php. The GUI should be updated and should allow you to switch between contexts via a dropdown in the center of the screen just below the top menu bar.

As I said, I'm not sure how much attention over time this feature will get. My real intention is to update the system so you can do multiple VRFs and thus track overlapping data within one database instance. That too is one that will take a bit of time to complete.

I'll try and get dcm.pl updated at some point tho to at least switch contexts.