Remove unused PHP files related to Hyper-V and Storage dashboards
- Deleted `cluster-detail2.php`, `constants.inc copy.php`, `D.php`, and `Dashboard2.php`. These files were no longer in use and contributed to unnecessary clutter in the codebase. - Cleaned up references to removed files.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
include $_SERVER['DOCUMENT_ROOT']."/include/constants.inc.php";
|
||||
include $_SERVER['DOCUMENT_ROOT']."/include/db_connect.inc.php";
|
||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.inc.php";
|
||||
include $_SERVER['DOCUMENT_ROOT']."/include/function.inc.php";
|
||||
include $_SERVER['DOCUMENT_ROOT']."/include/modal_wait.html";
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
//CONSTANT
|
||||
$BaseUrl = "http://".$_SERVER['SERVER_NAME'];
|
||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||
$bdnuss = "http://web-bdnuss-sys-dev.appliarmony.net";
|
||||
$wsUrl = "http://wsinfra.appliarmony.net";
|
||||
|
||||
//Servers
|
||||
$dcArmony = "dun-dom-s1dcb";
|
||||
$dcADArmony = "dun-dcp-r02";
|
||||
$uxDNS = "dun-com-uxdns01";
|
||||
$sSCOM = "dun-prd-x1scom";
|
||||
$sVMM = "dun-sup-s1vmmsv";
|
||||
|
||||
?>
|
||||
@@ -3,6 +3,3 @@
|
||||
$BaseUrl = "http://".$_SERVER['SERVER_NAME'];
|
||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||
$bdnuss = "http://web-bdnuss-sys-dev.appliarmony.net";
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,189 +0,0 @@
|
||||
<?php
|
||||
//Web-Self-Infra sur DUN-PRD-R1SCOM\OPS
|
||||
function Invoke_WebSelfInfra($request)
|
||||
{
|
||||
$user = "Scom-Write";
|
||||
$pwd = "Grant@ccess";
|
||||
$server = "DUN-PRD-R1SCOM.armony.net\OPS";
|
||||
$database = "web-self-infra";
|
||||
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = odbc_exec($conn, $request);
|
||||
if (instr(strtoupper($request), "SELECT")) {
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke_SCOMInfra($request)
|
||||
{
|
||||
$user = "Scom-Write";
|
||||
$pwd = "Grant@ccess";
|
||||
$server = "DUN-PRD-R1SCOM.armony.net\OPS";
|
||||
$database = "infra";
|
||||
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = odbc_exec($conn, $request);
|
||||
if (instr(strtoupper($request), "SELECT")) {
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
}
|
||||
}
|
||||
|
||||
//MySQL sur DUN-SUP-ENTRY01
|
||||
function Invoke_Entry01($request)
|
||||
{
|
||||
$user = "infra";
|
||||
$pwd = "infra";
|
||||
$server = "dun-sup-entry01:3306";
|
||||
$database = "infra";
|
||||
$conn = new mysqli($server, $user, $pwd, $database);
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = $conn->query($request);
|
||||
while ($row = mysqli_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
}
|
||||
}
|
||||
|
||||
// MySQL web-infra-tools sur DUN-SUP-S2ENTRY
|
||||
function Invoke_WebInfraTools($request)
|
||||
{
|
||||
$user = "admin";
|
||||
$pwd = "Arth3m1s&*0";
|
||||
$server = "dun-sup-s2entry.armony.net:3306";
|
||||
$database = "webinfratools";
|
||||
$conn = new mysqli($server, $user, $pwd, $database);
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = $conn->query($request);
|
||||
while ($row = mysqli_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
}
|
||||
}
|
||||
|
||||
// MySQL web-infra-tools sur DUN-SUP-S2ENTRY
|
||||
function Invoke_WebInfraReports($request)
|
||||
{
|
||||
$user = "admin";
|
||||
$pwd = "Arth3m1s&*0";
|
||||
$server = "dun-sup-s2entry.armony.net:3306";
|
||||
$database = "web-infra-reports";
|
||||
$conn = new mysqli($server, $user, $pwd, $database);
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = $conn->query($request);
|
||||
while ($row = mysqli_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
}
|
||||
}
|
||||
|
||||
//INFRA sur DUN-PRD-R1MSSQL\PRD
|
||||
function Invoke_Infra($request)
|
||||
{
|
||||
error_reporting(E_ALL ^ E_WARNING);
|
||||
$user = "INFRA_dbo";
|
||||
$pwd = "Q3pUz2x9YL2r6k";
|
||||
$server = "DUN-PRD-R1MSSQL.armony.net\PRD";
|
||||
$database = "INFRA";
|
||||
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = odbc_exec($conn, $request);
|
||||
if (instr(strtoupper($request), "SELECT")) {
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
} else {
|
||||
if ($rs) {
|
||||
return "OK";
|
||||
} else {
|
||||
error_reporting(E_ALL);
|
||||
return "ERROR : " . odbc_errormsg($conn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// aixcmdb
|
||||
function Invoke_aixcmdb($request)
|
||||
{
|
||||
error_reporting(E_ALL ^ E_WARNING);
|
||||
$conn_string = "DRIVER={IBM DB2 ODBC DRIVER};" .
|
||||
"DATABASE=AIXCMDB; " .
|
||||
"HOSTNAME=db2_aixcmdb.appliarmony.net;" .
|
||||
"PORT=50000; " .
|
||||
"PROTOCOL=TCPIP; " .
|
||||
"UID=aixcmdb;" .
|
||||
"AUTHENTICATION=SERVER;" .
|
||||
"PWD=aixcmdb;";
|
||||
$conn = odbc_connect($conn_string, "", "");
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = odbc_exec($conn, $request);
|
||||
if (instr(strtoupper($request), "SELECT")) {
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
} else {
|
||||
if ($rs) {
|
||||
return "OK";
|
||||
} else {
|
||||
error_reporting(E_ALL);
|
||||
return "ERROR : " . odbc_errormsg($conn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Invoke_GLPI($request)
|
||||
{
|
||||
$user="glpi_lect_seule";
|
||||
$pwd="glpi_lect_seule";
|
||||
$server="srvv-n4glpi-aim.process.dkm";
|
||||
$server="mys_glpi_prod.appliarmony.net";
|
||||
$database="glpi";
|
||||
$conn = new mysqli($server, $user, $pwd, $database);
|
||||
if (!($conn)) {
|
||||
echo "Pas de connexion";
|
||||
}
|
||||
$rs = $conn->query($request);
|
||||
while ($row = mysqli_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
function DB_SCCM(){
|
||||
$user = "infra";
|
||||
$pwd = "infra";
|
||||
global $conn ;
|
||||
$conn = odbc_connect("Driver={SQL Server};Server=DUN-SMS-SRV01;Database=CM_SV1;", $user, $pwd);
|
||||
if(!($conn)){echo "Pas de connexion";}
|
||||
}
|
||||
|
||||
function DB_GLPI() {
|
||||
$username="glpi_lect_seule";
|
||||
$password="glpi_lect_seule";
|
||||
$dbserver="mys_glpi_prod.appliarmony.net";
|
||||
$database="glpi";
|
||||
global $conn ;
|
||||
$conn = new mysqli($dbserver,$username,$password,$database);
|
||||
}
|
||||
|
||||
function DB_ENTRY01() {
|
||||
$username="infra";
|
||||
$password="infra";
|
||||
$dbserver="dun-sup-entry01.armony.net";
|
||||
$database="infra";
|
||||
global $conn ;
|
||||
$conn = new mysqli($dbserver,$username,$password,$database);
|
||||
}
|
||||
|
||||
function DB_ENTRY02() {
|
||||
$username="admin";
|
||||
$password="Arth3m1s&*0";
|
||||
$dbserver="dun-sup-s2entry.armony.net";
|
||||
$database="web-infra-reports";
|
||||
global $conn ;
|
||||
$conn = new mysqli($dbserver,$username,$password,$database);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
function instr($string, $search){
|
||||
if (strpos($string, $search) !== false) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function PostJson($url, $content){
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||
$retour = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
return $retour;
|
||||
}
|
||||
|
||||
function Read_HTML($url){
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
$retour = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
return $retour;
|
||||
}
|
||||
if($_SERVER['REMOTE_USER'] != ""){$source = explode("\\",$_SERVER['REMOTE_USER'])[1];}
|
||||
|
||||
?>
|
||||
@@ -1,15 +0,0 @@
|
||||
<div class="preloader">
|
||||
<br>
|
||||
<h1><span style="color: white"><b>Loading Data</b></h1>
|
||||
<h3><span style="color: white"><b>Please wait ...</b></h3>
|
||||
<div class="loader">
|
||||
<div class="loader-outter"></div>
|
||||
<div class="loader-inner"></div>
|
||||
<div class="indicator">
|
||||
<svg width="16px" height="12px">
|
||||
<polyline id="back" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
|
||||
<polyline id="front" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
46
include/test.php
Normal file
46
include/test.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
// Temporarily enable all error reporting to catch details from odbc_connect
|
||||
// error_reporting(E_ALL); // Uncomment this line if you still don't get enough info
|
||||
|
||||
$conn_string = "DRIVER={IBM DB2 ODBC DRIVER - F_DB2_clidriver};" .
|
||||
"DATABASE=AIXCMDB; " .
|
||||
"HOSTNAME=db2_aixcmdb.appliarmony.net;" .
|
||||
"PORT=50000; " .
|
||||
"PROTOCOL=TCPIP; " .
|
||||
"UID=aixcmdb;" .
|
||||
"AUTHENTICATION=SERVER;" .
|
||||
"PWD=aixcmdb;";
|
||||
|
||||
$conn = odbc_connect($conn_string, "", "");
|
||||
|
||||
if (!$conn) {
|
||||
// --- IMPORTANT: Récupérer le message d'erreur ODBC détaillé ---
|
||||
$error_message = "ODBC Connect Error: " . odbc_errormsg() . " (" . odbc_error() . ")";
|
||||
echo "Pas de connexion : " . $error_message . "<br>";
|
||||
// Pour débogage, tu peux aussi loguer cette erreur dans un fichier
|
||||
// error_log($error_message);
|
||||
return "ERROR: Could not connect to DB2. Check connection string and ODBC setup."; // Retourne une erreur pour éviter l'appel à odbc_exec
|
||||
}
|
||||
|
||||
$rs = odbc_exec($conn, $request);
|
||||
|
||||
// Ton code existant après la connexion
|
||||
if (strpos(strtoupper($request), "SELECT") !== false) { // strpos est plus robuste que instr ici en PHP
|
||||
$answer = []; // Initialize array to prevent undefined variable warning
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
} else {
|
||||
if ($rs) {
|
||||
return "OK";
|
||||
} else {
|
||||
// If odbc_exec failed
|
||||
error_reporting(E_ALL); // Re-enable for this specific error if needed
|
||||
return "ERROR : " . odbc_errormsg($conn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user