X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fnodes%2Fnodes.php;h=5d9b61e3e04800643f524a0c5c241fb92e6bbfa5;hb=d694eb9fdfe0a7bcb9d8fc7b571751475f4227be;hp=1d6da5664321e8e0a291c2bb4a9c495d4dac0961;hpb=98babcb7ca66f2369bc523c52e5e8efde0cb856b;p=plewww.git diff --git a/planetlab/nodes/nodes.php b/planetlab/nodes/nodes.php index 1d6da56..5d9b61e 100644 --- a/planetlab/nodes/nodes.php +++ b/planetlab/nodes/nodes.php @@ -31,6 +31,7 @@ drupal_set_html_head(' ini_set("memory_limit","64M"); +//error_reporting(0); // -------------------- // recognized URL arguments @@ -72,15 +73,19 @@ function node_status ($node) { } -$first_time_configuration = 'false'; +$first_time_configuration = false; if (plc_is_admin()) - $default_configuration = "ID:f|hostname:f|ST:f|AU:f|SN|DN|LCN|R|L"; + $default_configuration = "ID:f|hostname:f|ST:f|AU:f|RES:f"; else - $default_configuration = "hostname:f|ST:f|AU:f|SN|LCN|DN|R|L"; + $default_configuration = "hostname:f|ST:f|AU:f|RES:f"; +//$extra_default = "LCN|DN|R|L|OS|MS|SN"; $column_configuration = ""; $slice_column_configuration = ""; +$show_configuration = ""; +$show_columns_message = '1'; + $PersonTags=$api->GetPersonTags (array('person_id'=>$plc->person['person_id'])); //print_r($PersonTags); @@ -90,6 +95,11 @@ foreach ($PersonTags as $ptag) { $column_configuration = $ptag['value']; $conf_tag_id = $ptag['person_tag_id']; } + if ($ptag['tagname'] == 'showconf') + { + $show_configuration = $ptag['value']; + $show_tag_id = $ptag['person_tag_id']; + } } //print("column configuration = ".$column_configuration); @@ -97,6 +107,7 @@ foreach ($PersonTags as $ptag) { $nodesconf_exists = false; if ($column_configuration == "") { + $first_time_configuration = true; $column_configuration = "nodes;default"; $nodesconf_exists = true; } @@ -133,7 +144,7 @@ else //print("full configuration = ".$full_configuration); // fetch nodes -$node_fixed_columns=array('hostname','node_type','site_id','node_id','boot_state','last_contact','interface_ids','peer_id', 'slice_ids'); +$node_fixed_columns=array('node_type','site_id','boot_state','last_contact','interface_ids','peer_id', 'slice_ids'); $fix_columns = array(); if (plc_is_admin()) @@ -141,17 +152,50 @@ $fix_columns[]=array('tagname'=>'node_id', 'header'=>'ID', 'type'=>'string', 'ti $fix_columns[]=array('tagname'=>'hostname', 'header'=>'hostname', 'type'=>'string', 'title'=>'The name of the node'); $fix_columns[]=array('tagname'=>'peer_id', 'header'=>'AU', 'type'=>'string', 'title'=>'Authority'); $fix_columns[]=array('tagname'=>'run_level', 'header'=>'ST', 'type'=>'string', 'title'=>'Status'); -//$fix_columns[]=array('tagname'=>'node_type', 'header'=>'RES', 'type'=>'string', 'title'=>'Reservable'); +$fix_columns[]=array('tagname'=>'node_type', 'header'=>'RES', 'type'=>'string', 'title'=>'Reservable'); $visibletags = new VisibleTags ($api, 'node'); $visibletags->columns(); $tag_columns = $visibletags->headers(); +//columns that are not defined as extra myslice tags $extra_columns = array(); -$extra_columns[]=array('tagname'=>'sitename', 'header'=>'SN', 'type'=>'string', 'title'=>'Site name', 'fetched'=>true); -$extra_columns[]=array('tagname'=>'domain', 'header'=>'DN', 'type'=>'string', 'title'=>'Toplevel domain name', 'fetched'=>true); -$extra_columns[]=array('tagname'=>'ipaddress', 'header'=>'IP', 'type'=>'string', 'title'=>'IP Address', 'fetched'=>true); +//MyPLC columns +$extra_columns[]=array('tagname'=>'sitename', 'header'=>'SN', 'type'=>'string', 'title'=>'Site name', 'fetched'=>true, 'source'=>'myplc'); +$extra_columns[]=array('tagname'=>'domain', 'header'=>'DN', 'type'=>'string', 'title'=>'Toplevel domain name', 'fetched'=>true, 'source'=>'myplc'); +$extra_columns[]=array('tagname'=>'ipaddress', 'header'=>'IP', 'type'=>'string', 'title'=>'IP Address', 'fetched'=>true, 'source'=>'myplc'); +$extra_columns[]=array('tagname'=>'fcdistro', 'header'=>'OS', 'type'=>'string', 'title'=>'Operating system', 'fetched'=>false, 'source'=>'myplc'); +$extra_columns[]=array('tagname'=>'date_created', 'header'=>'DA', 'source'=>'myplc', 'type'=>'date', 'title'=>'Date added', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'arch', 'header'=>'A', 'source'=>'myplc', 'type'=>'string', 'title'=>'Architecture', 'fetched'=>false); +if (plc_is_admin()) { +$extra_columns[]=array('tagname'=>'deployment', 'header'=>'DL', 'source'=>'myplc', 'type'=>'string', 'title'=>'Deployment', 'fetched'=>false); +} + +//CoMon Live data +$extra_columns[]=array('tagname'=>'bwlimit', 'header'=>'BW', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'Bandwidth limit', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'numcores', 'header'=>'CC', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'Number of CPU Cores', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'cpuspeed', 'header'=>'CR', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'CPU clock rate', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'disksize', 'header'=>'DS', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'Disk size', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'gbfree', 'header'=>'DF', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'Currently available disk space', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'memsize', 'header'=>'MS', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'Memory size', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'numslices', 'header'=>'SM', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'Number of slices in memory', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'uptime', 'header'=>'UT', 'source'=>'comon', 'type'=>'sortAlphaNumericTop', 'title'=>'Continuous uptime until now', 'fetched'=>false); + +//TopHat Live data +$extra_columns[]=array('tagname'=>'asn', 'header'=>'AS', 'source'=>'tophat', 'type'=>'string', 'title'=>'AS Number', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'city', 'header'=>'LCY', 'source'=>'tophat', 'type'=>'string', 'title'=>'City', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'region', 'header'=>'LRN', 'source'=>'tophat', 'type'=>'string', 'title'=>'Region', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'country', 'header'=>'LCN', 'source'=>'tophat', 'type'=>'string', 'title'=>'Country', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'continent', 'header'=>'LCT', 'source'=>'tophat', 'type'=>'string', 'title'=>'Continent', 'fetched'=>false); +$extra_columns[]=array('tagname'=>'hopcount', 'header'=>'HC', 'source'=>'tophat', 'type'=>'sortAlphaNumericTop', 'title'=>'Hop count from reference node', 'fetched'=>false); +//$extra_columns[]=array('tagname'=>'rtt', 'header'=>'RTT', 'source'=>'tophat', 'type'=>'sortAlphaNumericTop', 'title'=>'Round trip time from reference node', 'fetched'=>false); +//$extra_columns[]=array('tagname'=>'agents', 'header'=>'MA', 'source'=>'tophat', 'type'=>'sortAlphaNumericTop', 'title'=>'Co-located measurement agents', 'fetched'=>true); +//$extra_columns[]=array('tagname'=>'agents_sonoma', 'header'=>'MAS', 'source'=>'tophat', 'type'=>'sortAlphaNumericTop', 'title'=>'Co-located SONoMA agents', 'fetched'=>true); +//$extra_columns[]=array('tagname'=>'agents_etomic', 'header'=>'MAE', 'source'=>'tophat', 'type'=>'sortAlphaNumericTop', 'title'=>'Co-located ETOMIC agents', 'fetched'=>true); +//$extra_columns[]=array('tagname'=>'agents_tdmi', 'header'=>'MAT', 'source'=>'tophat', 'type'=>'sortAlphaNumericTop', 'title'=>'Co-located TDMI agents', 'fetched'=>true); +//$extra_columns[]=array('tagname'=>'agents_dimes', 'header'=>'MAD', 'source'=>'tophat', 'type'=>'sortAlphaNumericTop', 'title'=>'Co-located DIMES agents', 'fetched'=>true); + $ConfigureColumns =new PlekitColumns($full_configuration, $fix_columns, $tag_columns, $extra_columns); @@ -215,8 +259,23 @@ if ($person_id) { } // go +//print("getting nodes ".$node_columns); +//print_r($node_columns); $nodes=$api->GetNodes($node_filter,$node_columns); +//print("

GOT NODES

"); +//print_r($nodes); + +$ConfigureColumns->fetch_live_data($nodes); + +$show_conf = explode(";",$show_configuration); +foreach ($show_conf as $ss) { + if ($ss =="columns") + $show_columns_message = '0'; +} + + + // build site_ids - interface_ids $site_ids=array(); $interface_ids=array(); @@ -291,21 +350,40 @@ $info_header[$short]=array('type'=>$type,'title'=>$long, 'label'=>'?', 'header'= //$info_header["?"] = "none"; $headers = array_merge($ConfigureColumns->get_headers(),$info_header); -//print("

HEADERS"); -//print_r($headers); +if ($first_time_configuration) +$column_conf_visible = '1'; +else +$column_conf_visible = '0'; $toggle_nodes=new PlekitToggle('nodes-column-configuration', "Node table layout", - array('visible'=>'1')); + array('visible'=>$column_conf_visible, 'info_div'=>'note_columns_div')); $toggle_nodes->start(); print("

"); print(""); print(""); print(""); +print(""); +print(""); print(""); print("
"); -//print(""); print(""); + +if ($show_columns_message == '0') +$note_display = "display:none;"; +else +$note_display = ""; + + +print << +
+This tab allows you to customize the columns in the node tables, below. Information on the nodes comes from a variety of monitoring sources. If you, as either a user or a provider of monitoring data, would like to see additional columns made available, please send us your request in mail to support@myslice.info. You can find more information about the MySlice project at http://trac.myslice.info. +hide message permanently +
+ +EOF; + $ConfigureColumns->configuration_panel_html(true); $ConfigureColumns->javascript_init(); $toggle_nodes->end(); @@ -323,6 +401,7 @@ $peers = new Peers ($api); // write rows foreach ($nodes as $node) { //$node_obj = new Node ($node); + $hostname=$node['hostname']; $node_id=$node['node_id']; $site_id=$node['site_id']; @@ -337,14 +416,18 @@ foreach ($nodes as $node) { if (plc_is_admin()) $table->cell(l_node_t($node_id,$node_id)); $table->cell (l_node_t($node_id,$hostname)); $peers->cell ($table,$peer_id); - //$table->cell (topdomain($hostname)); + + //prefetch some columns $node['domain'] = topdomain($hostname); - //$table->cell (l_site_t($site_id,$login_base)); $node['sitename'] = l_site_t($site_id,$login_base); - //$table->cell (l_interface_t($interface_id,$ip),array('only-if'=> !$peer_id)); - $node['ipaddress'] = l_interface_t($interface_id,$ip); + if ($interface_id) + $node['ipaddress'] = l_interface_t($interface_id,$ip); + else + $node['ipaddress'] = "n/a"; + list($label,$class) = Node::status_label_class_($node); $table->cell ($label,array('class'=>$class)); + $table->cell( ($node['node_type']=='reservable')?reservable_mark():"" ); //$table->cell (count($node['slice_ids'])); //foreach ($visiblecolumns as $tagname) $table->cell($node[$tagname]); $ConfigureColumns->cells($table, $node); @@ -356,6 +439,7 @@ foreach ($nodes as $node) { $table->end(); $nifty->end(); + //plekit_linetabs ($tabs,"bottom"); // Print footer @@ -363,18 +447,3 @@ include 'plc_footer.php'; ?> - -