2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 01:56:39 +00:00

Merge pull request #1712 from gurevichmark/xCAT-probe_grammar

xcat-probe grammar and spelling fixes
This commit is contained in:
Xiaopeng Wang 2016-08-17 08:15:16 +08:00 committed by GitHub
commit 98d3af463c
6 changed files with 106 additions and 107 deletions

View File

@ -26,10 +26,10 @@ Description:
This command can be used to detect the dhcp server in a network for a specific mac address.
Options:
-i interface: Required. The interface which facing the target network.
-m macaddress: The mac that will be used to detect dhcp server. Recommend to use the real mac of the node that will be netboot. If no specified, the mac of interface which specified by -i will be used.
-i interface: Required. The interface facing the target network.
-m macaddress: The mac that will be used to detect dhcp server. Use the real mac of the node that will be netboot. If not specified, the mac specified by -i will be used.
-d duration: The time to wait to detect the dhcp messages. The default value is 10s.
-V verbose: To print additional debug information.
-V verbose: Print additional debug information.
";
#---------------------------
@ -59,7 +59,7 @@ if ($::HELP) {
}
if ($::TEST) {
probe_utils->send_msg("$output", "o", "$program_name can be used to detect the dhcp server in a network for a specific mac address. Before using this command, please install tcpdump command ahead. The operating system supported are redhat, sles, ubuntu and debian.");
probe_utils->send_msg("$output", "o", "$program_name can be used to detect the dhcp server in a network for a specific mac address. Before using this command, install 'tcpdump' command. The operating system supported are RedHat, SLES, Ubuntu and Debian.");
exit 0;
}
@ -72,12 +72,12 @@ unless (-x "/usr/sbin/tcpdump") {
if ($::IF) {
$nic = $::IF;
} else {
probe_utils->send_msg("$output", "f", "Option '-i' needs to be assigned value for $program_name");
probe_utils->send_msg("$output", "f", "Option '-i' needs to be assigned a value for $program_name");
probe_utils->send_msg("$output", "d", "$::USAGE");
exit 1;
}
my $msg = "Find right IP/MAC to do dhcp discover";
my $msg = "Find correct IP/MAC to do dhcp discover";
my $IP = `ip addr show dev $nic | awk -F" " '/inet / {print \$2}' | head -n 1 |awk -F"/" '{print \$1}'`;
chomp($IP);
my $MAC;
@ -88,7 +88,7 @@ if ($::MACADD) {
}
chomp($MAC);
probe_utils->send_msg("$output", "d", "Send out dhcp discover from: NIC = $nic, IP = $IP, MAC = $MAC") if ($::VERBOSE);
probe_utils->send_msg("$output", "d", "Send dhcp discover from: NIC = $nic, IP = $IP, MAC = $MAC") if ($::VERBOSE);
if (!$IP || !$MAC) {
probe_utils->send_msg("$output", "f", $msg);
@ -108,7 +108,7 @@ if (-f "/etc/redhat-release") {
$os = "debian";
} else {
probe_utils->send_msg("$output", "f", $msg);
probe_utils->send_msg("$output", "d", "Only support the redhat, sles, ubuntu and debian OS");
probe_utils->send_msg("$output", "d", "Only support the RedHat, SLES, Ubuntu and Debian OS");
exit 1;
}
probe_utils->send_msg("$output", "d", "Current operating system is $os") if ($::VERBOSE);
@ -118,7 +118,7 @@ if ($::DURATION) {
$duration = $::DURATION;
}
probe_utils->send_msg("$output", "d", "The duration of capturing DHCP package is $duration second") if ($::VERBOSE);
probe_utils->send_msg("$output", "d", "The duration of capturing DHCP package is $duration second(s)") if ($::VERBOSE);
# send out the package
$msg = "Build the socket to send out DHCP request";
@ -204,7 +204,7 @@ while (<FILE>) {
if ($line =~ /^\d\d:\d\d:\d\d/) {
# A new packet was captured. Parse the last one.
probe_utils->send_msg("$output", "d", "The server I found: mac = $chaddr, clientip = $ciaddr, serverip = $siaddr, offer = $offer") if ($::VERBOSE);
probe_utils->send_msg("$output", "d", "The server found: mac = $chaddr, clientip = $ciaddr, serverip = $siaddr, offer = $offer") if ($::VERBOSE);
if ($os eq "sles") { $offer = 1; }
if ($chaddr =~ /$MAC/i && $offer && $ciaddr && $siaddr && $rsiaddr) {
$output{$rsiaddr}{'client'} = $ciaddr;
@ -245,15 +245,15 @@ close(FILE);
my $sn = scalar(keys %output);
probe_utils->send_msg("$output", "i", "++++++++++++++++++++++++++++++++++");
probe_utils->send_msg("$output", "i", "There are $sn servers reply the dhcp discover.");
probe_utils->send_msg("$output", "i", "There are $sn servers replied to dhcp discover.");
foreach my $server (keys %output) {
probe_utils->send_msg("$output", "i", " Server:$server assign IP [$output{$server}{'client'}] to you. The next server is [$output{$server}{'nextsv'}]!");
probe_utils->send_msg("$output", "i", " Server:$server assign IP [$output{$server}{'client'}]. The next server is [$output{$server}{'nextsv'}]!");
}
probe_utils->send_msg("$output", "i", "++++++++++++++++++++++++++++++++++");
if (scalar(@snack)) {
probe_utils->send_msg("$output", "i", "===================================");
probe_utils->send_msg("$output", "i", "The dhcp servers which sending out NACK in present network:");
probe_utils->send_msg("$output", "i", "The dhcp servers sending out NACK in present network:");
foreach my $nack (@snack) {
probe_utils->send_msg("$output", "i", " $nack");
}
@ -379,5 +379,5 @@ sub kill_child {
foreach my $cpid (@pidoftcpdump) {
kill 15, $cpid;
}
probe_utils->send_msg("$output", "d", "Kill process $pid which is used to capture the packet by tcpdump") if ($::VERBOSE);
probe_utils->send_msg("$output", "d", "Kill process $pid used to capture the packet by 'tcpdump'") if ($::VERBOSE);
}

View File

@ -35,16 +35,16 @@ $::USAGE = "Usage:
$program_name [-V] [-m <discovery_type> -n <node_range>] [--noprecheck]
Description:
Do probe for discovery process, including pre-check for required configuration and realtime monitor of discovery process.
If all pre-check items pass, $program_name will go to monitor directly, otherwise $program_name exit for error.
In order to do realtime monitor, $program_name probe program must be run along with the node discovery procedure. Plese trigger this command before trigger node discovery procedure.
Probe the discovery process, including pre-check for required configuration and realtime monitor of discovery process.
If all pre-check items pass, $program_name will go to monitor directly, otherwise $program_name will exit.
In order to do realtime monitor, $program_name probe must be run along with the node discovery procedure. Trigger this command before triggering node discovery procedure.
Currently, this command does not support hierarchy.
Options:
-h : Get usage information of $program_name.
-V : Output more information for debug.
-m : The method of discovery, the valid values are $valid_discovery_type_str.
-n : The range of predefined node, must used with option -m.
-n : The range of predefined nodes, must be used with option -m.
--noprecheck : skip pre-checking discovery to validate correct configuration.
";
@ -64,12 +64,12 @@ Options:
sub check_genesis_file {
my $arch = shift;
if (($arch ne "ppc64") and ($arch ne "x86_64")) {
probe_utils->send_msg("$output", "d", "Please input correct arch type") if ($verbose);
probe_utils->send_msg("$output", "d", "Specify correct arch type") if ($verbose);
return 1;
}
my $rst_f = 0;
probe_utils->send_msg("$output", "d", "Start to check genesis files for $arch...") if ($verbose);
probe_utils->send_msg("$output", "d", "Starting to check genesis files for $arch...") if ($verbose);
my $os = probe_utils->get_os();
my $genesis_base;
@ -92,11 +92,11 @@ sub check_genesis_file {
$genesis_scripts = `rpm -qa | grep -i "xcat-genesis-scripts" | grep -i "$arch"`;
}
unless ($genesis_base and $genesis_scripts) {
probe_utils->send_msg("$output", "d", "xCAT-genesis for $arch did not be installed.") if ($verbose);
probe_utils->send_msg("$output", "d", "xCAT-genesis for $arch is not installed.") if ($verbose);
return 1;
}
probe_utils->send_msg("$output", "d", "xCAT-genesis for $arch installed, start to check files...") if ($verbose);
probe_utils->send_msg("$output", "d", "xCAT-genesis for $arch is installed, starting to check files...") if ($verbose);
my $tftpdir = `tabdump site | awk -F',' '/^"tftpdir",/ { gsub(/"/, "", \$2) ; print \$2 }'`;
chomp($tftpdir);
@ -109,7 +109,7 @@ sub check_genesis_file {
if ($arch eq "ppc64") {
$genesis_folder = "$tftpdir/pxelinux.cfg/p";
unless (-d "$genesis_folder") {
probe_utils->send_msg("$output", "d", "There is no genesis file for $arch. Please run 'mknb ppc64' if you use ppc64/ppc64le machine.") if ($verbose);
probe_utils->send_msg("$output", "d", "There is no genesis file for $arch. Run 'mknb ppc64' if using ppc64/ppc64le machine.") if ($verbose);
return 1;
}
@ -131,7 +131,7 @@ sub check_genesis_file {
$initrd_path = $initrd_info[1];
$wget_rst = system("wget -q --spider $initrd_path -T 0.5 -t 3");
if ($wget_rst) {
probe_utils->send_msg("$output", "d", "initrd cannot be downloaded from $initrd_path.") if ($verbose);
probe_utils->send_msg("$output", "d", "'initrd' cannot be downloaded from $initrd_path.") if ($verbose);
$rst_f = 1;
} else {
probe_utils->send_msg("$output", "d", "Check initrd file: $initrd_path PASS.") if ($verbose);
@ -154,7 +154,7 @@ sub check_genesis_file {
} else {
$genesis_folder = "$tftpdir/xcat/xnba/nets";
unless (-d "$genesis_folder") {
probe_utils->send_msg("$output", "d", "There is no genesis file for $arch. Please run 'mknb x86_64' if you use x86_64 machine.") if ($verbose);
probe_utils->send_msg("$output", "d", "There is no genesis file for $arch. Run 'mknb x86_64' if using x86_64 machine.") if ($verbose);
return 1;
}
@ -185,13 +185,13 @@ sub check_genesis_file {
}
unless ($host_ip) {
probe_utils->send_msg("$output", "d", "There is no ip for range $ip_range") if ($verbose);
probe_utils->send_msg("$output", "d", "There is no IP for range $ip_range") if ($verbose);
$rst_f = 1;
next;
}
unless (open(FILE, $_)) {
probe_utils->send_msg("$output", "d", "Can not open file $_.");
probe_utils->send_msg("$output", "d", "Cannot open file $_.");
$rst_f = 1;
next;
}
@ -222,7 +222,7 @@ sub check_genesis_file {
} else {
probe_utils->send_msg("$output", "d", "Check elilo file: $elilo_http PASS.") if ($verbose);
unless (open(FILE_ELILO, $elilo_path)) {
probe_utils->send_msg("$output", "d", "Can not open file $_.") if ($verbose);
probe_utils->send_msg("$output", "d", "Cannot open file $_.") if ($verbose);
$rst_f = 1;
next;
}
@ -250,7 +250,7 @@ sub check_genesis_file {
$wget_rst = system("wget -q --spider $initrd_http -T 0.5 -t 3");
if ($wget_rst) {
probe_utils->send_msg("$output", "d", "initrd cannot be downloaded from $initrd_http.") if ($verbose);
probe_utils->send_msg("$output", "d", "'initrd' cannot be downloaded from $initrd_http.") if ($verbose);
$rst_f = 1;
} else {
probe_utils->send_msg("$output", "d", "Check initrd file: $initrd_http PASS.") if ($verbose);
@ -286,7 +286,7 @@ sub get_node_ip {
foreach my $node (keys %nodeip) {
$ip_net = xCAT::NetworkUtils->getipaddr($node);
if ($nodeip{$node} and ($nodeip{$node} ne $ip_net)) {
probe_utils->send_msg("$output", "d", "IP $nodeip{$node} of definition for $node is not correct") if ($verbose);
probe_utils->send_msg("$output", "d", "IP $nodeip{$node} definition for $node is not correct") if ($verbose);
}
$nodeip{$node} = $ip_net;
}
@ -424,7 +424,7 @@ sub dhcp_dynamic_range_check {
}
}
} else {
probe_utils->send_msg("$output", "d", "Dynamic range for net $net did not be configured.") if ($verbose);
probe_utils->send_msg("$output", "d", "Dynamic range for net $net is not configured.") if ($verbose);
$rst = 1;
next;
}
@ -631,7 +631,7 @@ sub handle_compute_msg {
my $node = `lsdef -i mac -c 2>&1 | awk -F: '/$ipmacmap{$ip}/ {print \$1}'`;
chomp($node);
$monitor_nodes{$node} = 1 if (defined($monitor_nodes{$node}));
probe_utils->send_msg("$output", "o", "Node $node has finished it's discovery process");
probe_utils->send_msg("$output", "o", "Node $node has finished its discovery process");
my $output = `lsdef $node 2>&1`;
print "-------------------\n$output-------------------\n";
}
@ -757,7 +757,7 @@ sub check_pre_defined_node {
if (!exists($nodecheckrst{$node}{error})) {
if ($discovery_type eq "mtms") {
if (!(exists($nodecheckrst{$node}{"mtm"}) && exists($nodecheckrst{$node}{"serial"}))) {
$nodecheckrst{$node}{"error"} = "node definition is wrong for '$discovery_type' type discovery";
$nodecheckrst{$node}{"error"} = "Node definition is wrong for '$discovery_type' type discovery";
$rst = 1;
}
} elsif ($discovery_type eq "switch") {
@ -770,23 +770,23 @@ sub check_pre_defined_node {
my $tmpoutput = `lsdef $nodecheckrst{$node}{"switch"} 2>&1`;
if ($?) {
$nodecheckrst{$node}{"error"} = "Miss definition for related switch $nodeswitch";
$nodecheckrst{$node}{"error"} = "Missing definition for related switch $nodeswitch";
$rst = 1;
last;
}
if ($tmpoutput !~ /snmpversion=/) {
$nodecheckrst{$node}{"error"} = "Miss attribute 'snmpversion' definition for related switch $nodeswitch";
$nodecheckrst{$node}{"error"} = "Missing attribute 'snmpversion' definition for related switch $nodeswitch";
$rst = 1;
last;
}
if ($tmpoutput !~ /username=/) {
$nodecheckrst{$node}{"error"} = "Miss attribute 'username' definition for related switch $nodeswitch";
$nodecheckrst{$node}{"error"} = "Missing attribute 'username' definition for related switch $nodeswitch";
$rst = 1;
last;
}
if ($tmpoutput !~ /password=/) {
$nodecheckrst{$node}{"error"} = "Miss attribute 'password' definition for related switch $nodeswitch";
$nodecheckrst{$node}{"error"} = "Missing attribute 'password' definition for related switch $nodeswitch";
$rst = 1;
last;
}
@ -852,7 +852,7 @@ sub do_pre_check {
exit 1;
}
$msg = "The input network interfaces $nics exist and are configured well on current server";
$msg = "The input network interfaces $nics exist and are configured correctly on current server";
my $miss = 0;
my @nic_array = split(",", $nics);
foreach my $nic (@nic_array) {
@ -884,13 +884,13 @@ sub do_pre_check {
my $masteripinsite = `tabdump site | awk -F',' '/^"master",/ { gsub(/"/, "", \$2) ; print \$2 }'`;
chomp($masteripinsite);
if ($masteripinsite eq "") {
probe_utils->send_msg("$output", "d", "There isn't 'master' definition in 'site' talbe") if ($verbose);
probe_utils->send_msg("$output", "d", "There isn't 'master' definition in 'site' table") if ($verbose);
probe_utils->send_msg("$output", "f", $msg);
exit 1;
}
if (!xCAT::NetworkUtils->isIpaddr("$masteripinsite")) {
probe_utils->send_msg("$output", "d", "The value of 'master' in 'site' table isn't a IP address") if ($verbose);
probe_utils->send_msg("$output", "d", "The value of 'master' in 'site' table isn't an IP address") if ($verbose);
probe_utils->send_msg("$output", "f", $msg);
exit 1;
}
@ -921,7 +921,7 @@ sub do_pre_check {
probe_utils->send_msg("$output", "o", $msg);
if (check_genesis_file("x86_64")) {
probe_utils->send_msg("$output", "w", "Genesis files for x86 are not available");
probe_utils->send_msg("$output", "i", "If don't plan to manage a x86 server, please ignore above warning");
probe_utils->send_msg("$output", "i", "Ignore above warning if not planning on managing x86 server");
} else {
probe_utils->send_msg("$output", "o", "Genesis files for x86 are available");
}
@ -934,7 +934,7 @@ sub do_pre_check {
probe_utils->send_msg("$output", "o", $msg);
if (check_genesis_file("ppc64")) {
probe_utils->send_msg("$output", "w", "Genesis files for ppc64/ppc64le are not available");
probe_utils->send_msg("$output", "i", "If don't plan to manage a ppc64/ppc64le server, please ignore above warning");
probe_utils->send_msg("$output", "i", "ignore above warning if not planning on managing ppc64/ppc64le server");
} else {
probe_utils->send_msg("$output", "o", "Genesis files for ppc64/ppc64le are available");
}
@ -978,7 +978,7 @@ sub do_monitor {
$nics = `ip addr |grep -B2 $masteripinsite|awk -F" " '/mtu/{gsub(/:/,"",\$2); print \$2}'`;
chomp($nics);
if (!$nics) {
probe_utils->send_msg("$output", "f", "The value of master in site table is $masteripinsite, can't get corresponding network interface");
probe_utils->send_msg("$output", "f", "The value of 'master' in 'site' table is $masteripinsite, can't get corresponding network interface");
return 1;
}
}
@ -993,7 +993,7 @@ sub do_monitor {
/_/\\_\\\\____/_/ \\_\\_| .+|______|__.-||__)`-'(((/ (((/
-------------------------------------------------------------
";
print "$startline\nStart to capture every message during discovery process......\n";
print "$startline\nStart capturing every message during discovery process......\n";
my $varlogmsg = "/var/log/messages";
my $clusterlog = "/var/log/xcat/cluster.log";
@ -1088,7 +1088,7 @@ sub do_monitor {
if ($terminal) {
probe_utils->send_msg("$output", "d", "Got <Ctrl+c> from STDIN");
} else {
probe_utils->send_msg("$output", "o", "All nodes need to monitor have finished discovery process");
probe_utils->send_msg("$output", "o", "All nodes specified to monitor have finished discovery process");
}
last;
}
@ -1136,7 +1136,7 @@ if ($help) {
}
if ($test) {
probe_utils->send_msg("$output", "o", "Do probe for discovery process, including pre-check for required configuration and realtime monitor of discovery process.Before using this command, please install nslookup command ahead. Currently, this command does not support hierarchy.");
probe_utils->send_msg("$output", "o", "Probe the discovery process, including pre-check for required configuration and realtime monitor of discovery process. Before using this command, please install 'nslookup' command. Currently, this command does not support hierarchy.");
exit 0;
}

View File

@ -148,19 +148,18 @@ $::USAGE = "Usage:
$program_name -n <node_range> -r <xxhxxm> [-V]
Description:
Do probe for os provision process. Realtime monitor or replay history of os provision process.
If do realtime monitor, please run this before rpower node.
Unsupport hierarchial structure now.
Probe for OS provision process. Realtime monitor or replay history of OS provision process.
If realtime monitor, run this before 'rpower' node.
Currently, hierarchial structure is not supported.
Options:
-h : Get usage information of $program_name
-T : To verify if $program_name can work, reserve option for probe framework
-T : Verify if $program_name can work, reserved option for probe framework
-V : Output more information for debug
-n : The range of node to be monitor or replay log.
-t : The maximum time to wait when doing monitor, the unit is minute, default is 60 minutes.
-r : Replay history log to probe provision. need input a start time when probe should begin from.
Support time format are xxhxxm, xxh, or xxm. h means hour, m means minute.
If there isn't unit input, using hour by default.
-n : The range of nodes for monitor or replay log.
-t : The maximum time in minutes to wait when doing monitor, default is 60.
-r : Replay history log for probe provisioniong. Input a start time when probe should begin.
Supported time formats are xxhxxm, xxh, or xxm. If units not specified, hour will be used by default.
";
#------------------------------------------
@ -231,7 +230,7 @@ sub check_noderange {
}else{
$noerror = 0;
$rst = 1;
probe_utils->send_msg("$output", "f", "$node : can't be resolved to a IP address");
probe_utils->send_msg("$output", "f", "$node : can't be resolved to an IP address");
}
}
}
@ -313,7 +312,7 @@ sub handle_dhcp_msg {
push(@{ $rawdata{$node}{statehistory} }, $rawdata{$node}{state}) if (reset_state(\$rawdata{$node}{state}, "dhcp"));
if ($macmap{$mac}{"ip"} != "NOIP" and $macmap{$mac}{"ip"} != $ip) {
my $warn_msg = "The ip($ip) assigned to $mac via DHCP is different with the ip($macmap{$mac}{'ip'}) in node definition.";
my $warn_msg = "The ip($ip) assigned to $mac via DHCP is different from the ip($macmap{$mac}{'ip'}) in node definition.";
probe_utils->send_msg("$output", "w", "$warn_msg") if ($monitor);
push(@{ $rawdata{$node}{"history"} }, $warn_msg);
}
@ -341,7 +340,7 @@ sub handle_dhcp_msg {
push(@{ $rawdata{$node}{statehistory} }, $rawdata{$node}{state}) if (reset_state(\$rawdata{$node}{state}, "dhcp"));
if ($macmap{$mac}{"ip"} != "NOIP" and $macmap{$mac}{"ip"} != $ip) {
my $warn_msg = "The ip($ip) assigned to $mac via DHCP is different with the ip($macmap{$mac}{'ip'}) in node definition.";
my $warn_msg = "The ip($ip) assigned to $mac via DHCP is different from the ip($macmap{$mac}{'ip'}) in node definition.";
probe_utils->send_msg("$output", "w", "$warn_msg") if ($monitor);
push(@{ $rawdata{$node}{"history"} }, $warn_msg);
}
@ -655,7 +654,7 @@ sub dump_history {
} elsif (($valid_process{ $match_result{$max_match}[0] }{type} eq "reboot") && ($valid_process{ $match_result{$max_match}[0] }{process}[ $max_match - 1 ] == $state_set{done})) {
probe_utils->send_msg("$output", "f", "[$node] reboot completed, without deployment process");
} elsif (($valid_process{ $match_result{$max_match}[0] }{type} eq "reboot") && ($valid_process{ $match_result{$max_match}[0] }{process}[ $max_match - 1 ] != $state_set{done})) {
probe_utils->send_msg("$output", "f", "[$node] reboot failed,without deployment process, stop at $state_set_reverse{$valid_process{$match_result{$max_match}[0]}{process}[$max_match-1]} stage, something wrong during $state_set_reverse{$valid_process{$match_result{$max_match}[0]}{process}[$max_match]} stage");
probe_utils->send_msg("$output", "f", "[$node] reboot failed, without deployment process, stop at $state_set_reverse{$valid_process{$match_result{$max_match}[0]}{process}[$max_match-1]} stage, something wrong during $state_set_reverse{$valid_process{$match_result{$max_match}[0]}{process}[$max_match]} stage");
}
}
}
@ -680,7 +679,7 @@ sub do_monitor {
my $rst = 0;
my $startline =
"-------------------------------------------------------------
Start to capture every message during os provision process......
Start capturing every message during OS provision process......
-------------------------------------------------------------
";
@ -717,7 +716,7 @@ Start to capture every message during os provision process......
if (!-e "$clusterlog") {
probe_utils->send_msg("$output", "w", "$clusterlog doesn't exist");
probe_utils->send_msg("$output", "i", "If sles11 or xCAT2.11.x is using, please ignore above warning");
probe_utils->send_msg("$output", "i", "If using SLES11 or xCAT2.11.x, ignore above warning");
} else {
if (!($clusterpid = open(CLUSTERLOGFILE, "tail -f -n 0 $clusterlog 2>&1 |"))) {
probe_utils->send_msg("$output", "f", "Can't open $clusterlog to get logs");
@ -736,7 +735,7 @@ Start to capture every message during os provision process......
}
if (!-e "$computelog") {
probe_utils->send_msg("$output", "w", "$computelog doesn't exist");
probe_utils->send_msg("$output", "i", "If sles11 or xCAT2.11.x is using, please ignore above warning");
probe_utils->send_msg("$output", "i", "If sles11 or xCAT2.11.x, ignore above warning");
} else {
if (!($computerpid = open(COMPUTERFILE, "tail -f -n 0 $computelog 2>&1 |"))) {
probe_utils->send_msg("$output", "f", "Can't open $computelog to get logs");
@ -792,13 +791,13 @@ Start to capture every message during os provision process......
if ($terminal) {
probe_utils->send_msg("$output", "d", "Get INT or TERM signal from STDIN");
} else {
probe_utils->send_msg("$output", "o", "All nodes need to monitor have finished os provision process");
probe_utils->send_msg("$output", "o", "All nodes specified to monitor, have finished OS provision process");
}
last;
}
if (time() - $starttime > ($maxwaittime * 60)) {
probe_utils->send_msg("$output", "i", "$maxwaittime minutes are expired, stop monitor");
probe_utils->send_msg("$output", "i", "$maxwaittime minutes have expired, stop monitoring");
last;
}
sleep 0.01;
@ -959,7 +958,7 @@ sub do_replay {
my $ref_timestamp = shift;
my $timestr = scalar(localtime($ref_timestamp));
print "Start to search logs after '$timestr', please waiting for a while.............\n";
print "Start logs search after '$timestr', waiting for a while.............\n";
my ($sec, $min, $hour, $day, $mon, $year, $wday, $yday, $isdst) = localtime(time());
my $epoch_seconds_of_now = time();
@ -1013,12 +1012,12 @@ if ($help) {
}
if ($test) {
probe_utils->send_msg("$output", "o", "Do probe for os provision process, realtime monitor of os provision process.");
probe_utils->send_msg("$output", "o", "Probe for OS provision process, realtime monitor of OS provision process.");
exit 0;
}
unless ($noderange) {
probe_utils->send_msg("$output", "f", "A noderange is needed");
probe_utils->send_msg("$output", "f", "A noderange is required");
probe_utils->send_msg("$output", "d", "$::USAGE");
exit 1;
}
@ -1032,7 +1031,7 @@ if ($replaylog) {
} elsif ($replaylog =~ /^(\d+)m$/) {
$epoch_starttime -= $1 * 60;
} else {
probe_utils->send_msg("$output", "f", "Unsupport time format for replay history log");
probe_utils->send_msg("$output", "f", "Unsupported time format for history log replay");
print "$::USAGE";
exit 1;
}
@ -1053,7 +1052,7 @@ unless ($installnic) {
$installnic = `ip addr |grep -B2 $masteripinsite|awk -F" " '/mtu/{gsub(/:/,"",\$2); print \$2}'`;
chomp($installnic);
if (!$installnic) {
probe_utils->send_msg("$output", "f", "The value of master in site table is $masteripinsite, can't get corresponding network interface");
probe_utils->send_msg("$output", "f", "The value of 'master' in 'site' table is $masteripinsite, can't get corresponding network interface");
$rst = 1;
} else {
probe_utils->send_msg("$output", "i", "The installation network interface is $installnic");

View File

@ -23,8 +23,8 @@ Description:
Currently, this command does not support hierarchy.
Options:
-c: To check whether the switch is OK to retrieve MAC address mapping.
-V: Output verbose information when accessing switch
-c: Check if the switch is OK to retrieve MAC address mapping.
-V: Output verbose information when accessing the switch
";
my $help;
@ -36,13 +36,13 @@ if (!GetOptions("help|h" => \$help,
"T" => \$test,
"c" => \$check,
"V" => \$verbose)) {
probe_utils->send_msg("$output", "f", "Option not support");
probe_utils->send_msg("$output", "f", "Option not supported");
probe_utils->send_msg("$output", "d", $::USAGE);
exit 1;
}
foreach (@ARGV) {
if (/^-\w*/) {
probe_utils->send_msg("$output", "f", "Option $_ not support");
probe_utils->send_msg("$output", "f", "Option $_ not supported");
exit 1;
} else {
push @nodes, $_;
@ -63,10 +63,10 @@ if (!-e "$currdir/bin/switchprobe") {
if ($test) {
`$currdir/bin/switchprobe -h`;
if ($?) {
probe_utils->send_msg("$output", "f", "No switchprobe tool is available at $currdir/bin/");
probe_utils->send_msg("$output", "f", "No 'switchprobe' tool is available at $currdir/bin/");
exit 1;
} else {
probe_utils->send_msg("$output", "o", "To retrieve MAC address mapping for the specified switch, or all the switches defined in switches table in xCAT db. Currently, this command does not support hierarchy.");
probe_utils->send_msg("$output", "o", "To retrieve MAC address mapping for the specified switch, or all the switches defined in 'switches' table in xCAT db. Currently, this command does not support hierarchy.");
exit 0;
}
}

View File

@ -35,8 +35,8 @@ my @tmpargv;
# below are some options rules used by default
# -h : Get usage information of current sub command
# -V : Output more information for debug
# -T : To verify if $program_name can work, reserve option for probe framework, dosen't use by customer
# -n : In xCAT probe, -n is uesd to specify node range uniformly
# -T : To verify if $program_name can work, reserved option for probe framework, not for use by customer
# -n : In xCAT probe, -n is used to specify node range uniformly
#--------------------------------
$::USAGE = "Usage:
$program_name -h
@ -44,12 +44,12 @@ $::USAGE = "Usage:
Description:
After xcat installation, use this command to check if xcat has been installed correctly and is ready for use.
For hierarchical cluster, just support that the provision network is in the same network with management node. If in the different nework, please ignore the results.
For hierarchical cluster, only the provision network on the same network as the management node is supported. If in the different network, ignore the results.
Options:
-h : Get usage information of $program_name
-V : Output more information for debug
-i : Required. Specify the network interface name of provision network on Management Node
-i : Required. Specify the network interface name of provision network on management node
";
@ -171,9 +171,9 @@ sub do_main_job {
my $masteripinsite = `lsdef -t site -i master -c | awk -F'=' '{print \$2}'`;
chomp($masteripinsite);
probe_utils->send_msg($outputtarget, "d", "The value of 'master' in 'site' table is $masteripinsite") if ($verbose);
probe_utils->send_msg($outputtarget, "f", "There isn't 'master' definition in 'site' talbe") if ($masteripinsite eq "");
probe_utils->send_msg($outputtarget, "f", "There isn't 'master' definition in 'site' table") if ($masteripinsite eq "");
$msg = "The value of 'master' in 'site' table is a IP address";
$msg = "The value of 'master' in 'site' table is an IP address";
if (probe_utils->is_ip_addr("$masteripinsite")) {
probe_utils->send_msg($outputtarget, "o", "$msg");
} else {
@ -188,18 +188,18 @@ sub do_main_job {
my $nics = `ip addr show $installnic >/dev/null 2>&1`;
if ($?) {
probe_utils->send_msg($outputtarget, "f", "$msg");
probe_utils->send_msg($outputtarget, "d", "Please use 'ip addr show' to check if there is NIC named $installnic on current server");
probe_utils->send_msg($outputtarget, "d", "Use 'ip addr show' to check if there is NIC named $installnic on current server");
return 1;
} else {
probe_utils->send_msg($outputtarget, "o", "$msg");
}
$msg = "Get ip address of NIC $installnic";
$msg = "Get IP address of NIC $installnic";
$serverip = `ip addr show $installnic | awk -F" " '/inet / {print \$2}'|awk -F"/" '{print \$1}'`;
chomp($serverip);
if (!defined($serverip) || ($serverip eq "")) {
probe_utils->send_msg($outputtarget, "f", "$msg");
probe_utils->send_msg($outputtarget, "d", "Please use 'ip addr show' to check if there is ip assigned to $installnic");
probe_utils->send_msg($outputtarget, "d", "Use 'ip addr show' to check if there is IP assigned to $installnic");
return 1;
} else {
probe_utils->send_msg($outputtarget, "d", "The IP of NIC $installnic is $serverip") if ($verbose);
@ -220,7 +220,7 @@ sub do_main_job {
if (probe_utils->is_static_ip("$serverip", "$installnic")) {
probe_utils->send_msg($outputtarget, "o", "$msg");
} else {
probe_utils->send_msg($outputtarget, "w", "IP $serverip of $installnic is not a static ip on current server");
probe_utils->send_msg($outputtarget, "w", "IP $serverip of $installnic is not a static IP on current server");
}
} else {
@ -236,7 +236,7 @@ sub do_main_job {
}
}
$msg = "Get ip address that in the same network with master $masteripinsite";
$msg = "Get IP address that on the same network as master $masteripinsite";
if (!defined($serverip) || ($serverip eq "")) {
probe_utils->send_msg($outputtarget, "f", "$msg");
return 1;
@ -280,13 +280,13 @@ sub do_main_job {
$rst = 1;
}
$msg = "There is configuration in 'passwd' table for 'system' for node provision";
$msg = "There is a configuration in 'passwd' table for 'system' for node provisioning";
my $passwd = `tabdump passwd |awk -F',' '/system/ { gsub(/"/, "", \$2); gsub(/"/, "", \$3); print \$2,\$3 }'`;
chomp($passwd);
my ($username, $pw) = split(" ", $passwd);
if ($username eq "" || $pw eq "") {
probe_utils->send_msg($outputtarget, "f", "$msg");
probe_utils->send_msg($outputtarget, "d", "Please define username and password for 'system' in 'passwd' table");
probe_utils->send_msg($outputtarget, "d", "Define username and password for 'system' in 'passwd' table");
$rst = 1;
} else {
probe_utils->send_msg($outputtarget, "o", "$msg");
@ -297,7 +297,7 @@ sub do_main_job {
probe_utils->send_msg($outputtarget, "d", "The 'install' directory is set to $installdir in 'site' table on current server") if ($verbose);
my $tftpdir = `lsdef -t site -i tftpdir -c | awk -F'=' '{print \$2}'`;
chomp($tftpdir);
probe_utils->send_msg($outputtarget, "d", "The 'tftp' directory is set to $tftpdir in 'site' talbe on current server") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "The 'tftp' directory is set to $tftpdir in 'site' table on current server") if ($verbose);
$msg = "There is $installdir directory on current server";
if (-e "$installdir/postscripts/") {
@ -321,7 +321,7 @@ sub do_main_job {
}
}
$msg = "installdir $installdir is mounted on from the Management Node";
$msg = "installdir $installdir is mounted from the management node";
if ($mountip eq $masteripinsite) {
probe_utils->send_msg($outputtarget, "o", "$msg");
}
@ -353,7 +353,7 @@ sub do_main_job {
}
}
$msg = "tftpdir $tftpdir is mounted on from the Management Node";
$msg = "tftpdir $tftpdir is mounted from the management node";
if ($mountip eq $masteripinsite) {
probe_utils->send_msg($outputtarget, "o", "$msg");
}
@ -399,7 +399,7 @@ sub do_main_job {
`which wget > /dev/null 2>&1`;
if ($?) {
probe_utils->send_msg($outputtarget, "w", "'wget' tool isn't installed, skip checking HTTP service. please install wget then try again");
probe_utils->send_msg($outputtarget, "w", "'wget' tool isn't installed, skip checking HTTP service. Install 'wget' then try again");
} else {
$msg = "HTTP service is ready on $serverip";
if (probe_utils->is_http_ready("$serverip")) {
@ -426,7 +426,7 @@ sub do_main_job {
if ($checktftp) {
`which tftp > /dev/null 2>&1`;
if ($?) {
probe_utils->send_msg($outputtarget, "w", "'tftp' tool isn't installed, skip checking tftp service. Please install tftp then try again");
probe_utils->send_msg($outputtarget, "w", "'tftp' tool isn't installed, skip checking tftp service. Install 'tftp' then try again");
} else {
$msg = "TFTP service is ready on $serverip";
if (probe_utils->is_tftp_ready("$serverip")) {
@ -452,7 +452,7 @@ sub do_main_job {
if ($checkdns) {
`which nslookup > /dev/null 2>&1`;
if ($?) {
probe_utils->send_msg($outputtarget, "w", "'nslookup' tool isn't installed, skip checking DNS service. please install nslookup then try again");
probe_utils->send_msg($outputtarget, "w", "'nslookup' tool isn't installed, skip checking DNS service. Install 'nslookup' then try again");
} else {
$msg = "DNS server is ready on $serverip";
probe_utils->send_msg($outputtarget, "d", "Domain used to check DNS is $domain") if ($verbose);
@ -573,12 +573,12 @@ sub do_main_job {
$tmpmac = $1;
if ($tmpmac !~ $snmac) {
returncmdoutput($tmp, $outputtarget) if ($verbose);
probe_utils->send_msg($outputtarget, "d", "DHCP server's reply is wrong") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "DHCP server reply is wrong") if ($verbose);
$rc = 1;
}
} else {
returncmdoutput($tmp, $outputtarget) if ($verbose);
probe_utils->send_msg($outputtarget, "d", "DHCP server's reply is wrong") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "DHCP server reply is wrong") if ($verbose);
$rc = 1;
}
} else {
@ -586,7 +586,7 @@ sub do_main_job {
my $tmp = `chdef xcatmntest groups=all ip=$serverip mac=aa:aa:aa:aa:aa:aa`;
if ($?) {
returncmdoutput($tmp, $outputtarget) if ($verbose);
probe_utils->send_msg($outputtarget, "d", "Simulate a node by chdef failed") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "Node simulation by 'chdef' has failed") if ($verbose);
$rc = 1;
last;
} else {
@ -603,31 +603,31 @@ sub do_main_job {
$tmp = `makedhcp xcatmntest 2>&1`;
if ($?) {
returncmdoutput($tmp, $outputtarget) if ($verbose);
probe_utils->send_msg($outputtarget, "d", "makedhcp xcatmntest failed") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "makedhcp xcatmntest failed") if ($verbose);
$rc = 1;
`rmdef xcatmntest`;
last;
}
probe_utils->send_msg($outputtarget, "d", "To do 'makedhcp -q xcatmntest'") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "To do 'makedhcp -q xcatmntest'") if ($verbose);
$tmp = `makedhcp -q xcatmntest`;
if ($?) {
returncmdoutput($tmp, $outputtarget) if ($verbose);
probe_utils->send_msg($outputtarget, "d", "makedhcp -q xcatmntest failed") if ($verbose);
$rc = 1;
`makedhcp -d xcatmntest && rmdef xcatmntest`;
`makedhcp -d xcatmntest && rmdef xcatmntest`;
last;
}
chomp($tmp);
if ($tmp !~ /xcatmntest: ip-address = $serverip, hardware-address = aa:aa:aa:aa:aa:aa/) {
returncmdoutput($tmp, $outputtarget) if ($verbose);
probe_utils->send_msg($outputtarget, "d", "DHCP server's reply is wrong") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "DHCP server reply is wrong") if ($verbose);
$rc = 1;
`makedhcp -d xcatmntest && rmdef xcatmntest`;
last;
}
probe_utils->send_msg($outputtarget, "d", "Start to clear simulate information for dhcp test") if ($verbose);
probe_utils->send_msg($outputtarget, "d", "Start clearing simulation information for dhcp test") if ($verbose);
$tmp = `makedhcp -d xcatmntest && rmdef xcatmntest`;
returncmdoutput($tmp, $outputtarget) if ($verbose);
@ -637,7 +637,7 @@ sub do_main_job {
}
if ($rc) {
probe_utils->send_msg($outputtarget, "f", "$msg");
probe_utils->send_msg($outputtarget, "d", "please run 'makedhcp -n' if never run it before.");
probe_utils->send_msg($outputtarget, "d", "Run 'makedhcp -n' if it has not been ran before.");
$rst = 1;
} else {
probe_utils->send_msg($outputtarget, "o", "$msg");
@ -750,7 +750,7 @@ sub caclulate_dispatch_cmd {
if ($error =~ /Error: Invalid nodes and\/or groups in noderange: (.+)/) {
probe_utils->send_msg("$output", "f", "There are invaild nodes ($1) in command line attribute node range");
} else {
probe_utils->send_msg("$output", "f", "There is error in command line attribute node range, please using nodels to check");
probe_utils->send_msg("$output", "f", "There is an error in command line attribute node range, use 'nodels' to check");
}
return 1;
} else {
@ -838,7 +838,7 @@ if ($help) {
}
if ($test) {
probe_utils->send_msg("$output", "o", "After xcat installation, use this command to check if xcat has been installed correctly and is ready for use. Before using this command, please install tftp, nslookup and wget commands ahead. The platform supported are redhat, sles and ubuntu.");
probe_utils->send_msg("$output", "o", "After xcat installation, use this command to check if xcat has been installed correctly and is ready for use. Before using this command, install 'tftp', 'nslookup' and 'wget' commands. Supported platforms are RedHat, SLES and Ubuntu.");
exit 0;
}

View File

@ -31,7 +31,7 @@ Options:
-h : get usage information of $program_name
-l : list all valid sub commands
-V : print verbose information of $program_name
-w : show each line completely. by default if one is too long, the long part will be omitted.
-w : show each line completely. By default long lines are truncated.
";
#-----------------------------------
@ -275,7 +275,7 @@ if ($ARGV[0] eq "-l") {
}
if (!defined($pluginname)) {
print "There isn't sub command input from command line, please use '-l' to list all valid subcommand\n";
print "There isn't sub command input from command line, use '-l' to list all valid subcommand\n";
exit 0;
}