vCMDB
vCMDB is an open source tool for computer equipment and network management , configuration and customer relationship. The VCMDB data base (Configuration Management DataBase) does not depend on a particular software and has been configured to control various internal tools and softwares. The vCMDB role is to represent an information data base with a single entry point for information request and outputs to other internal softwares (eg CRM, Nagios, Bacula, supervision, Cisco equipment configuration). The software was developed in PHP / mySQL and it includes a search engine that allows you to quickly find several types of data (text, serial numbers, phone numbers and other).
Introduction and Philosophy
vCMDB (Vincent Configuration Management DataBase) was originally developed for Rezopole in order to centralize in a single database the entire information system:
- Equipment (servers, routers)
- Sites and racks
- Optical drawers and fiber numbers
- IP addresses and VLAN
We could have started from an existing software : GLPI, OCS, Racktables, Centreon ... These are great tools, but often very typical IT and not able to store all the information you want (try putting 12 power sources to your server to see if it works ^ ^). It therefore need patches / plugins / synchros to interconnect everything you use. And we bet bet your data is duplicated in several places.
We rather use a typical Merise base (or UML) that we customize in order to accurately represents your information system. Each will have its own, but you can create the connections you want. vCMDB will allow you to be able to extract the data to your favorite applications:
- Nagios
- MRTG
- Cacti
- dhcpd
- named
- bacula
- dokuwiki
- vtiger
And when you will make the choice (voluntary or not) to change one of these tools, your database will not change, you will only need to update your exports.
Initially we wanted from to create a generic tool that can be used by both hosts/ISP, but also by any company that wants to better organize its data. Goodbye excel files and post its :)
After an extensive search of the various existing open source CMDBs, the best solution found in 2012 was onecmdb. The framework java is very VERY slow, so we decided to redevelop from scratch in PHP/MySQL.
vCMDB is distributed as Open Sourc,e under the Affero GPL licence.
Video
http://www.youtube.com/watch?v=Xsk4qQs2eJo
Elements requiered
In order to run vCMDB, you need :
- MySQL (InnoDB)
- libapache2-mod-php5
- php-fpdf
- php5
INSTALLATION
Downloads
https://sourceforge.net/projects/vcmdb/
Manual
File tree view
./triggers
./export
./storage
./scripts
./js
./import
./classes
./view
Triggers
For each object, we want to be able to execute an action when the object is added/modified/deleted.
To create a trigger,you need to creat a file:<br> triggers/<object>.php
And to create a function:
function trigger_<object>($action, $prepost, $id, $fields=null){
global $vcmdb;
global $global_url;
}
We do not charge any triggers when starting up to not overload the code and the loading.<br>
The prepost variable can either be:
*”pre” if you want to run a command before the action *”post” if you want to run a command after the action
Views
When an object such car is displayed, the edit page is lookingto see if there is a page:
view/voiture.php
If the page exists, it includes it in the PHP code. We can therefore perform various operations on the object or the generation of configuration. All configuration variables are already loaded:
$vcmdb Accès à la classe de gestion de la base de données
$data[] L'objet
$data_references[] Les liaisons 1 vers 1
$data_relations[] Les liaisons 1 vers n
Scripts
the data import scripts to vCMDB will be placed in imports
the data or pattern generation export scripts generation will be placed in exports
the scripts directory is for scheduled tasks or for scripts that you run manually with the PHP binary
MySQL data base
The tool is intended to be as generic as possible and stores this data in a database.
So that one can possibly easily question the database, we created a table for each object. We use the Merise 2 model. <br>
Warning: It is forbidden to create a table called ANY.
The '_' character and space can be used in object names (you should avoid accents and apostrophes). Each object is identified by a table in the database:
objet
objet1_objet2(_description) correspond à une jointure 1 vers 1 entre 2 objets
Here is how the keys are described in the database:
id ⇒ primary key
id_table(_description) ⇒ foreign key to a particular table
id_any_description ⇒ foreign key to any object stored as table/id
When you create an object, the following fields are automatically created:
Attribut Description
id primary key
name
created date / time of creation
lastModified date / time of modification
Table systems
vcmdb-action The list of possible actions on an object (used for managing permissions)
vcmdb-history Object history
vcmdb-language Languages managment (TO DO)
vcmdb-menu Top menu
vcmdb-menu-url Les sous menus
File storage
We can attach to each object one or several files. One can thus attach:
hardware quotes
purchase orders signed to a company
Storage is currently being done on the web server, but the software has been design tobe able to export storage by FTP for example.
Developpment
To start your own first script, it is important to throughly read the contents of classes/vcmdb.inc.php
Search an objet
Here is a simple example to get you started, we display all object account
require_once("config.inc.php");
foreach($vcmdb->search("account") as $account) {
echo $account['name'];
}
Easy right ?
You can also search with conditions:
require_once("config.inc.php");
foreach($vcmdb->search("societe",Array('name'),'name',Array("name like '%a%'")) as $account) {
echo $account['name'];
}
Retrieve an object information
require_once("config.inc.php");
$societe = $vcmdb->get("account",1);
echo $account['name'];
Collect all related objects
This allows you to retrieve all objects that refer to the inital object <br>
require_once("config.inc.php");
$array = $vcmdb->get_related_objects("account",1);
print_r($array);