|
|
07f095 |
diff -uNr a/sap_redhat_cluster_connector-6353d27/sap_redhat_cluster_connector b/sap_redhat_cluster_connector-6353d27/sap_redhat_cluster_connector
|
|
|
07f095 |
--- a/sap_redhat_cluster_connector-6353d27/sap_redhat_cluster_connector 2018-01-23 10:15:48.167424070 +0100
|
|
|
07f095 |
+++ b/sap_redhat_cluster_connector-6353d27/sap_redhat_cluster_connector 2018-01-22 10:19:06.001422855 +0100
|
|
|
07f095 |
@@ -41,6 +41,11 @@
|
|
|
07f095 |
my $logident = "sap_redhat_cluster_connector";
|
|
|
07f095 |
my $logoptions = "pid";
|
|
|
07f095 |
my $logfacility = "LOG_USER";
|
|
|
07f095 |
+my $protocolVersion=1;
|
|
|
07f095 |
+my $haProd="RHEL HA add-on";
|
|
|
07f095 |
+my $haProdSAP="sap_redhat_cluster_connector";
|
|
|
07f095 |
+my $haProdDoc="https://access.redhat.com/solutions/963123";
|
|
|
07f095 |
+
|
|
|
07f095 |
#
|
|
|
07f095 |
# open syslog
|
|
|
07f095 |
#
|
|
|
07f095 |
@@ -54,9 +59,10 @@
|
|
|
07f095 |
where cmd could be:
|
|
|
07f095 |
help
|
|
|
07f095 |
init
|
|
|
07f095 |
- cpa --res RES --act ACT
|
|
|
07f095 |
- lsr --out FILE --sid SID --ino INO | --dbhost HOST --dbtype TYPE
|
|
|
07f095 |
+ gvi --out FILE
|
|
|
07f095 |
+ cpa --res RES --act ACT
|
|
|
07f095 |
fra --res RES --act ACT [ --nod NODE ]
|
|
|
07f095 |
+ lsr --out FILE --sid SID --ino INO | --dbhost HOST --dbtype TYPE
|
|
|
07f095 |
lsn --out FILE --res RES
|
|
|
07f095 |
";
|
|
|
07f095 |
}
|
|
|
07f095 |
@@ -110,7 +116,7 @@
|
|
|
07f095 |
|
|
|
07f095 |
sub fire_resource_action {
|
|
|
07f095 |
my ($rsc, $act, $nod) = ("", "", "");
|
|
|
07f095 |
- ($rsc, $act, $nod) = @_;
|
|
|
07f095 |
+ my ($rsc, $act, $nod) = @_;
|
|
|
07f095 |
my $rc=0;
|
|
|
07f095 |
my $sysconfig = "/etc/sysconfig/sap_redhat_cluster_connector";
|
|
|
07f095 |
$nowstring = localtime;
|
|
|
07f095 |
@@ -349,10 +355,6 @@
|
|
|
07f095 |
printf "%s : lsn()\n", $nowstring;
|
|
|
07f095 |
# TODO: check implemented action
|
|
|
07f095 |
###############################################################################################
|
|
|
07f095 |
- ###############################################################################################
|
|
|
07f095 |
- ###############################################################################################
|
|
|
07f095 |
- ###############################################################################################
|
|
|
07f095 |
- ###############################################################################################
|
|
|
07f095 |
#
|
|
|
07f095 |
# 1. GET HOSTNAME WHERE FUNCTION WAS CALLED
|
|
|
07f095 |
#
|
|
|
07f095 |
@@ -452,6 +454,26 @@
|
|
|
07f095 |
return $rc;
|
|
|
07f095 |
}
|
|
|
07f095 |
|
|
|
07f095 |
+sub get_version_info($)
|
|
|
07f095 |
+{
|
|
|
07f095 |
+ my ($outfile, $resource) = @_;
|
|
|
07f095 |
+ my $rc=0;
|
|
|
07f095 |
+ $nowstring = localtime;
|
|
|
07f095 |
+ printf "%s : gvi()\n", $nowstring;
|
|
|
07f095 |
+ if ( $outfile ne "" ) {
|
|
|
07f095 |
+ #HASCRIPTCO-VERS
|
|
|
07f095 |
+ ##HAPROD
|
|
|
07f095 |
+ ##HAPROD-SAP
|
|
|
07f095 |
+ ##HAPROD-DOC
|
|
|
07f095 |
+ open OUTFILE, ">$outfile";
|
|
|
07f095 |
+ syslog("LOG_INFO", "gvi result: %s\n%s\n%s\n%s\n", $protocolVersion, $haProd, $haProdSAP, $haProdDoc);
|
|
|
07f095 |
+ printf OUTFILE "%s\n%s\n%s\n%s\n", $protocolVersion, $haProd, $haProdSAP, $haProdDoc;
|
|
|
07f095 |
+ close OUTFILE;
|
|
|
07f095 |
+ } else {
|
|
|
07f095 |
+ printf "%s\n%s\n%s\n%s\n", $protocolVersion, $haProd, $haProdSAP, $haProdDoc;
|
|
|
07f095 |
+ }
|
|
|
07f095 |
+ return $rc;
|
|
|
07f095 |
+}
|
|
|
07f095 |
|
|
|
07f095 |
#
|
|
|
07f095 |
# "main"
|
|
|
07f095 |
@@ -492,7 +514,6 @@
|
|
|
07f095 |
syslog("LOG_INFO", "lsr call (out=%s,sid=%s,ino=%s)", $out, $sid, $ino);
|
|
|
07f095 |
$return_code=list_sap_resources($out, $sid, $ino);
|
|
|
07f095 |
|
|
|
07f095 |
-
|
|
|
07f095 |
} elsif ( $cmd eq "fra" ) {
|
|
|
07f095 |
open($DEBUG, ">>$logident" . ".log");
|
|
|
07f095 |
*STDOUT=*$DEBUG;
|
|
|
07f095 |
@@ -518,6 +539,14 @@
|
|
|
07f095 |
syslog("LOG_INFO", "lsn call (out=%s,res=%s)", $out, $res);
|
|
|
07f095 |
$return_code=list_sap_nodes($out, $res);
|
|
|
07f095 |
|
|
|
07f095 |
+ } elsif ( $cmd eq "gvi" ) {
|
|
|
07f095 |
+ open($DEBUG, ">>$logident" . ".log");
|
|
|
07f095 |
+ *STDOUT=*$DEBUG;
|
|
|
07f095 |
+ $result = GetOptions ("out=s" => \$out,
|
|
|
07f095 |
+ ) &&
|
|
|
07f095 |
+ checkavail(($out)) || paramproblem();
|
|
|
07f095 |
+ syslog("LOG_INFO", "gvi call (out=%s)", $out);
|
|
|
07f095 |
+ $return_code=get_version_info($out);
|
|
|
07f095 |
|
|
|
07f095 |
} else {
|
|
|
07f095 |
open($DEBUG, ">>$logident" . ".log");
|
|
|
07f095 |
@@ -530,7 +559,6 @@
|
|
|
07f095 |
paramproblem()
|
|
|
07f095 |
}
|
|
|
07f095 |
|
|
|
07f095 |
- syslog("LOG_INFO", "TEST END");
|
|
|
07f095 |
closelog();
|
|
|
07f095 |
exit $return_code;
|
|
|
07f095 |
#
|