From e54aaad8077e7ddf6ed37ec8275bb6ba73b152a1 Mon Sep 17 00:00:00 2001 From: Digimer Date: Thu, 7 May 2020 11:17:56 -0400 Subject: [PATCH] * Added MTU, NTP and DNS fields to install manifest step 2. * Got the first BCN part of step 3 working. Signed-off-by: Digimer --- cgi-bin/striker | 237 +++++++++++++++++++++++++++++++--- html/skins/alteeve/anvil.html | 235 +++++++++++++++++++++++++++++++++ share/words.xml | 10 ++ tools/test.pl | 83 ++++++------ 4 files changed, 509 insertions(+), 56 deletions(-) diff --git a/cgi-bin/striker b/cgi-bin/striker index 9f6bc57b..81ae6297 100755 --- a/cgi-bin/striker +++ b/cgi-bin/striker @@ -1534,17 +1534,23 @@ sub handle_manifest { my ($anvil) = @_; - $anvil->data->{cgi}{step}{value} = 1 if not defined $anvil->data->{cgi}{step}{value}; - $anvil->data->{cgi}{prefix}{value} = "" if not defined $anvil->data->{cgi}{prefix}{value}; - $anvil->data->{cgi}{prefix}{alert} = 0 if not defined $anvil->data->{cgi}{prefix}{alert}; - $anvil->data->{cgi}{domain}{value} = "" if not defined $anvil->data->{cgi}{domain}{value}; - $anvil->data->{cgi}{domain}{alert} = 0 if not defined $anvil->data->{cgi}{domain}{alert}; - $anvil->data->{cgi}{sequence}{value} = "" if not defined $anvil->data->{cgi}{sequence}{value}; - $anvil->data->{cgi}{sequence}{alert} = 0 if not defined $anvil->data->{cgi}{sequence}{alert}; - $anvil->data->{cgi}{bcn_count}{value} = 1 if not defined $anvil->data->{cgi}{bcn_count}{value}; - $anvil->data->{cgi}{bcn_count}{alert} = 0 if not defined $anvil->data->{cgi}{bcn_count}{alert}; - $anvil->data->{cgi}{ifn_count}{value} = 1 if not defined $anvil->data->{cgi}{ifn_count}{value}; - $anvil->data->{cgi}{ifn_count}{alert} = 0 if not defined $anvil->data->{cgi}{ifn_count}{alert}; + $anvil->data->{cgi}{step}{value} = 1 if not defined $anvil->data->{cgi}{step}{value}; + $anvil->data->{cgi}{prefix}{value} = "" if not defined $anvil->data->{cgi}{prefix}{value}; + $anvil->data->{cgi}{prefix}{alert} = 0 if not defined $anvil->data->{cgi}{prefix}{alert}; + $anvil->data->{cgi}{domain}{value} = "" if not defined $anvil->data->{cgi}{domain}{value}; + $anvil->data->{cgi}{domain}{alert} = 0 if not defined $anvil->data->{cgi}{domain}{alert}; + $anvil->data->{cgi}{sequence}{value} = "" if not defined $anvil->data->{cgi}{sequence}{value}; + $anvil->data->{cgi}{sequence}{alert} = 0 if not defined $anvil->data->{cgi}{sequence}{alert}; + $anvil->data->{cgi}{bcn_count}{value} = 1 if not defined $anvil->data->{cgi}{bcn_count}{value}; + $anvil->data->{cgi}{bcn_count}{alert} = 0 if not defined $anvil->data->{cgi}{bcn_count}{alert}; + $anvil->data->{cgi}{ifn_count}{value} = 1 if not defined $anvil->data->{cgi}{ifn_count}{value}; + $anvil->data->{cgi}{ifn_count}{alert} = 0 if not defined $anvil->data->{cgi}{ifn_count}{alert}; + $anvil->data->{cgi}{dns}{value} = "8.8.8.8,8.8.4.4" if not defined $anvil->data->{cgi}{dns}{value}; + $anvil->data->{cgi}{dns}{alert} = 0 if not defined $anvil->data->{cgi}{dns}{alert}; + $anvil->data->{cgi}{ntp}{value} = "" if not defined $anvil->data->{cgi}{ntp}{value}; + $anvil->data->{cgi}{ntp}{alert} = 0 if not defined $anvil->data->{cgi}{ntp}{alert}; + $anvil->data->{cgi}{mtu}{value} = 1500 if not defined $anvil->data->{cgi}{mtu}{value}; + $anvil->data->{cgi}{mtu}{alert} = 0 if not defined $anvil->data->{cgi}{mtu}{alert}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::step::value" => $anvil->data->{cgi}{step}{value}, "cgi::prefix::value" => $anvil->data->{cgi}{prefix}{value}, @@ -1552,6 +1558,9 @@ sub handle_manifest "cgi::sequence::value" => $anvil->data->{cgi}{sequence}{value}, "cgi::bcn_count::value" => $anvil->data->{cgi}{bcn_count}{value}, "cgi::ifn_count::value" => $anvil->data->{cgi}{ifn_count}{value}, + "cgi::dns::value" => $anvil->data->{cgi}{dns}{value}, + "cgi::ntp::value" => $anvil->data->{cgi}{ntp}{value}, + "cgi::mtu::value" => $anvil->data->{cgi}{mtu}{value}, }}); if ($anvil->data->{cgi}{step}{value} > 1) @@ -1674,20 +1683,26 @@ sub handle_manifest { my $say_bcn = $anvil->Words->string({key => "striker_0018", variables => { number => $i }}); my $network_key = "bcn".$i."_network"; + my $subnet_key = "bcn".$i."_subnet"; my $gateway_key = "bcn".$i."_gateway"; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { say_bcn => $say_bcn, network_key => $network_key, + subnet_key => $subnet_key, gateway_key => $gateway_key, }}); $anvil->data->{cgi}{$network_key}{value} = "10.20".$i.".0.0" if not defined $anvil->data->{cgi}{$network_key}{value}; $anvil->data->{cgi}{$network_key}{alert} = 0 if not defined $anvil->data->{cgi}{$network_key}{alert}; + $anvil->data->{cgi}{$subnet_key}{value} = "255.255.0.0" if not defined $anvil->data->{cgi}{$subnet_key}{value}; + $anvil->data->{cgi}{$subnet_key}{alert} = 0 if not defined $anvil->data->{cgi}{$subnet_key}{alert}; $anvil->data->{cgi}{$gateway_key}{value} = "" if not defined $anvil->data->{cgi}{$gateway_key}{value}; $anvil->data->{cgi}{$gateway_key}{alert} = 0 if not defined $anvil->data->{cgi}{$gateway_key}{alert}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::${network_key}::value" => $anvil->data->{cgi}{$network_key}{value}, "cgi::${network_key}::alert" => $anvil->data->{cgi}{$network_key}{alert}, + "cgi::${subnet_key}::value" => $anvil->data->{cgi}{$subnet_key}{value}, + "cgi::${subnet_key}::alert" => $anvil->data->{cgi}{$subnet_key}{alert}, "cgi::${gateway_key}::value" => $anvil->data->{cgi}{$gateway_key}{value}, "cgi::${gateway_key}::alert" => $anvil->data->{cgi}{$gateway_key}{alert}, }}); @@ -1697,7 +1712,7 @@ sub handle_manifest network_name => $network_key, network_class => $anvil->data->{cgi}{$network_key}{alert} ? "input_alert" : "", network_value => $anvil->data->{cgi}{$network_key}{value}, - subnet => "255.255.0.0", + subnet => '255.255.0.0 ', gateway_name => $gateway_key, gateway_class => $anvil->data->{cgi}{$gateway_key}{alert} ? "input_alert" : "", gateway_value => $anvil->data->{cgi}{$gateway_key}{value}, @@ -1708,15 +1723,17 @@ sub handle_manifest my $say_sn = $anvil->Words->string({key => "striker_0020", variables => { number => '1' }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { say_sn => $say_sn }}); - $anvil->data->{cgi}{sn1_network}{value} = "10.101.0.0" if not defined $anvil->data->{cgi}{sn1_network}{value}; - $anvil->data->{cgi}{sn1_network}{alert} = 0 if not defined $anvil->data->{cgi}{sn1_network}{alert}; + $anvil->data->{cgi}{sn1_network}{value} = "10.101.0.0" if not defined $anvil->data->{cgi}{sn1_network}{value}; + $anvil->data->{cgi}{sn1_network}{alert} = 0 if not defined $anvil->data->{cgi}{sn1_network}{alert}; + $anvil->data->{cgi}{sn1_subnet}{value} = "255.255.0.0" if not defined $anvil->data->{cgi}{sn1_subnet}{value}; + $anvil->data->{cgi}{sn1_subnet}{alert} = 0 if not defined $anvil->data->{cgi}{sn1_subnet}{alert}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::sn1_network::value" => $anvil->data->{cgi}{sn1_network}{value} }}); $network_form .= $anvil->Template->get({file => "anvil.html", name => "manifest-step2-network-entry", variables => { network => $say_sn, network_name => "sn1_network", network_class => $anvil->data->{cgi}{sn1_network}{alert} ? "input_alert" : "", network_value => $anvil->data->{cgi}{sn1_network}{value}, - subnet => "255.255.0.0", + subnet => '255.255.0.0 ', }}); # Now IFNs @@ -1773,16 +1790,132 @@ sub handle_manifest $anvil->data->{form}{back_link} = "?anvil=true&task=manifests&manifest_uuid=".$anvil->data->{cgi}{manifest_uuid}{value}."&step=1&prefix=".$anvil->data->{cgi}{prefix}{value}."&domain=".$anvil->data->{cgi}{domain}{value}."&sequence=".$anvil->data->{cgi}{sequence}{value}."&ifn_count=".$anvil->data->{cgi}{ifn_count}{value}; $anvil->data->{form}{refresh_link} = "?anvil=true&task=manifests&manifest_uuid=".$anvil->data->{cgi}{manifest_uuid}{value}."&step=2&prefix=".$anvil->data->{cgi}{prefix}{value}."&domain=".$anvil->data->{cgi}{domain}{value}."&sequence=".$anvil->data->{cgi}{sequence}{value}."&ifn_count=".$anvil->data->{cgi}{ifn_count}{value}; $anvil->data->{form}{body} = $anvil->Template->get({file => "anvil.html", name => "manifest-step2", variables => { - title => $anvil->Words->string({key => "striker_0226", variables => { number => 2 }}), - networks => $network_form, - number => "X", + title => $anvil->Words->string({key => "striker_0226", variables => { number => 2 }}), + networks => $network_form, + dns => $anvil->data->{cgi}{dns}{value}, + dns_class => $anvil->data->{cgi}{dns}{alert} ? "input_alert" : "", + ntp => $anvil->data->{cgi}{ntp}{value}, + ntp_class => $anvil->data->{cgi}{ntp}{alert} ? "input_alert" : "", + mtu => $anvil->data->{cgi}{mtu}{value}, + mtu_class => $anvil->data->{cgi}{mtu}{alert} ? "input_alert" : "", }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'form::body' => $anvil->data->{form}{body} }}); } elsif ($anvil->data->{cgi}{step}{value} eq "3") { # Build and show the main manifest page! + my $sequence = $anvil->data->{cgi}{sequence}{value}; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { sequence => $sequence }}); + + my $network_form = ""; + my $ipmi_ip_guess = ""; + foreach my $i (1..$anvil->data->{cgi}{bcn_count}{value}) + { + my $say_bcn = $anvil->Words->string({key => "striker_0018", variables => { number => $i }}); + my $network_key = "bcn".$i."_network"; + my $subnet_key = "bcn".$i."_subnet"; + my $gateway_key = "bcn".$i."_gateway"; + my $node1_network_key = "node1_bcn".$i."_network"; + my $node2_network_key = "node2_bcn".$i."_network"; + my $dr1_network_key = "dr1_bcn".$i."_network"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + say_bcn => $say_bcn, + network_key => $network_key, + subnet_key => $subnet_key, + gateway_key => $gateway_key, + node1_network_key => $node1_network_key, + node2_network_key => $node2_network_key, + dr1_network_key => $dr1_network_key, + }}); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + "cgi::${network_key}::value" => $anvil->data->{cgi}{$network_key}{value}, + "cgi::${network_key}::alert" => $anvil->data->{cgi}{$network_key}{alert}, + "cgi::${subnet_key}::value" => $anvil->data->{cgi}{$subnet_key}{value}, + "cgi::${subnet_key}::alert" => $anvil->data->{cgi}{$subnet_key}{alert}, + "cgi::${gateway_key}::value" => $anvil->data->{cgi}{$gateway_key}{value}, + "cgi::${gateway_key}::alert" => $anvil->data->{cgi}{$gateway_key}{alert}, + }}); + + # On the BCN, we can confidently take the first two octets from 'network' and add our + # guesses to the last two octets. + if ($anvil->data->{cgi}{$network_key}{value} =~ /^(\d{1,3}\.\d{1,3})\.0\.0/) + { + my $first_two_octets = $1; + my $ip_third_octet = 8 + (2 * $sequence); # Thanks to Leigh Nunan (@leighnunan) for this elegant sequence formula + my $host_ip = $first_two_octets.".".$ip_third_octet; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + first_two_octets => $first_two_octets, + ip_third_octet => $ip_third_octet, + host_ip => $host_ip, + }}); + + $anvil->data->{cgi}{$node1_network_key}{value} = $host_ip.".1" if not defined $anvil->data->{cgi}{$node1_network_key}{value}; + $anvil->data->{cgi}{$node2_network_key}{value} = $host_ip.".2" if not defined $anvil->data->{cgi}{$node2_network_key}{value}; + $anvil->data->{cgi}{$dr1_network_key}{value} = $host_ip.".3" if not defined $anvil->data->{cgi}{$dr1_network_key}{value}; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + "cgi::${node1_network_key}::value" => $anvil->data->{cgi}{$node1_network_key}{value}, + "cgi::${node2_network_key}::value" => $anvil->data->{cgi}{$node2_network_key}{value}, + "cgi::${dr1_network_key}::value" => $anvil->data->{cgi}{$dr1_network_key}{value}, + }}); + + # If $i = 1, build the IPMI IP guess + if ($i == 1) + { + my $ipmi_third_octet = 8 + (2 * $sequence) + 1; + $ipmi_ip_guess = $first_two_octets.".".$ipmi_third_octet; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + ipmi_third_octet => $ipmi_third_octet, + ipmi_ip_guess => $ipmi_ip_guess, + }}); + + $anvil->data->{cgi}{node1_ipmi_ip}{value} = $ipmi_ip_guess.".1" if not defined $anvil->data->{cgi}{node1_ipmi_ip}{value}; + $anvil->data->{cgi}{node2_ipmi_ip}{value} = $ipmi_ip_guess.".2" if not defined $anvil->data->{cgi}{node2_ipmi_ip}{value}; + $anvil->data->{cgi}{dr1_ipmi_ip}{value} = $ipmi_ip_guess.".3" if not defined $anvil->data->{cgi}{dr1_ipmi_ip}{value}; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + "cgi::node1_ipmi_ip::value" => $anvil->data->{cgi}{node1_ipmi_ip}{value}, + "cgi::node2_ipmi_ip::value" => $anvil->data->{cgi}{node2_ipmi_ip}{value}, + "cgi::dr1_ipmi_ip::value" => $anvil->data->{cgi}{dr1_ipmi_ip}{value}, + }}); + } + } + + # It should never happen, but in case the regex missed, set the guessed IPs to empty strings. + $anvil->data->{cgi}{$node1_network_key}{value} = "" if not defined $anvil->data->{cgi}{$node1_network_key}{value}; + $anvil->data->{cgi}{$node2_network_key}{value} = "" if not defined $anvil->data->{cgi}{$node2_network_key}{value}; + $anvil->data->{cgi}{$dr1_network_key}{value} = "" if not defined $anvil->data->{cgi}{$dr1_network_key}{value}; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { + "cgi::${node1_network_key}::value" => $anvil->data->{cgi}{$node1_network_key}{value}, + "cgi::${node2_network_key}::value" => $anvil->data->{cgi}{$node2_network_key}{value}, + "cgi::${dr1_network_key}::value" => $anvil->data->{cgi}{$dr1_network_key}{value}, + }}); + + $network_form .= $anvil->Template->get({file => "anvil.html", name => "manifest-step3-network-entry", variables => { + network => $say_bcn, + network_name => $network_key, + network_value => $anvil->data->{cgi}{$network_key}{value}, + subnet_name => $subnet_key, + subnet_value => $anvil->data->{cgi}{$subnet_key}{value}, + gateway_name => $gateway_key, + gateway_value => $anvil->data->{cgi}{$gateway_key}{value}, + node1_network_name => $node1_network_key, + node1_network_value => $anvil->data->{cgi}{$node1_network_key}{value}, + node1_network_class => $anvil->data->{cgi}{$node1_network_key}{alert} ? "input_alert" : "", + node2_network_name => $node2_network_key, + node2_network_value => $anvil->data->{cgi}{$node2_network_key}{value}, + node2_network_class => $anvil->data->{cgi}{$node2_network_key}{alert} ? "input_alert" : "", + dr1_network_name => $dr1_network_key, + dr1_network_value => $anvil->data->{cgi}{$dr1_network_key}{value}, + dr1_network_class => $anvil->data->{cgi}{$dr1_network_key}{alert} ? "input_alert" : "", + }}); + } + $anvil->data->{form}{back_link} = "?anvil=true&task=manifests&manifest_uuid=".$anvil->data->{cgi}{manifest_uuid}{value}."&step=1&prefix=".$anvil->data->{cgi}{prefix}{value}."&domain=".$anvil->data->{cgi}{domain}{value}."&sequence=".$anvil->data->{cgi}{sequence}{value}."&ifn_count=".$anvil->data->{cgi}{ifn_count}{value}; + $anvil->data->{form}{refresh_link} = "?anvil=true&task=manifests&manifest_uuid=".$anvil->data->{cgi}{manifest_uuid}{value}."&step=2&prefix=".$anvil->data->{cgi}{prefix}{value}."&domain=".$anvil->data->{cgi}{domain}{value}."&sequence=".$anvil->data->{cgi}{sequence}{value}."&ifn_count=".$anvil->data->{cgi}{ifn_count}{value}; + $anvil->data->{form}{body} = $anvil->Template->get({file => "anvil.html", name => "manifest-step3", variables => { + title => $anvil->Words->string({key => "striker_0226", variables => { number => 3 }}), + networks => $network_form, + }}); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'form::body' => $anvil->data->{form}{body} }}); } return(0); @@ -1863,6 +1996,74 @@ sub sanity_check_manifest_step2 $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { sane => $sane }}); } + # If DNS is specified, make sure it/they are valid. + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::dns::value" => $anvil->data->{cgi}{dns}{value} }}); + if ($anvil->data->{cgi}{dns}{value}) + { + foreach my $ip (split/,/, $anvil->data->{cgi}{dns}{value}) + { + $ip =~ s/^\s+//; + $ip =~ s/\s+$//; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ip => $ip }}); + + if (not $anvil->Validate->is_ipv4({ip => $ip})) + { + # Bad network + my $message = $anvil->Words->string({key => "error_0015"}); + $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $message }}); + $anvil->data->{cgi}{dns}{alert} = 1; + $sane = 0; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { + sane => $sane, + ip => $ip, + "cgi::dns::alert" => $anvil->data->{cgi}{dns}{alert}, + "cgi::dns::value" => $anvil->data->{cgi}{dns}{value}, + }}); + } + } + } + + # If NTP is specified, make sure it/they are valid. + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::ntp::value" => $anvil->data->{cgi}{ntp}{value} }}); + if ($anvil->data->{cgi}{ntp}{value}) + { + foreach my $ip (split/,/, $anvil->data->{cgi}{ntp}{value}) + { + $ip =~ s/^\s+//; + $ip =~ s/\s+$//; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ip => $ip }}); + + if (not $anvil->Validate->is_ipv4({ip => $ip})) + { + # Bad network + my $message = $anvil->Words->string({key => "error_0122"}); + $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $message }}); + $anvil->data->{cgi}{ntp}{alert} = 1; + $sane = 0; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { + sane => $sane, + ip => $ip, + "cgi::ntp::alert" => $anvil->data->{cgi}{ntp}{alert}, + "cgi::ntp::value" => $anvil->data->{cgi}{ntp}{value}, + }}); + } + } + } + + # Make sure the MTU is sane + if (not $anvil->Validate->is_positive_integer({number => $anvil->data->{cgi}{mtu}{value}})) + { + my $message = $anvil->Words->string({key => "error_0123"}); + $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $message }}); + $anvil->data->{cgi}{mtu}{alert} = 1; + $sane = 0; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { + sane => $sane, + "cgi::mtu::alert" => $anvil->data->{cgi}{mtu}{alert}, + "cgi::mtu::value" => $anvil->data->{cgi}{mtu}{value}, + }}); + } + return($sane); } diff --git a/html/skins/alteeve/anvil.html b/html/skins/alteeve/anvil.html index e01ae22d..928caafd 100644 --- a/html/skins/alteeve/anvil.html +++ b/html/skins/alteeve/anvil.html @@ -297,6 +297,38 @@   + + + + #!string!striker_0037!# + + + + + + + + + #!string!striker_0251!# + + + + + + + + + #!string!striker_0253!# + + + + + + + +   + + @@ -358,6 +390,38 @@   + + + + #!string!striker_0037!# + + + #!string!striker_0038!# + + + + + + #!string!striker_0251!# + + + #!string!striker_0252!# + + + + + + #!string!striker_0253!# + + + #!string!striker_0254!# + + + + +   + + @@ -391,6 +455,177 @@ + + + + + #!variable!network!#:   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   +
+ #!variable!title!# +
+   +
+ #!string!striker_0250!# +
+   +
+
+ + + + + + + + #!variable!networks!# + + + + + + + + + + + + + + + + +
+ +   + + + #!string!striker_0255!# + + + #!string!striker_0256!# + + + #!string!striker_0257!# +
+   +
+ + + +
+
+
+   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + #!string!striker_0149!# + + #!string!message_0163!# +
+ + #!string!striker_0025!# + + #!string!message_0164!# +
+ + #!string!striker_0026!# + + #!string!message_0165!# +
+   +
+ + #!string!message_0160!#   + + #!string!message_0131!# +
+ + #!string!message_0161!#   + + #!string!message_0132!# +
+ + #!string!message_0162!#   + + #!string!message_0133!# +
+
+ + diff --git a/share/words.xml b/share/words.xml index 1ba59007..3d7d3af9 100644 --- a/share/words.xml +++ b/share/words.xml @@ -180,6 +180,8 @@ The error was: The IP given for the network: [#!variable!name!#] does not appear to be the network base IP. Did you mean: [#!variable!ip!#]?The IP given for the network: [#!variable!network!#] with the subnet mask: [#!variable!subnet!#] does not appear to be a valid network range.The gateway: [#!variable!gateway!#] does not apear to be in the network: [#!variable!network!#]/[#!variable!subnet!#]. + An NTP entry is bad. One or more IPv4 addresses can be specified, with a comma separating multiple IPs. + The MTU needs to be a positive integer equal or above '512' bytes.Current Network Interfaces and States @@ -1361,6 +1363,14 @@ If you are comfortable that the target has changed for a known reason, you can s This is the domain name you would like to use for this #!string!brand_0006!#. This will be used in the next step when setting default hostnames for various devices.The second step specified the networks (subnets) that will be used for each network. Generally, you only want to change the IFN(s). The BCN and SN are always '/16' subnets and should only be changed if they conflict with an existing IFN.Default + The third step is where it all comes together! + NTP]]> + NTP servers.]]> + MTU]]> + MTU, over 1500 bytes), you can specify the maximum size in bytes here. Be sure all equipment support your chosen MTU size! When in doubt, leave this set to 1500.]]> + Node 1 + Node 2 + DR Host #!variable!number!#/sec diff --git a/tools/test.pl b/tools/test.pl index 5e7ee3d6..955a0479 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -15,47 +15,54 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) # Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete. $| = 1; -# 2.75 = 69.85 - use up to 55 mm -# 2.25 = 57.15 - use up to 45 mm -# 1.75 = 44.45 - use up to 30 mm -# 1.25 = 31.75 - use up to 20 mm - -my $one_two_five = []; -my $one_seven_five = []; -my $two_two_five = []; -my $two_seven_five = []; - -my $data = "26,31,25,22,24,23,, -,36,37,34,30,38,35,, -,43,43,42,34,39,35,, -,47,47,48,40,33,31,23,17, -,47,47,41,37,35,22,19,8,11 -,42,42,46,50,39,27,21,5,10 -,42,40,43,49,35,33,30,26, -,39,39,36,39,31,28,25,25, -,36,35,32,29,19,20,15,15, -,33,31,31,15,21,23,17,11, -,31,33,30,23,26,21,20,14, -,23,42,26,17,12,20,16,20"; - - -foreach my $line (split/\n/, $data) +foreach my $i (1..6) { - foreach my $depth (split/,/, $line) - { - next if not $depth; - if ($depth >= 45) { push @{$two_seven_five}, $depth; } - elsif ($depth >= 30) { push @{$two_two_five}, $depth; } - elsif ($depth >= 20) { push @{$one_seven_five}, $depth; } - else { push @{$one_two_five}, $depth; } - } + my $out = 8 + (2 * $i); + print "$i: [$out]\n"; } -print "2.75\": [".@{$two_seven_five}."]\n"; -print "2.25\": [".@{$two_two_five}."]\n"; -print "1.75\": [".@{$one_seven_five}."]\n"; -print "1.25\": [".@{$one_two_five}."]\n"; -print "Total: [".(@{$two_seven_five} + @{$two_two_five} + @{$one_seven_five} + @{$one_two_five})."]\n"; + +# # 2.75 = 69.85 - use up to 55 mm +# # 2.25 = 57.15 - use up to 45 mm +# # 1.75 = 44.45 - use up to 30 mm +# # 1.25 = 31.75 - use up to 20 mm +# +# my $one_two_five = []; +# my $one_seven_five = []; +# my $two_two_five = []; +# my $two_seven_five = []; +# +# my $data = "26,31,25,22,24,23,, +# ,36,37,34,30,38,35,, +# ,43,43,42,34,39,35,, +# ,47,47,48,40,33,31,23,17, +# ,47,47,41,37,35,22,19,8,11 +# ,42,42,46,50,39,27,21,5,10 +# ,42,40,43,49,35,33,30,26, +# ,39,39,36,39,31,28,25,25, +# ,36,35,32,29,19,20,15,15, +# ,33,31,31,15,21,23,17,11, +# ,31,33,30,23,26,21,20,14, +# ,23,42,26,17,12,20,16,20"; +# +# +# foreach my $line (split/\n/, $data) +# { +# foreach my $depth (split/,/, $line) +# { +# next if not $depth; +# if ($depth >= 45) { push @{$two_seven_five}, $depth; } +# elsif ($depth >= 30) { push @{$two_two_five}, $depth; } +# elsif ($depth >= 20) { push @{$one_seven_five}, $depth; } +# else { push @{$one_two_five}, $depth; } +# } +# } +# +# print "2.75\": [".@{$two_seven_five}."]\n"; +# print "2.25\": [".@{$two_two_five}."]\n"; +# print "1.75\": [".@{$one_seven_five}."]\n"; +# print "1.25\": [".@{$one_two_five}."]\n"; +# print "Total: [".(@{$two_seven_five} + @{$two_two_five} + @{$one_seven_five} + @{$one_two_five})."]\n"; # my $anvil = Anvil::Tools->new({debug => 3}); # $anvil->Log->secure({set => 1});