Changeset 6698
- Timestamp:
- 10/02/08 22:31:59 (2 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/centreon/www/include/configuration/configGenerate/formGenerateFiles.php
r6646 r6698 27 27 } 28 28 29 # Get Poller List 29 /* 30 * Get Poller List 31 */ 30 32 $DBRESULT =& $pearDB->query("SELECT * FROM `nagios_server` WHERE `ns_activate` = '1' ORDER BY `localhost` DESC"); 31 33 if (PEAR::isError($DBRESULT)) 32 34 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 33 if ($DBRESULT->numRows() > 1) { 35 $n = $DBRESULT->numRows(); 36 /* 37 * Display null option 38 */ 39 if ($n > 1) 34 40 $tab_nagios_server = array(NULL => ""); 35 $tab_nagios_server[0] = _("All Nagios Servers"); 36 } 41 /* 42 * Display all servers list 43 */ 37 44 for ($i = 0; $nagios =& $DBRESULT->fetchRow(); $i++) 38 45 $tab_nagios_server[$nagios['id']] = $nagios['name']; 46 $DBRESULT->free(); 47 /* 48 * Display all server options 49 */ 50 if ($n > 1) { 51 $tab_nagios_server[0] = _("All Nagios Servers"); 39 52 40 53 /* … … 88 101 $host_list[$key] = $value; 89 102 90 if (isset($ret["gen"]) && $ret["gen"] && $ret["host"]){103 if (isset($ret["gen"]) && $ret["gen"] && ($ret["host"] == 0 || $ret["host"])){ 91 104 /* 92 105 * Check dependancies … … 97 110 print "DB Error : ".$DBRESULT_Servers->getDebugInfo()."<br />"; 98 111 while ($tab =& $DBRESULT_Servers->fetchRow()){ 99 if (isset($ret["host"]) && $ret["host"] == 0 || $ret["host"] == $tab['id']){ 112 if (isset($ret["host"]) && $ret["host"] == 0 || $ret["host"] == $tab['id']){ 100 113 unset($DBRESULT2); 101 require ($path."genCGICFG.php");102 require ($path."genNagiosCFG.php");103 require ($path."genNdomod.php");104 require ($path."genNdo2db.php");105 require ($path."genNagiosCFG-DEBUG.php");106 require ($path."genResourceCFG.php");107 require ($path."genTimeperiods.php");108 require ($path."genCommands.php");109 require ($path."genContacts.php");110 require ($path."genContactGroups.php");111 require ($path."genHosts.php");112 require ($path."genExtendedInfos.php");113 require ($path."genHostGroups.php");114 require ($path."genServices.php");115 require ($path."genServiceGroups.php");116 require ($path."genEscalations.php");117 require ($path."genDependencies.php");118 require ($path."centreon_pm.php");114 require $path."genCGICFG.php"; 115 require $path."genNagiosCFG.php"; 116 require $path."genNdomod.php"; 117 require $path."genNdo2db.php"; 118 require $path."genNagiosCFG-DEBUG.php"; 119 require $path."genResourceCFG.php"; 120 require $path."genTimeperiods.php"; 121 require $path."genCommands.php"; 122 require $path."genContacts.php"; 123 require $path."genContactGroups.php"; 124 require $path."genHosts.php"; 125 require $path."genExtendedInfos.php"; 126 require $path."genHostGroups.php"; 127 require $path."genServices.php"; 128 require $path."genServiceGroups.php"; 129 require $path."genEscalations.php"; 130 require $path."genDependencies.php"; 131 require $path."centreon_pm.php"; 119 132 } 120 133 unset($generatedHG); … … 122 135 unset($generatedS); 123 136 } 124 } 137 } 138 125 139 /* 126 140 * Meta Module Generator engine 127 141 */ 142 128 143 $DBRESULT_Servers =& $pearDB->query("SELECT `id`, `localhost` FROM `nagios_server` ORDER BY `localhost` DESC"); 129 144 if (PEAR::isError($DBRESULT_Servers)) … … 212 227 } 213 228 } else { 214 passthru ("echo 'SENDCFGFILE:".$host['id']."' >> @CENTREON_VARLIB@/centcore.cmd", $return);229 passthru("echo 'SENDCFGFILE:".$host['id']."' >> @CENTREON_VARLIB@/centcore.cmd", $return); 215 230 } 216 231 }
