HowtoCreatePatch

From Wiki Centreon

Jump to: navigation, search

If you want create a patch for Oreon, read this artiche ;p

I'm work in root directory

$> cd /root
  • Download current release of Oreon and untar in directory
$> tar -xvzf oreon-1.4.tar.gz 
  • Download dev release on svn repository
$> svn checkout http://anonymous@svn.oreon-project.org/oreon-dev

Now, you have two directory, rename oreon-dev on oreon-1.4-patch

$> ls /root
oreon-1.4
oreon-1.4-patch
  • Identify file do you want to patch. example: ./ODS/lib/purge.pm (in oreon-1.4 sources)

You must change type of file in oreon-patch with dos2unix command:

dos2unix oreon-1.4-patch/ODS/lib/purge.pm 
  • Now it's possible to create one patch.
$> diff -urN oreon-1.4/ODS/lib/purge.pm  oreon-1.4-patch/ODS/lib/purge.pm
--- oreon-1.4/ODS/lib/purge.pm  2007-03-29 12:29:05.000000000 +0200
+++ oreon-1.4-patch/ODS/lib/purge.pm    2007-04-02 20:24:27.000000000 +0200
@@ -54,7 +54,7 @@
       $sth2 = $con_oreon->prepare("SELECT hostgroup_hg_id, service_service_id FROM host_service_relation WHERE hostgroup_hg_id IS NOT NULL ");
       if (!$sth2->execute) {writeLogFile("Error in Drain function 2 : " . $sth2->errstr . "\n");}
       while ($data = $sth2->fetchrow_hashref()){
-               $sth3 = $con_oreon->prepare("SELECT * FROM hostgroup_relation WHERE hg_id = '".$data->{'hostgroup_hg_id'}."'");
+               $sth3 = $con_oreon->prepare("SELECT * FROM hostgroup_relation WHERE hostgroup_hg_id ='".$data->{'hostgroup_hg_id'}."'");
               if (!$sth3->execute) {writeLogFile("Error in Drain function 2 : " . $sth2->errstr . "\n");}
               while ($data_hg = $sth3->fetchrow_hashref()){
                       $srv_list{$data_hg->{'host_host_id'} ."_". $data->{'service_service_id'}} = 1;
  • Good, now you must redirect in patch file
$> diff -urN oreon-1.4/ODS/lib/purge.pm  oreon-1.4-patch/ODS/lib/purge.pm > 01-oreon_ODS_lib_purge-pm.patch
  • After this process, go on this page for how to apply your patch

List_of_patch_for_oreon-1.4

Personal tools