Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
* refs #564
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Assepo committed Sep 16, 2015
1 parent 460a9db commit 3534702
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ function mainLoopLocal() {
}
}
_oldInputFieldValue = _currentInputFieldValue;

jQuery("#sg_search").on('change', function(){
monitoring_refresh();
});

setTimeout("mainLoopLocal()", 250);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ function mainLoopLocal() {
}
}
_oldInputFieldValue = _currentInputFieldValue;

jQuery("#sg_search").on('change', function(){
monitoring_refresh();
});

setTimeout("mainLoopLocal()", 250);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@
<input type='hidden' id='limit' name='limit' value='{$limit}'>
{$form.hidden}
</form>
<script type="text/javascript">
{literal}
jQuery("#sg_search").on('change', function(){
monitoring_refresh();
});
{/literal}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@

ini_set("display_errors", "Off");

include_once "@CENTREON_ETC@/centreon.conf.php";
//include_once "@CENTREON_ETC@/centreon.conf.php";
include_once "/etc/centreoncentreon.conf.php";

include_once $centreon_path . "www/class/centreonXMLBGRequest.class.php";
include_once $centreon_path . "www/include/monitoring/status/Common/common-Func.php";
Expand Down Expand Up @@ -72,7 +73,8 @@
$limit = $obj->checkArgument("limit", $_GET, 20);
$instance = $obj->checkArgument("instance", $_GET, $obj->defaultPoller);
$hostgroups = $obj->checkArgument("hostgroups", $_GET, $obj->defaultHostgroups);
$search = $obj->checkArgument("search", $_GET, "");
$hSearch = $obj->checkArgument("host_search", $_GET, "");
$sgSearch = $obj->checkArgument("sg_search", $_GET, "");
$sort_type = $obj->checkArgument("sort_type", $_GET, "host_name");
$order = $obj->checkArgument("order", $_GET, "ASC");
$dateFormat = $obj->checkArgument("date_time_format_status", $_GET, "d/m/Y H:i:s");
Expand Down Expand Up @@ -113,8 +115,12 @@
$query .= $obj->access->queryBuilder("AND", "s.service_id", $obj->access->getServicesString("ID", $obj->DBC));

/* Host search */
if ($search != ""){
$query .= "AND h.name like '%" . $search . "%' ";
if ($hSearch != ""){
$query .= "AND h.name like '%" . $hSearch . "%' ";
}

if ($sgSearch != ""){
$query .= "AND sg.name like '%" . $sgSearch . "%' ";
}

/* Service search */
Expand All @@ -127,6 +133,8 @@

$query .= "ORDER BY sg.name " . $order . " "
. "LIMIT " . ($num * $limit) . "," . $limit;

//echo $query;
$DBRESULT = $obj->DBC->query($query);

$numRows = $obj->DBC->numberRows();
Expand Down Expand Up @@ -165,11 +173,11 @@
$obj->XML->writeElement("p", $p);
($o == "svcOVSG") ? $obj->XML->writeElement("s", "1") : $obj->XML->writeElement("s", "0");
$obj->XML->endElement();

$query2 = "SELECT SQL_CALC_FOUND_ROWS DISTINCT sg.name AS sg_name, sg.alias, h.name as host_name, h.state as host_state, h.icon_image, h.host_id, s.state, s.description, s.service_id "
. "FROM servicegroups sg, services_servicegroups sgm, services s, hosts h "
. "WHERE h.host_id = s.host_id AND s.host_id = sgm.host_id AND s.service_id=sgm.service_id ";

$query2 .= $s_search
. $sg_search
. $obj->access->queryBuilder("AND", "s.service_id", $obj->access->getServicesString("ID", $obj->DBC));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@

ini_set("display_errors", "Off");

include_once "@CENTREON_ETC@/centreon.conf.php";
//include_once "@CENTREON_ETC@/centreon.conf.php";
include_once "/etc/centreon/centreon.conf.php";

include_once $centreon_path . "www/class/centreonXMLBGRequest.class.php";
include_once $centreon_path . "www/include/monitoring/status/Common/common-Func.php";
Expand Down Expand Up @@ -72,7 +73,8 @@
$limit = $obj->checkArgument("limit", $_GET, 20);
$instance = $obj->checkArgument("instance", $_GET, $obj->defaultPoller);
$hostgroups = $obj->checkArgument("hostgroups", $_GET, $obj->defaultHostgroups);
$search = $obj->checkArgument("search", $_GET, "");
$hSearch = $obj->checkArgument("host_search", $_GET, "");
$sgSearch = $obj->checkArgument("sg_search", $_GET, "");
$sort_type = $obj->checkArgument("sort_type", $_GET, "host_name");
$order = $obj->checkArgument("order", $_GET, "ASC");
$dateFormat = $obj->checkArgument("date_time_format_status", $_GET, "d/m/Y H:i:s");
Expand Down Expand Up @@ -113,8 +115,12 @@
$query .= $obj->access->queryBuilder("AND", "s.service_id", $obj->access->getServicesString("ID", $obj->DBC));

/* Host search */
if ($search != ""){
$query .= "AND h.name like '%" . $search . "%' ";
if ($hSearch != ""){
$query .= "AND h.name like '%" . $hSearch . "%' ";
}

if ($sgSearch != ""){
$query .= "OR sg.name like '%" . $sgSearch . "%' ";
}

/* Service search */
Expand All @@ -127,6 +133,8 @@

$query .= "ORDER BY sg.name " . $order . " "
. "LIMIT " . ($num * $limit) . "," . $limit;

//echo $query;
$DBRESULT = $obj->DBC->query($query);

$numRows = $obj->DBC->numberRows();
Expand Down

0 comments on commit 3534702

Please sign in to comment.