Update of /cvsroot/perfparse/_perfparse-phpgui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27744
Modified Files:
perfparse.php utils.php
Log Message:
in the middle of rewrite
Index: utils.php
===================================================================
RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** utils.php 14 Sep 2006 14:02:06 -0000 1.26
--- utils.php 9 Nov 2006 12:53:01 -0000 1.27
***************
*** 227,240 ****
function get_groups(&$db) {
! $query ='SELECT group_name from perfdata_host_group';
! $ret=$db->GetCol($query);
return($ret);
}
function get_group_hosts(&$db,$group) {
! $query ='SELECT host_name from perfdata_host where group_name=?';
$ret=$db->GetCol($query,array($group));
return($ret);
}
function get_group_host_metrics(&$db,$group,$sort) {
--- 227,282 ----
function get_groups(&$db) {
! $query ='SELECT group_name,group_id from perfdata_groups';
! $res=$db->Execute($query);
! $ret=array();
! if($res) {
! while($t=$res->FetchRow()) {
! $ret[$t['group_id']]=$t['group_name'];
! }
! } else {
! echo "Error in query $query. Message: ".$db->ErrorMsg();
! }
!
! // echo "<pre>in ".__FILE__." line ".__LINE__." function ".__FUNCTION__.":\n";print_r($ret);echo "</pre>";
!
return($ret);
}
+ // get all hostnames from a given group name
function get_group_hosts(&$db,$group) {
! $query ='SELECT h.host_name from perfdata_host h, perfdata_host_groups hg,
! perfdata_groups g where g.group_name=? and
! hg.group_id=g.group_id and
! h.host_id=hg.host_id';
$ret=$db->GetCol($query,array($group));
return($ret);
}
+
+ // get all hostnames from a given groupId
+ function get_groupId_hosts(&$db,$groupId) {
+ $query ='SELECT h.host_name from perfdata_host h, perfdata_host_groups hg
+ where hg.group_id=? and
+ h.host_id=hg.host_id';
+ $ret=$db->GetCol($query,array($groupId));
+ return($ret);
+ }
+
+ // get all hostids from a given group id
+ function get_groupId_hostIds(&$db,$groupId) {
+ $query ='SELECT host_id from perfdata_host_groups
+ where group_id=?';
+ $ret=$db->GetCol($query,array($groupId));
+ return($ret);
+ }
+
+ // 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';
+ $ret=$db->GetCol($query,array($groupId));
+ return($ret);
+ }
+
function get_group_host_metrics(&$db,$group,$sort) {
Index: perfparse.php
===================================================================
RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** perfparse.php 15 Sep 2006 06:34:53 -0000 1.38
--- perfparse.php 9 Nov 2006 12:53:01 -0000 1.39
***************
*** 54,58 ****
// php-perfparse version
! $smarty->assign('version','perfparse 0.106.1 php-perfparse v.05');
// Parse perfparse.conf to get database variables
--- 54,61 ----
// php-perfparse version
! $smarty->assign('version','perfparse 0.106.2');
!
! //minimum Database schema version required
! $db_schema_version=20;
// Parse perfparse.conf to get database variables
|