diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/bartlby_action.php bartlby-ui/bartlby_action.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/bartlby_action.php 2007-01-05 02:49:48.000000000 +0100 +++ bartlby-ui/bartlby_action.php 2007-03-22 02:10:16.000000000 +0100 @@ -242,8 +242,8 @@ $svc=bartlby_get_service($btl->CFG, $y); if($svc[server_id] == $_GET[server_id]) { for($x=0; $x"; - if($svc[service_name] == $re[$x][service_name] && $svc[plugin] == $re[$x][plugin] && $svc[plugin_arguments] == $re[$x][plugin_arguments] && $svc[check_interval] == $re[$x][check_interval] && $svc[service_type] == $re[$x][service_type] && $svc[hour_from] == $re[$x][hour_from] && $svc[hour_to] == $re[$x][hour_to] && $svc[min_from] == $re[$x][min_from] && $svc[min_to] == $re[$x][min_to]) { + + if($svc[service_name] == $re[$x][service_name] && $svc[plugin] == $re[$x][plugin] && $svc[plugin_arguments] == $re[$x][plugin_arguments] && $svc[check_interval] == $re[$x][check_interval] && $svc[service_type] == $re[$x][service_type] && $svc[exec_plan] == $re[$x][exec_plan]) { $global_msg["package"] .= "Removing Service: " . $re[$x][service_name] . "
"; $global_msg["package"] .= str_repeat(" ", 20) . "Plugin:" . $re[$x][plugin] . "/'" . $re[$x][plugin_arguments] . " '
"; @@ -381,8 +381,20 @@ $triggerstr = "|" . $triggerstr; } + $exec_plan = ""; + $df=false; + while(list($k, $v) = each($_GET[wdays_plan])) { + if($v != "") { + $df = true; + } + $exec_plan .= $k . "=" . $v . "|"; + } - $add=bartlby_modify_worker($btl->CFG,$_GET[worker_id], $_GET[worker_mail], $_GET[worker_icq], $svcstr, $notifystr, $_GET[worker_active], $_GET[worker_name], md5($_GET[worker_password]), $triggerstr, $_GET[escalation_limit], $_GET[escalation_minutes]); + if($df == false) { + $exec_plan=""; + } + + $add=bartlby_modify_worker($btl->CFG,$_GET[worker_id], $_GET[worker_mail], $_GET[worker_icq], $svcstr, $notifystr, $_GET[worker_active], $_GET[worker_name], md5($_GET[worker_password]), $triggerstr, $_GET[escalation_limit], $_GET[escalation_minutes], $exec_plan); $btl->setUIRight("selected_servers", $selected_servers, $_GET[worker_name]); $btl->setUIRight("selected_services", $selected_services, $_GET[worker_name]); $layout->OUT .= ""; @@ -428,9 +440,21 @@ if($triggerstr != "") { $triggerstr = "|" . $triggerstr; } + $exec_plan = ""; + $df=false; + while(list($k, $v) = each($_GET[wdays_plan])) { + if($v != "") { + $df = true; + } + $exec_plan .= $k . "=" . $v . "|"; + } + + if($df == false) { + $exec_plan=""; + } - $add=bartlby_add_worker($btl->CFG, $_GET[worker_mail], $_GET[worker_icq], $svcstr, $notifystr, $_GET[worker_active], $_GET[worker_name], md5($_GET[worker_password]), $triggerstr, $_GET[escalation_limit], $_GET[escalation_minutes]); + $add=bartlby_add_worker($btl->CFG, $_GET[worker_mail], $_GET[worker_icq], $svcstr, $notifystr, $_GET[worker_active], $_GET[worker_name], md5($_GET[worker_password]), $triggerstr, $_GET[escalation_limit], $_GET[escalation_minutes], $exec_plan); $layout->OUT .= ""; @@ -453,11 +477,24 @@ set_magic_quotes_runtime(0); $layout->set_menu("services"); - if($_GET[service_id] != "" && $_GET[service_id] && $_GET[service_server] && $_GET[service_type] && $_GET[service_name] && $_GET[service_time_from] && $_GET[service_time_to] && $_GET[service_interval]) { + if($_GET[service_id] != "" && $_GET[service_id] && $_GET[service_server] && $_GET[service_type] && $_GET[service_name] && $_GET[service_interval] != "") { $btl->hasServerorServiceRight($_GET[service_id]); - //echo "$ads=bartlby_modify_service($btl->CFG, $_GET[service_id] , $_GET[service_server], $_GET[service_plugin],$_GET[service_name],$_GET[service_args],1, dnl(substr($_GET[service_time_from], 0, 2)), dnl(substr($_GET[service_time_to], 0, 2)), dnl(substr($_GET[service_time_from], 3, 2)), dnl(substr($_GET[service_time_to], 3, 2)),$_GET[service_interval],$_GET[service_type],$_GET[service_var], $_GET[service_passive_timeout], $_GET[service_check_timeout]);"; - $ads=bartlby_modify_service($btl->CFG, $_GET[service_id] , $_GET[service_server], $_GET[service_plugin],$_GET[service_name],$_GET[service_args],$_GET[notify_enabled], dnl(substr($_GET[service_time_from], 0, 2)), dnl(substr($_GET[service_time_to], 0, 2)), dnl(substr($_GET[service_time_from], 3, 2)), dnl(substr($_GET[service_time_to], 3, 2)),$_GET[service_interval],$_GET[service_type],$_GET[service_var], $_GET[service_passive_timeout], $_GET[service_check_timeout], $_GET[service_ack], $_GET[service_retain], $_GET[service_snmp_community], $_GET[service_snmp_objid], $_GET[service_snmp_version], $_GET[service_snmp_warning], $_GET[service_snmp_critical], $_GET[service_snmp_type], $_GET[service_active], $_GET[flap_seconds]); + $df=false; + $exec_plan = ""; + while(list($k, $v) = each($_GET[wdays_plan])) { + if($v != "") { + $df = true; + } + $exec_plan .= $k . "=" . $v . "|"; + } + + + if($df == false) { + $exec_plan=""; + } + $ads=bartlby_modify_service($btl->CFG, $_GET[service_id] , $_GET[service_server], $_GET[service_plugin],$_GET[service_name],$_GET[service_args],$_GET[notify_enabled], $exec_plan,$_GET[service_interval],$_GET[service_type],$_GET[service_var], $_GET[service_passive_timeout], $_GET[service_check_timeout], $_GET[service_ack], $_GET[service_retain], $_GET[service_snmp_community], $_GET[service_snmp_objid], $_GET[service_snmp_version], $_GET[service_snmp_warning], $_GET[service_snmp_critical], $_GET[service_snmp_type], $_GET[service_active], $_GET[flap_seconds]); $global_msg=bartlby_get_server_by_id($btl->CFG, $_GET[service_server]); + $global_msg[exec_plan]=$btl->resolveServicePlan($exec_plan); if(strlen($_GET["unlock"]) > 0) { bartlby_toggle_service_active($btl->CFG, $_GET["unlock"], 0); @@ -476,14 +513,29 @@ break; case 'add_service': $layout->set_menu("services"); - if($_GET[service_server] && $_GET[service_type] && $_GET[service_name] && $_GET[service_time_from] && $_GET[service_time_to] && $_GET[service_interval]) { - //&bartlby_config, &server_id, &plugin,&service_name,&plugin_arguments,¬ify_enabled,&hour_from,&hour_to, + if($_GET[service_server] && $_GET[service_type] && $_GET[service_name] && $_GET[service_interval]) { + //&min_from, //&min_to,&check_interva l, &service_type,&service_var,&service_passive_timeout set_magic_quotes_runtime(0); - $ads=bartlby_add_service($btl->CFG, $_GET[service_server], $_GET[service_plugin],$_GET[service_name],$_GET[service_args],$_GET[notify_enabled], substr($_GET[service_time_from], 0, 2), substr($_GET[service_time_to], 0, 2), substr($_GET[service_time_from], 3, 2), substr($_GET[service_time_to], 3, 2),$_GET[service_interval],$_GET[service_type],$_GET[service_var], $_GET[service_passive_timeout], $_GET[service_check_timeout], $_GET[service_ack], $_GET[service_retain], $_GET[service_snmp_community], $_GET[service_snmp_objid], $_GET[service_snmp_version], $_GET[service_snmp_warning], $_GET[service_snmp_critical], $_GET[service_snmp_type],$_GET[service_active], $_GET[flap_seconds]); + + $exec_plan = ""; + $df=false; + while(list($k, $v) = each($_GET[wdays_plan])) { + if($v != "") { + $df = true; + } + $exec_plan .= $k . "=" . $v . "|"; + } + + if($df == false) { + $exec_plan=""; + } + $ads=bartlby_add_service($btl->CFG, $_GET[service_server], $_GET[service_plugin],$_GET[service_name],$_GET[service_args],$_GET[notify_enabled], $exec_plan,$_GET[service_interval],$_GET[service_type],$_GET[service_var], $_GET[service_passive_timeout], $_GET[service_check_timeout], $_GET[service_ack], $_GET[service_retain], $_GET[service_snmp_community], $_GET[service_snmp_objid], $_GET[service_snmp_version], $_GET[service_snmp_warning], $_GET[service_snmp_critical], $_GET[service_snmp_type],$_GET[service_active], $_GET[flap_seconds]); $global_msg=bartlby_get_server_by_id($btl->CFG, $_GET[service_server]); + $global_msg[exec_plan]=$btl->resolveServicePlan($exec_plan); + $act="service_" . $_GET[service_type]; if($_GET[service_type] == 3) { $global_msg[group_out] = $btl->resolveGroupString($_GET[service_var]); @@ -511,8 +563,8 @@ $layout->set_menu("client"); if($_GET[server_id] && $_GET[server_name] && $_GET[server_port] && $_GET[server_ip] && $_GET[server_icon]) { $btl->hasServerRight($_GET[server_id]); - $mod_server=bartlby_modify_server($btl->CFG, $_GET[server_id], $_GET[server_name], $_GET[server_ip], $_GET[server_port], $_GET[server_icon], $_GET[server_enabled], $_GET[server_notify], $_GET[server_flap_seconds]); - + // text_service_search1 == dead marker + $mod_server=bartlby_modify_server($btl->CFG, $_GET[server_id], $_GET[server_name], $_GET[server_ip], $_GET[server_port], $_GET[server_icon], $_GET[server_enabled], $_GET[server_notify], $_GET[server_flap_seconds], $_GET["text_service_search1"]); $defaults=bartlby_get_server_by_id($btl->CFG, $_GET[server_id]); $layout->DisplayHelp(array(0=>"CRIT|You should restart bartlby for applieng changes ")); $layout->OUT .= ""; @@ -524,7 +576,7 @@ $layout->set_menu("client"); if($_GET[server_name] && $_GET[server_port] && $_GET[server_ip] && $_GET[server_icon]) { - $add_server=bartlby_add_server($btl->CFG, $_GET[server_name], $_GET[server_ip], $_GET[server_port], $_GET[server_icon],$_GET[server_enabled], $_GET[server_notify], $_GET[server_flap_seconds]); + $add_server=bartlby_add_server($btl->CFG, $_GET[server_name], $_GET[server_ip], $_GET[server_port], $_GET[server_icon],$_GET[server_enabled], $_GET[server_notify], $_GET[server_flap_seconds], 0); $global_msg["package"]=""; $global_msg["init_service"]=""; @@ -533,7 +585,7 @@ if($_GET[package_name] != "") { $global_msg["package"].= "
" . $btl->installPackage($_GET[package_name], $add_server, NULL, NULL); } else { - $add_service=bartlby_add_service($btl->CFG, $add_server, "INIT", "Initial Check", "-h", 0, 0,24,0,59,2000,1,"",200, 20, 0, 3, "", "", "", "", "", "", 1, 120); + $add_service=bartlby_add_service($btl->CFG, $add_server, "INIT", "Initial Check", "-h", 0, "" ,2000,1,"",200, 20, 0, 3, "", "", "", "", "", "", 1, 120); $global_msg["init_service"]="
  • Init"; } @@ -613,4 +665,4 @@ $layout->TableEnd(); -$layout->display(); \ No newline at end of file +$layout->display(); diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/bartlby-ui.class.php bartlby-ui/bartlby-ui.class.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/bartlby-ui.class.php 2007-01-14 14:03:19.000000000 +0100 +++ bartlby-ui/bartlby-ui.class.php 2007-01-29 17:07:07.000000000 +0100 @@ -3,7 +3,16 @@ set_time_limit(0); set_magic_quotes_runtime(0); -define("BARTLBY_UI_VERSION", "1.31"); +define("BARTLBY_UI_VERSION", "1.42"); +$wdays[0]="Sunday"; +$wdays[1]="Monday"; +$wdays[2]="Tuesday"; +$wdays[3]="Wednesday"; +$wdays[4]="Thursday"; +$wdays[5]="Friday"; +$wdays[6]="Saturday"; + + if(!version_compare(phpversion(), "5.0.0", ">=")) { echo "you should have at least a php5 series"; @@ -26,6 +35,138 @@ } } } + function resolveDeadMarker($start_id, $map) { + + $rr=0; + + + $cur_id=$start_id; + $l = 0; + + + + while($cur_id != 0) { + if($l != 0 && $l == $cur_id) { + return $r; + } + @reset($map); + + $f = false; + while(@list($k, $v) = @each($map)) { + + + for($x=0; $x" . $v[$x][server_name] . "/" . $v[$x][service_name] . " (" . $this->getState($v[$x][current_state]) . ")
    "; + + + $l = $cur_id; + $cur_id = $v[$x][server_dead]; + + if($v[$x][current_state] == 2) { + + return $r; + } + + if($cur_id <= 0) { + + return $r; + } + if($cur_id == $start_id ) { + + return $r; + } + + $rr++; + + + } + + + } + + + + + } + if($f == false) { + + return $r . "
    INDICATOR: " . $cur_id . " not found"; + } + if($cur_id == $start_id ) { + echo "b"; + return $r; + } + + } + return $r; + + + } + function service_selector($f, $v, $d, $d1) { + $mydiv="
    "; + $r = "" . $mydiv; + return $r; + } + + function resolveServicePlan($str) { + global $wdays; + + $cur_wday = date("w"); + + + if(strlen($str) < 5) { + return "24x7x365 currently in range"; + } + $range_found = false; + $o = explode("|", $str); + + $cur_ts=time(); + + for($x=0; $x= $t1 && $cur_ts <= $t2 && $cur_wday == $x) { + $filled[$x] .= "" . $xx[$y] . ","; + $range_found = true; + } else { + $filled[$x] .= $xx[$y] . ","; + } + } + $filled[$x]{strlen($filled[$x])-1} = " "; + + } + $plan_box = ""; + for($x=0; $x<=6; $x++) { + $chk=""; + $vv = "NO"; + if($filled[$x]) { + $chk="checked"; + $vv = $filled[$x]; + } + $cl = ""; + if($cur_wday == $x) { + $cl = "color=blue"; + } + $plan_box .= ""; + } + + $plan_box .= "
    " . $wdays[$x] . "" . $vv . "
    "; + if($range_found == true) { + $plan_box .= "currently in range"; + } else { + $plan_box .= "currently not in range"; + } + return $plan_box; + + } + function do_report($start_in, $end_in, $state_in, $in_service) { $state_array=array(); @@ -612,6 +753,11 @@ return -1; } function isServerUp($server_id, &$map) { + + if($map[$server_id][0][current_state] == -3) { + return false; + } + for($x=0; $x
    "; - $tfrom=$this->dnl($re[$x][hour_from]) . ":" . $this->dnl($re[$x][min_from]) . ":00"; - $tto=$this->dnl($re[$x][hour_to]) . ":" . $this->dnl($re[$x][min_to]) . ":00"; + $msg .= str_repeat(" ", 20) . "Plugin:" . $re[$x][plugin] . "/'" . $re[$x][plugin_arguments] . " '
    "; - $msg .= str_repeat(" ", 20) . "Time: $tfrom - $tto / " . $re[$x][check_interval] . "
    "; + $msg .= str_repeat(" ", 20) . "Check Plan: " . $this->resolveServicePlan($re[$x][exec_plan]) . "
    "; $msg .= str_repeat(" ", 20) . "Service Type: " . $re[$x][service_type] . "
    "; - $ads=bartlby_add_service($this->CFG, $server, $re[$x][plugin],$re[$x][service_name],$re[$x][plugin_arguments],$re[$x][notify_enabled],$re[$x][hour_from], $re[$x][hour_to], $re[$x][min_from], $re[$x][min_to],$re[$x][check_interval],$re[$x][service_type],$re[$x][service_var], $re[$x][service_passive_timeout], $re[$x][service_check_timeout], $re[$x][service_ack], $re[$x][service_retain],$re[$x][service_snmp_community], $re[$x][service_snmp_objid],$re[$x][service_snmp_version],$re[$x][service_snmp_warning],$re[$x][service_snmp_critical],$re[$x][service_snmp_type], $re[$x][service_active], $re[$x][flap_seconds]); + $ads=bartlby_add_service($this->CFG, $server, $re[$x][plugin],$re[$x][service_name],$re[$x][plugin_arguments],$re[$x][notify_enabled],$re[$x][exec_plan],$re[$x][check_interval],$re[$x][service_type],$re[$x][service_var], $re[$x][service_passive_timeout], $re[$x][service_check_timeout], $re[$x][service_ack], $re[$x][service_retain],$re[$x][service_snmp_community], $re[$x][service_snmp_objid],$re[$x][service_snmp_version],$re[$x][service_snmp_warning],$re[$x][service_snmp_critical],$re[$x][service_snmp_type], $re[$x][service_active], $re[$x][flap_seconds]); $msg .= str_repeat(" ", 20) . "New id: " . $ads . "
    "; if($re[$x][__install_plugin]) { diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/cli.php bartlby-ui/cli.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/cli.php 2007-01-05 02:49:48.000000000 +0100 +++ bartlby-ui/cli.php 2007-03-22 02:10:18.000000000 +0100 @@ -1,7 +1,7 @@ hasRight("agentsyncer_editcfg"); + $sg = new AgentSyncer(); + $servers=$btl->GetSVCMap(); + + $layout= new Layout(); + $layout->setTitle("AgentSyncer: Binarys"); + + $layout->set_menu("Agent Sync"); + $layout->Table("100%"); + + + + + + +while(list($k, $v) = each($servers)) { + $dd="not yet synced"; + $fn = "extensions/AgentSyncer/store/" . md5($v[0][server_name]); + if(file_exists($fn)) { + $dd=date("d.m.Y H:i:s", file_get_contents($fn)); + } + + $layout->Tr( + $layout->Td( + Array( + "" . $v[0][server_name] . "", + $dd + ) + ) + + ); +} + + $layout->TableEnd(); + $layout->display(); + + +function agentsyncer_output_bin($b) { + global $layout; + $dd = "extensions/AgentSyncer/"; + + $dhl=opendir($dd); + + + while ( $f = readdir($dhl)) { + if(preg_match("/^" . $b . ".*/i", $f)) { + $layout->Tr( + $layout->Td( + Array( + $f, + md5_file($dd . "/" . $f) + ) + ) + + ); + } + } +} diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/AgentSyncer/sync.php bartlby-ui/extensions/AgentSyncer/sync.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/AgentSyncer/sync.php 2006-10-06 01:19:46.000000000 +0200 +++ bartlby-ui/extensions/AgentSyncer/sync.php 2007-01-29 05:04:12.000000000 +0100 @@ -35,11 +35,11 @@ if($auto_reg == "true") { if(!in_array($_GET[clientname], $exclude_list)) { - $add_server=bartlby_add_server($btl->CFG, $_GET[clientname],$_SERVER["REMOTE_ADDR"], 9030, "01generic.gif", 1, 1, 2000); + $add_server=bartlby_add_server($btl->CFG, $_GET[clientname],$_SERVER["REMOTE_ADDR"], 9030, "01generic.gif", 1, 1, 2000, 0); echo "ADDSERVER $add_server\n"; flush(); if(!$default_pkg) { - $add_service=bartlby_add_service($btl->CFG, $add_server, "INIT", "Initial Check", "-h", 0, 0,24,0,59,2000,1,"",200, 20, 0, 3, "", "", "", "", "", "", 1, 120); + $add_service=bartlby_add_service($btl->CFG, $add_server, "INIT", "Initial Check", "-h", 0, "" ,2000,1,"",200, 20, 0, 3, "", "", "", "", "", "", 1, 120); echo "SERVICEADD INIT\n"; flush(); } else { diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/action.php bartlby-ui/extensions/ArS/action.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/action.php 2007-01-14 14:03:21.000000000 +0100 +++ bartlby-ui/extensions/ArS/action.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,164 +0,0 @@ -hasRight("super_user"); - $sg = new ArS(); - $servers=$btl->GetSVCMap(); - - $layout= new Layout(); - $layout->setTitle("ArS: action"); - - $layout->set_menu("ArS"); - $layout->Form("fm1", "extensions_wrap.php"); - $layout->Table("100%"); - - if($_GET[action] == "add") { - $action="Adding report"; - - $da = $sg->storage->load_key("reports"); - $reports=unserialize($da); - if(!is_array($reports)) { - $reports=array(); - } - - array_push($reports, $_GET); - - $da = serialize($reports); - $da = $sg->storage->save_key("reports", $da); - - $output = "report added!!!"; - - - - } else if($_GET[action] == "delete") { - $action = "delete report"; - - $da = $sg->storage->load_key("reports"); - $reports=unserialize($da); - $y=0; - - for($x=0; $xstorage->save_key("reports", $da); - - $output = "report deleted"; - } else if($_GET[action] == "sendout") { - - $action = "sending out the reports"; - - - $da = $sg->storage->load_key("reports"); - $reports=unserialize($da); - $y=0; - - - for($x=0; $xCFG, $reports[$x][ars_service_id]); - $rap = "Report for: " . $defaults[server_name] . "/" . $defaults[service_name] . "\n"; - $btl_subj = "Bartlby report"; - - if($_GET[wich] == "daily") { - - if($reports[$x][ars_daily]) { - $rap .= "DAILY REPORT:\n\n"; - $rep = $btl->do_report(date("d.m.Y", time()-86400), date("d.m.Y"), 0, $reports[$x][ars_service_id]); - $rap .= "FROM: " . date("d.m.Y", time()-86400) . " TO: " . date("d.m.Y", time()) . "\n"; - $rap .= $sg->format_report($rep); - - - } - } - if($_GET[wich] == "weekly") { - if($reports[$x][ars_weekly]) { - $rap .= "WEEKLY REPORT:\n\n"; - $rep = $btl->do_report(date("d.m.Y", time()-(86400*7)), date("d.m.Y"), 0, $reports[$x][ars_service_id]); - $rap .= "FROM: " . date("d.m.Y", time()-(86400*7)) . " TO: " . date("d.m.Y", time()) . "\n"; - $rap .= $sg->format_report($rep); - - - } - } - - if($_GET[wich] == "monthly") { - if($reports[$x][ars_monthly]) { - $rap .= "MONTHLY REPORT:\n\n"; - $rep = $btl->do_report(date("d.m.Y", time()-(86400*31)), date("d.m.Y"), 0, $reports[$x][ars_service_id]); - $rap .= "FROM: " . date("d.m.Y", time()-(86400*31)) . " TO: " . date("d.m.Y", time()) . "\n"; - $rap .= $sg->format_report($rep); - - - } - } - - - - - - - $headers = array('From' => 'helmut@januschka.com' , 'To' => $reports[$x][ars_to], - 'Subject' => $btl_subj); - - - $smtp = Mail::factory('smtp', - array ('host' => "localhost", - 'auth' => false, - 'timeout' => 10, - 'debug' => false - )); - - $mail = $smtp->send($reports[$x][ars_to], $headers, $rap); - - - - - } - - - $output = "done"; - - } - - - - - - - - -$layout->Tr( - $layout->Td( - Array( - array("colspan" => 2, "show" => "$action") - ) - ) - -); -$layout->Tr( - $layout->Td( - Array( - array("colspan" => 2, "show" => "$output") - ) - ) - -); - - - $layout->FormEnd(); - - $layout->TableEnd(); - $layout->display(); \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/add.php bartlby-ui/extensions/ArS/add.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/add.php 2007-01-14 14:03:21.000000000 +0100 +++ bartlby-ui/extensions/ArS/add.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,97 +0,0 @@ -hasRight("super_user"); - $sg = new ArS(); - $servers=$btl->GetSVCMap(); - - $layout= new Layout(); - $layout->setTitle("ArS: Add Report"); - - $layout->set_menu("ArS"); - $layout->Form("fm1", "extensions_wrap.php"); - $layout->Table("100%"); - - $defaults=bartlby_get_service_by_id($btl->CFG, $_GET[service_id]); - -$layout->Tr( - $layout->Td( - Array( - array("colspan" => 2, "show" => "Add a automated report") - ) - ) - -); -$layout->Tr( - $layout->Td( - Array( - 0=>"Service:" . $layout->Field("ars_service_id", "hidden", $_GET[service_id]) . $layout->Field("action", "hidden", "add"), - 1=>$defaults[server_name] . "/" . $defaults[service_name] - ) - ) - -); -$layout->Tr( - $layout->Td( - Array( - 0=>"Recipient:", - 1=>$layout->Field("ars_to", "textbox", "") - ) - ) - -); -$layout->Tr( - $layout->Td( - Array( - 0=>"Daily:" .$layout->Field("script", "hidden", "ArS/action.php"), - 1=>$layout->Field("ars_daily", "checkbox", "checked") - ) - ) - -); -$layout->Tr( - $layout->Td( - Array( - 0=>"Weekly:", - 1=>$layout->Field("ars_weekly", "checkbox", "checked") - ) - ) - -); - - - -$layout->Tr( - $layout->Td( - Array( - 0=>"Monthly:", - 1=>$layout->Field("ars_monthly", "checkbox", "checked") - ) - ) - -); - -$layout->Tr( - $layout->Td( - Array( - 0=>Array( - 'colspan'=> 2, - "align"=>"right", - 'show'=>$layout->Field("Subm", "button", "next->", "" ," onClick='xajax_ExtensionAjax(\"ArS\", \"xajax_ars_add_form\", xajax.getFormValues(\"fm1\"))'") . $layout->Field("server_id", "hidden", $_GET[server_id]) - ) - ) - ) - -); - $layout->FormEnd(); - - $layout->TableEnd(); - $layout->display(); \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/ArS.class.php bartlby-ui/extensions/ArS/ArS.class.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/ArS.class.php 2007-01-14 14:03:20.000000000 +0100 +++ bartlby-ui/extensions/ArS/ArS.class.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,125 +0,0 @@ -layout = new Layout(); - $this->storage = new BartlbyStorage("ArS"); - - } - - - function _About() { - return "Automated Reporting System (EXPERIMENTAL)!!!"; - - } - function format_report($rep) { - global $btl; - - - - $svc=$rep[svc]; - $state_array=$rep[state_array]; - $notify=$rep[notify]; - $files_scanned=$rep[files_scanned]; - - $hun=$svc[0]+$svc[1]+$svc[2]; - - $rap = "-----------------------------------------------\n"; - - $rap .= "Service Time:\n"; - while(list($state, $time) = @each($svc)) { - for($xy=0; $xygetState($state_array[$xy][lstate]) . " "; - - $o1 .= $state_array[$xy][msg] . " \n"; - - } - - $perc = (($hun-$time) * 100 / $hun); - $perc =100-$perc; - - - $rap .= "State: " . $btl->getState($state); - $rap .= " Time: " . $btl->intervall($time) . " seconds"; - $rap .= " " . round($perc,2) . "% \n"; - - - - } - - $rap .= "Notifications:\n"; - while(list($worker, $dd) = @each($notify)) { - - $rap .= $worker . "\n"; - - while(list($trigger, $dd1) = @each($dd)) { - $rap .= "\t" . $trigger . "\n"; - while(list($k, $ts) = @each($dd1)) { - $rap .= "\t\t" . date("d.m.Y H:i:s", $ts[0]) . " (" . $btl->getState($ts[1]) . ")\n"; - } - } - - } - $rap .= "Output:\n"; - $rap .= $o1; - $rap .= "-----------------------------------------------\n"; - return $rap; - - } - - function xajax_ars_delete_form() { - global $xajax; - $res = new xajaxResponse(); - $values = $xajax->_xmlToArray("xjxquery", $_GET[xajaxargs][2]); - - if($values[ars_report] == "") { - $res->AddScript("alert('no report selected to delete')"); - } else { - $res->AddScript("document.fm1.submit()"); - } - - return $res; - } - function xajax_ars_add_form() { - global $xajax; - $res = new xajaxResponse(); - $values = $xajax->_xmlToArray("xjxquery", $_GET[xajaxargs][2]); - - if($values[ars_to] == "") { - $res->addAssign("error_ars_to", "innerHTML", "required field"); - } else { - $res->AddScript("document.fm1.submit()"); - } - - return $res; - } - function _permissions() { - global $worker_rights; - - $r = "ArS requires 'super user' right"; - return $r; - } - - function _Menu() { - $r = $this->layout->beginMenu(); - $r .= $this->layout->addRoot("ArS"); - $r .= $this->layout->addSub("ArS", "View/Delete","extensions_wrap.php?script=ArS/view.php"); - $r .= $this->layout->addSub("ArS", "Add","service_list.php?script=extensions_wrap.php%3fscript=ArS/add.php"); - - $r .= $this->layout->endMenu(); - return $r; - } - - - - - -} - -?> diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/view.php bartlby-ui/extensions/ArS/view.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ArS/view.php 2007-01-14 14:03:22.000000000 +0100 +++ bartlby-ui/extensions/ArS/view.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,84 +0,0 @@ -hasRight("super_user"); - $sg = new ArS(); - $servers=$btl->GetSVCMap(); - - $layout= new Layout(); - $layout->setTitle("ArS: View Report"); - - $layout->set_menu("ArS"); - $layout->Form("fm1", "extensions_wrap.php"); - $layout->Table("100%"); - - $defaults=bartlby_get_service_by_id($btl->CFG, $_GET[service_id]); - -$layout->Tr( - $layout->Td( - Array( - array("colspan" => 2, "show" => "Known reports") - ) - ) - -); - - - $da = $sg->storage->load_key("reports"); - $reports=unserialize($da); - - for($x=0; $xCFG, $reports[$x][ars_service_id]); - if($reports[$x][ars_daily]) - $day="daily"; - else - $day=""; - - if($reports[$x][ars_weekly]) - $week="weekly"; - else - $week=""; - - if($reports[$x][ars_monthly]) - $month="month"; - else - $month=""; - - - $layout->Tr( - $layout->Td( - Array( - - 0=>"" . $layout->Field("action", "hidden", "delete") . $layout->Field("script", "hidden", "ArS/action.php"), - 1=>$reports[$x][ars_to] . "(" . $defaults[server_name] . "/" . $defaults[service_name] . ") $day $week $month" - ) - ) - - ); - } - -$layout->Tr( - $layout->Td( - Array( - 0=>Array( - 'colspan'=> 2, - "align"=>"right", - 'show'=>$layout->Field("Subm", "button", "delete", "" ," onClick='xajax_ExtensionAjax(\"ArS\", \"xajax_ars_delete_form\", xajax.getFormValues(\"fm1\"))'") . $layout->Field("server_id", "hidden", $_GET[server_id]) - ) - ) - ) - -); - $layout->FormEnd(); - - $layout->TableEnd(); - $layout->display(); \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/BnR/do_restore.php bartlby-ui/extensions/BnR/do_restore.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/BnR/do_restore.php 2006-10-06 01:19:46.000000000 +0200 +++ bartlby-ui/extensions/BnR/do_restore.php 2007-01-29 05:04:13.000000000 +0100 @@ -47,7 +47,7 @@ foreach(glob($bdir . "/*.srv") as $fname) { $dmp = unserialize(file_get_contents($fname)); - $add_server = bartlby_add_server($btl->CFG, $dmp[0][server_name], $dmp[0][client_ip], $dmp[0][client_port], $dmp[0][server_icon], $dmp[0][server_enabled], $dmp[0][server_notify], $dmp[0][server_flap_seconds]); + $add_server = bartlby_add_server($btl->CFG, $dmp[0][server_name], $dmp[0][client_ip], $dmp[0][client_port], $dmp[0][server_icon], $dmp[0][server_enabled], $dmp[0][server_notify], $dmp[0][server_flap_seconds], $dmp[0][server_dead]); $btl->installPackage(basename($fname), $add_server, $_GET[force_plugin], $_GET[force_perf], $bdir); $o_id = bartlby_set_server_id($btl->CFG, $add_server, $dmp[0][server_id], 1); $o .= "restored.... " . $dmp[0][server_name] . "($o_id)
    "; diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ServerGroups/ServerGroups.class.php bartlby-ui/extensions/ServerGroups/ServerGroups.class.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/extensions/ServerGroups/ServerGroups.class.php 2006-09-12 00:21:43.000000000 +0200 +++ bartlby-ui/extensions/ServerGroups/ServerGroups.class.php 2007-01-27 00:20:34.000000000 +0100 @@ -1,6 +1,6 @@ Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]

    Passive:
    Timeout: $_GET[service_passive_timeout]

    Group:
    Str: $_GET[service_var]

    SNMP:
    Community: $_GET[service_snmp_community]
    Object ID: $_GET[service_snmp_objid]
    Version: $_GET[service_snmp_version]
    Type: $_GET[service_snmp_type]
    Warning: $_GET[service_snmp_warning]
    Critical: $_GET[service_snmp_critical]


    Next Steps:
    +Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]

    Passive:
    Timeout: $_GET[service_passive_timeout]

    Group:
    Str: $_GET[service_var]

    SNMP:
    Community: $_GET[service_snmp_community]
    Object ID: $_GET[service_snmp_objid]
    Version: $_GET[service_snmp_version]
    Type: $_GET[service_snmp_type]
    Warning: $_GET[service_snmp_warning]
    Critical: $_GET[service_snmp_critical]


    Next Steps:
    diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/delete_service bartlby-ui/fin/delete_service --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/delete_service 2006-01-22 02:32:47.000000000 +0100 +++ bartlby-ui/fin/delete_service 2007-03-22 02:10:18.000000000 +0100 @@ -1,4 +1,5 @@ - Delete Service
    You have successfully deleted service '$global_msg[server_name]:$global_msg[client_port]/$global_msg[service_name]'

    Next Steps

    - \ No newline at end of file +Delete Service
    You have successfully deleted service '$global_msg[server_name]:$global_msg[client_port]/$global_msg[service_name]'

    Next Steps

    +
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_1 bartlby-ui/fin/service_1 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_1 2006-08-12 19:44:43.000000000 +0200 +++ bartlby-ui/fin/service_1 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_2 bartlby-ui/fin/service_2 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_2 2006-08-12 19:44:43.000000000 +0200 +++ bartlby-ui/fin/service_2 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]

    Passive:
    Timeout: $_GET[service_passive_timeout]
    \ No newline at end of file +Modify Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]

    Passive:
    Timeout: $_GET[service_passive_timeout]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_3 bartlby-ui/fin/service_3 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_3 2006-08-12 19:44:43.000000000 +0200 +++ bartlby-ui/fin/service_3 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]

    Group:
    $global_msg[group_out]
    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]

    Group:
    $global_msg[group_out]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_4 bartlby-ui/fin/service_4 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_4 2006-08-12 19:44:44.000000000 +0200 +++ bartlby-ui/fin/service_4 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_5 bartlby-ui/fin/service_5 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_5 2006-08-12 19:44:44.000000000 +0200 +++ bartlby-ui/fin/service_5 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]


    SNMP:
    Community: $_GET[service_snmp_community]
    Object ID: $_GET[service_snmp_objid]
    Version: $_GET[service_snmp_version]
    Type: $_GET[service_snmp_type]
    Warning: $_GET[service_snmp_warning]


    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]


    SNMP:
    Community: $_GET[service_snmp_community]
    Object ID: $_GET[service_snmp_objid]
    Version: $_GET[service_snmp_version]
    Type: $_GET[service_snmp_type]
    Warning: $_GET[service_snmp_warning]


    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_6 bartlby-ui/fin/service_6 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_6 2006-08-12 19:44:44.000000000 +0200 +++ bartlby-ui/fin/service_6 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_7 bartlby-ui/fin/service_7 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_7 2006-08-12 19:44:44.000000000 +0200 +++ bartlby-ui/fin/service_7 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_8 bartlby-ui/fin/service_8 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_8 2006-11-25 01:54:35.000000000 +0100 +++ bartlby-ui/fin/service_8 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_9 bartlby-ui/fin/service_9 --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/fin/service_9 2006-11-30 17:37:48.000000000 +0100 +++ bartlby-ui/fin/service_9 2007-01-27 00:20:34.000000000 +0100 @@ -1 +1 @@ -Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $_GET[service_time_from] - $_GET[service_time_to]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file +Modify/Add Service:
    Name: $_GET[service_name]
    Type: $_GET[service_type]
    Server: $global_msg[server_name]
    Time: $global_msg[exec_plan]
    Intervall: $_GET[service_interval]
    Timeout: $_GET[service_check_timeout]

    Plugin:
    Plugin: $_GET[service_plugin]
    Arguments: $_GET[service_args]
    \ No newline at end of file diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/modify_server.php bartlby-ui/modify_server.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/modify_server.php 2006-11-30 22:51:08.000000000 +0100 +++ bartlby-ui/modify_server.php 2007-01-29 05:04:12.000000000 +0100 @@ -62,7 +62,7 @@ $defaults["min_to"]="59"; $defaults["hour_from"]="00"; $defaults["hour_to"]="24"; - + $defaults["server_dead"] = "0"; $defaults[server_port]=(int)bartlby_config("ui-extra.conf", "new.server.port"); $defaults[server_icon]=bartlby_config("ui-extra.conf", "new.server.icon"); @@ -197,6 +197,24 @@ ) ,true); + +if(!$_GET["copy"] && !$_GET["new"]) { + + if($defaults[server_dead]) { + $svc = bartlby_get_service_by_id($btl->CFG, $defaults[server_dead]); + } +$ov .= $layout->Tr( + $layout->Td( + array( + 0=>"Alive indicator", + 1=>$btl->service_selector("dead_marker", $svc[server_name] . "/" . $svc[service_name] , "service_search1", $defaults[server_dead]) + ) + ) +,true); + + +} + if($fm_action == "add_server") { $ov .= $layout->Tr( $layout->Td( diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/modify_service.php bartlby-ui/modify_service.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/modify_service.php 2006-12-27 20:05:42.000000000 +0100 +++ bartlby-ui/modify_service.php 2007-01-27 00:20:34.000000000 +0100 @@ -4,6 +4,8 @@ include "bartlby-ui.class.php"; + + $btl=new BartlbyUi($Bartlby_CONF); $layout= new Layout(); @@ -48,11 +50,7 @@ $fm_action="add_service"; $btl->hasRight("action.add_service"); - $defaults["min_from"]="00"; - $defaults["min_to"]="59"; - $defaults["hour_from"]="00"; - $defaults["hour_to"]="24"; - + $defaults["exec_plan"] = "0=00:00-23:59|1=00:00-23:59|2=00:00-23:59|3=00:00-23:59|4=00:00-23:59|5=00:00-23:59|6=00:00-23:59"; $defaults["check_interval"]=bartlby_config("ui-extra.conf", "new.service.interval"); $defaults[service_type]=(int)bartlby_config("ui-extra.conf", "new.service.type"); $defaults[service_ack]=(int)bartlby_config("ui-extra.conf", "new.service.ack"); @@ -249,6 +247,15 @@ } $layout->OUT .= "\n"; + $perc = (($hun-$time) * 100 / $hun); $perc =100-$perc; @@ -98,7 +76,7 @@ } - $o1 .= ""; + for($x=0; $x<3; $x++) { $nstate= $x+1; $rstr .= "&text_" . $nstate . "=" . $btl->getState($x) . "&value_" . $nstate . "=" . $flash[$x]; @@ -154,8 +132,22 @@ $out .= ""; } + $out .= ""; + + $o1 .= ""; + $o1 .= ""; + for($xy=0; $xy"; + $o1 .= ""; + + $o1 .= ""; + + } + $o1 .= "
    Output:" . $btl->getState($state_array[$xy][lstate]) . "" . $state_array[$xy][msg] . "
    "; + } diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/server_detail.php bartlby-ui/server_detail.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/server_detail.php 2006-10-06 01:19:46.000000000 +0200 +++ bartlby-ui/server_detail.php 2007-01-29 05:04:12.000000000 +0100 @@ -148,6 +148,12 @@   + + Server Life indicator: + " . $btl->resolveDeadMarker($defaults[server_dead], $map) . " +   + + "; diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/service_detail.php bartlby-ui/service_detail.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/service_detail.php 2006-12-27 20:05:42.000000000 +0100 +++ bartlby-ui/service_detail.php 2007-02-15 21:46:47.000000000 +0100 @@ -31,6 +31,7 @@ $defaults[new_server_text] = "you are missing: view_service_output right"; } +$map=$btl->getSVCMap($btl->CFG, NULL, NULL); $layout->Table("100%"); $svc_color=$btl->getColor($defaults[current_state]); @@ -125,6 +126,12 @@ $currun="Currently not running"; } +$plan_box = $btl->resolveServicePlan($defaults[exec_plan]); + + + + + $info_box_title='Service Info'; // (Logged in as:' . $btl->user . ') Uptime: ' . $btl->intervall(time()-$btl->info[startup_time]) . '' $core_content = " @@ -154,19 +161,25 @@ + + + + + + - + - + @@ -186,15 +199,11 @@ - - - - - - - + + + diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/template.html bartlby-ui/template.html --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/template.html 2006-12-10 16:56:51.000000000 +0100 +++ bartlby-ui/template.html 2007-03-22 02:10:18.000000000 +0100 @@ -106,6 +106,14 @@ + + + + + + + + diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/xajax.common.php bartlby-ui/xajax.common.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/xajax.common.php 2006-12-02 22:35:07.000000000 +0100 +++ bartlby-ui/xajax.common.php 2007-01-29 05:04:12.000000000 +0100 @@ -17,6 +17,10 @@ $xajax->registerFunction("toggle_extension"); $xajax->registerFunction("toggle_server_notify_check"); +$xajax->registerFunction("service_noaction"); +$xajax->registerFunction("set_service_search_noact"); + + $xajax->registerFunction("ServiceSearch"); $xajax->registerFunction("jumpToServiceId"); diff -Nur /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/xajax_dispatcher.php bartlby-ui/xajax_dispatcher.php --- /var/www/htdocs/bartlby.januschka.com/cvs/last_full//bartlby-ui/xajax_dispatcher.php 2006-12-04 18:32:34.000000000 +0100 +++ bartlby-ui/xajax_dispatcher.php 2007-01-29 05:04:12.000000000 +0100 @@ -335,6 +335,52 @@ $res->addScript("document.location.href='$script?service_id=" . $id . "'"); return $res; } +function set_service_search_noact($d, $v) { + global $btl; + + $res = new xajaxResponse(); + + $res->addAssign("text_" . $d, "value", $v); + + $svc = @bartlby_get_service_by_id($btl->CFG, $v); + + $res->addAssign("search_" . $d, "value", $svc[server_name] . "/" . $svc[service_name]); + $res->addAssign($d, "innerHTML", ""); + + return $res; + +} +function service_noaction($what, $d) { + global $btl; + $res = new xajaxResponse(); + + + + $map = $btl->GetSVCMap(); + $optind=0; + $y=0; + + while(list($k, $servs) = @each($map)) { + $displayed_servers++; + + for($x=0; $x$ostr
    "; + $y++; + } + if($y>20) { + break 2; + } + } + } + + + $output = "close

    " . $output; + $res->addAssign($d, "innerHTML", $output); + return $res; +} + function ServiceSearch($what, $script='modify_service.php') { global $btl; @@ -701,19 +747,7 @@ $res->addAssign("error_flap_seconds", "innerHTML", ""); } - if(!bartlbize_date($av[service_time_from])){ - $res->addAssign("error_service_time_from", "innerHTML", "required field"); - $al="1"; - } else { - $res->addAssign("error_service_time_from", "innerHTML", ""); - } - if(!bartlbize_date($av[service_time_to])){ - $res->addAssign("error_service_time_to", "innerHTML", "required field"); - $al="1"; - } else { - $res->addAssign("error_service_time_to", "innerHTML", ""); - } switch($av[service_type]) { case 1:
     
    Server Life Indicator:" . $btl->resolveDeadMarker($defaults[server_dead], $map) . " 
    Last Check: " . date("d.m.Y H:i:s", $defaults[last_check]) . "  
    approx. next Check:" . date("d.m.Y H:i:s", $defaults[last_check]+$defaults[check_interval_original]) . "" . date("d.m.Y H:i:s", $defaults[last_check]+$defaults[check_interval]) . "  
    Check intervall:" . $defaults[check_interval] . " / " . $defaults[check_interval_original] . "" . $defaults[check_interval_original] . " / " . $defaults[check_interval] . "  
     
    Check From:" . dnl($defaults[hour_from]) . ":" . dnl($defaults[min_from]) . ':00' . " 
    Check To:" . dnl($defaults[hour_to]) . ":" . dnl($defaults[min_to]) . ':00' . "Check Plan:" . $plan_box . "  
    Flap count: " . $defaults[flap_count] . "