Update of /cvsroot/perfparse/_perfparse-phpgui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/phpgui
Modified Files:
perfparse.php utils.php
Log Message:
some cosmetic changes and a little work on the php interface
Index: utils.php
===================================================================
RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** utils.php 6 Sep 2007 22:59:50 -0000 1.43
--- utils.php 28 Sep 2007 21:53:16 -0000 1.44
***************
*** 224,228 ****
if($res) {
while($t=$res->FetchRow()) {
! $ret[$t['service_id']][$t['metric_id']]=$t['metric'];
$ret[$t['service_id']]['service_description']=$t['service_description'];
}
--- 224,228 ----
if($res) {
while($t=$res->FetchRow()) {
! $ret[$t['service_id']]['metrics'][$t['metric_id']]=$t['metric'];
$ret[$t['service_id']]['service_description']=$t['service_description'];
}
***************
*** 230,233 ****
--- 230,237 ----
echo "Error in query $query. Message: ".$db->ErrorMsg();
}
+ // array enrichment
+ foreach($ret as $serviceid => $servicearray) {
+ $ret[$serviceid]['count_metrics']=count($servicearray['metrics']);
+ }
return($ret);
}
***************
*** 278,286 ****
// get hostids and hostnames from a given groupid
function get_groupId_hostinfos(&$db,$groupId) {
! $query ='SELECT h.host_name, h.host_id from perfdata_host h, perfdata_host_groups hg
where hg.group_id=? and
h.host_id=hg.host_id';
! $res=$db->Execute($query,array($groupId));
$ret=array();
if($res) {
--- 282,297 ----
// get hostids and hostnames from a given groupid
+ // if groupId is -1 then get infos of all hosts without group
function get_groupId_hostinfos(&$db,$groupId) {
! if($groupId == -1) {
! $query = 'SELECT h.host_name, h.host_id from perfdata_host h left join perfdata_host_groups hg
! on h.host_id=hg.host_id where hg.group_id is NULL';
! $res=$db->Execute($query);
! } else {
! $query ='SELECT h.host_name, h.host_id from perfdata_host h, perfdata_host_groups hg
where hg.group_id=? and
h.host_id=hg.host_id';
! $res=$db->Execute($query,array($groupId));
! }
$ret=array();
if($res) {
Index: perfparse.php
===================================================================
RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** perfparse.php 6 Sep 2007 22:59:50 -0000 1.56
--- perfparse.php 28 Sep 2007 21:53:16 -0000 1.57
***************
*** 657,661 ****
}
! /* debug
echo "<pre>group_id: $group_id\n</pre>";
echo "<pre>groupinfos:\n"; print_r($groupinfos); echo "\n</pre>";
--- 657,661 ----
}
! ///* debug
echo "<pre>group_id: $group_id\n</pre>";
echo "<pre>groupinfos:\n"; print_r($groupinfos); echo "\n</pre>";
***************
*** 664,668 ****
echo "<pre>bin_group_policy:\n"; print_r($bin_group_policy); echo "\n</pre>";
echo "<pre>bin_host_policy:\n"; print_r($bin_host_policy); echo "\n</pre>";
! */
/* debug
--- 664,668 ----
echo "<pre>bin_group_policy:\n"; print_r($bin_group_policy); echo "\n</pre>";
echo "<pre>bin_host_policy:\n"; print_r($bin_host_policy); echo "\n</pre>";
! //*/
/* debug
|