You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-520
This commit is contained in:
@ -621,15 +621,17 @@ void ALARMManager::getActiveAlarm(AlarmList& alarmList) const
|
||||
*****************************************************************************************/
|
||||
void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
||||
{
|
||||
string alarmFile = "/tmp/alarms";
|
||||
|
||||
string alarmFile = startup::StartUp::tmpDir() + "/alarms";
|
||||
|
||||
//make 1 alarm log file made up of archive and current alarm.log
|
||||
(void)system("touch /tmp/alarms");
|
||||
|
||||
string cmd = ("ls " + ALARM_ARCHIVE_FILE + " | grep 'alarm.log' > /tmp/alarmlogfiles");
|
||||
string cmd = "touch " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
string fileName = "/tmp/alarmlogfiles";
|
||||
cmd = "ls " + ALARM_ARCHIVE_FILE + " | grep 'alarm.log' > " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
string fileName = startup::StartUp::tmpDir() + "/alarmlogfiles";
|
||||
|
||||
ifstream oldFile (fileName.c_str());
|
||||
|
||||
@ -641,7 +643,7 @@ void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
||||
while (oldFile.getline(line, 200))
|
||||
{
|
||||
buf = line;
|
||||
string cmd = "cat " + ALARM_ARCHIVE_FILE + "/" + buf + " >> /tmp/alarms";
|
||||
string cmd = "cat " + ALARM_ARCHIVE_FILE + "/" + buf + " >> " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
}
|
||||
|
||||
@ -649,7 +651,7 @@ void ALARMManager::getAlarm(std::string date, AlarmList& alarmList) const
|
||||
unlink (fileName.c_str());
|
||||
}
|
||||
|
||||
cmd = "cat " + ALARM_FILE + " >> /tmp/alarms";
|
||||
cmd = "cat " + ALARM_FILE + " >> " + alarmFile;
|
||||
(void)system(cmd.c_str());
|
||||
|
||||
int fd = open(alarmFile.c_str(), O_RDONLY);
|
||||
|
@ -14,7 +14,10 @@ else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
rm -f /tmp/${MODULE}_bulklogReport.txt
|
||||
#get temp directory
|
||||
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
rm -f ${tmpDir}/${MODULE}_bulklogReport.txt
|
||||
|
||||
{
|
||||
|
||||
@ -27,6 +30,6 @@ if test -d $INSTALLDIR/data/bulk ; then
|
||||
egrep '(ERR|CRIT)' $INSTALLDIR/data/bulk/log/*.err 2>/dev/null
|
||||
fi
|
||||
|
||||
} > /tmp/${MODULE}_bulklogReport.txt
|
||||
} > ${tmpDir}/${MODULE}_bulklogReport.txt
|
||||
|
||||
exit 0
|
||||
|
@ -57,6 +57,7 @@ ChildModule childmodule;
|
||||
string rootPassword = "";
|
||||
string debug_flag = "0";
|
||||
string mysqlpw = " ";
|
||||
string tmpDir;
|
||||
|
||||
int runningThreads = 0;
|
||||
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
|
||||
@ -139,11 +140,11 @@ void childReportThread(threadInfo_t& st)
|
||||
cout << "Error with running remote_command.sh, exiting..." << endl;
|
||||
}
|
||||
|
||||
cmd = installDir + "/bin/remote_scp_get.sh " + remoteModuleIP + " " + rootPassword + " /tmp/" + outputFile + " > /dev/null 2>&1";
|
||||
cmd = installDir + "/bin/remote_scp_get.sh " + remoteModuleIP + " " + rootPassword + " " + tmpDir + "/" + outputFile + " > /dev/null 2>&1";
|
||||
rtnCode = system(cmd.c_str());
|
||||
|
||||
if (WEXITSTATUS(rtnCode) != 0)
|
||||
cout << "ERROR: failed to retrieve /tmp/" << outputFile << " from " + remoteHostName << endl;
|
||||
cout << "ERROR: failed to retrieve " << tmpDir << "/" << outputFile << " from " + remoteHostName << endl;
|
||||
|
||||
pthread_mutex_lock( &mutex1 );
|
||||
runningThreads--;
|
||||
@ -198,7 +199,7 @@ void reportThread(string reporttype)
|
||||
string cmd = installDir + "/bin/logReport.sh " + localModule + " " + installDir;
|
||||
system(cmd.c_str());
|
||||
|
||||
cmd = "mv -f /tmp/" + localModule + "_logReport.tar.gz .";
|
||||
cmd = "mv -f " + tmpDir + "/" + localModule + "_logReport.tar.gz .";
|
||||
system(cmd.c_str());
|
||||
|
||||
cmd = "tar -zcf " + localModule + "_mysqllogReport.tar.gz " + installDir + "/mysql/db/*.err* 2>/dev/null";
|
||||
@ -234,7 +235,7 @@ void reportThread(string reporttype)
|
||||
|
||||
cmd = installDir + "/bin/" + reportType + "Report.sh " + localModule + " " + installDir;
|
||||
system(cmd.c_str());
|
||||
cmd = " mv -f /tmp/" + localModule + "_" + reportType + "Report.txt .";
|
||||
cmd = " mv -f " + tmpDir + "/" + localModule + "_" + reportType + "Report.txt .";
|
||||
system(cmd.c_str());
|
||||
|
||||
if (reportType == "config" )
|
||||
@ -431,6 +432,8 @@ int main(int argc, char* argv[])
|
||||
cout << "ERROR: Problem accessing Columnstore configuration file" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
tmpDir = startup::StartUp::tmpDir();
|
||||
|
||||
for ( int i = 1; i < argc; i++ )
|
||||
{
|
||||
@ -842,14 +845,15 @@ int main(int argc, char* argv[])
|
||||
else
|
||||
{
|
||||
// check if mysql is supported and get info
|
||||
string logFile = tmpDir + "/idbmysql.log";
|
||||
string columnstoreMysql = installDir + "/mysql/bin/mysql --defaults-extra-file=" + installDir + "/mysql/my.cnf -u root ";
|
||||
string cmd = columnstoreMysql + " -e 'status' > /tmp/idbmysql.log 2>&1";
|
||||
string cmd = columnstoreMysql + " -e 'status' > " + logFile + " 2>&1";
|
||||
system(cmd.c_str());
|
||||
|
||||
//check for mysql password set
|
||||
string pwprompt = " ";
|
||||
|
||||
if (oam.checkLogStatus("/tmp/idbmysql.log", "ERROR 1045") )
|
||||
if (oam.checkLogStatus(logFile, "ERROR 1045") )
|
||||
{
|
||||
cout << "NOTE: MariaDB Columnstore root user password is set" << endl;
|
||||
|
||||
@ -903,10 +907,10 @@ int main(int argc, char* argv[])
|
||||
//check for mysql password set
|
||||
pwprompt = "--password=" + mysqlpw;
|
||||
|
||||
string cmd = columnstoreMysql + pwprompt + " -e 'status' > /tmp/idbmysql.log 2>&1";
|
||||
string cmd = columnstoreMysql + pwprompt + " -e 'status' > " + logFile + " 2>&1";
|
||||
system(cmd.c_str());
|
||||
|
||||
if (oam.checkLogStatus("/tmp/idbmysql.log", "ERROR 1045") )
|
||||
if (oam.checkLogStatus(logFile, "ERROR 1045") )
|
||||
{
|
||||
cout << "FAILED: Failed login using MariaDB Columnstore root user password '" << mysqlpw << "'" << endl;
|
||||
FAILED = true;
|
||||
@ -1048,7 +1052,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
cout << "Get hadoop report data" << endl;
|
||||
string cmd = installDir + "/bin/hadoopReport.sh " + localModule + " " + installDir + "\n";
|
||||
cmd += " mv -f /tmp/hadoopReport.txt .";
|
||||
cmd += " mv -f " + tmpDir + "/hadoopReport.txt .";
|
||||
FILE* pipe = popen(cmd.c_str(), "r");
|
||||
|
||||
if (!pipe)
|
||||
|
@ -14,7 +14,10 @@ else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
rm -f /tmp/${MODULE}_configReport.txt
|
||||
#get temp directory
|
||||
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
rm -f ${tmpDir}/${MODULE}_configReport.txt
|
||||
|
||||
{
|
||||
echo " "
|
||||
@ -79,6 +82,6 @@ echo "################# top -b -n 1 #################"
|
||||
echo " "
|
||||
top -b -n 1
|
||||
|
||||
} > /tmp/${MODULE}_configReport.txt
|
||||
} > ${tmpDir}/${MODULE}_configReport.txt
|
||||
|
||||
exit 0
|
||||
|
@ -13,7 +13,10 @@ else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
rm -f /tmp/hdfsReport.txt
|
||||
#get temp directory
|
||||
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
rm -f ${tmpDir}/hdfsReport.txt
|
||||
|
||||
{
|
||||
echo
|
||||
@ -58,6 +61,6 @@ echo
|
||||
echo "################# hdfs fsck $INSTALLDIR #################"
|
||||
echo
|
||||
hadoop fsck $INSTALLDIR 2>/dev/null
|
||||
} > /tmp/hadoopReport.txt
|
||||
} > ${tmpDir}/hadoopReport.txt
|
||||
|
||||
exit 0
|
||||
|
@ -14,7 +14,10 @@ else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
rm -f /tmp/${MODULE}_hardwareReport.txt
|
||||
#get temp directory
|
||||
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
rm -f ${tmpDir}/${MODULE}_hardwareReport.txt
|
||||
|
||||
{
|
||||
echo " "
|
||||
@ -76,6 +79,6 @@ echo "################# ifconfig -a #################"
|
||||
echo " "
|
||||
ifconfig -a 2>/dev/null
|
||||
|
||||
} > /tmp/${MODULE}_hardwareReport.txt
|
||||
} > ${tmpDir}/${MODULE}_hardwareReport.txt
|
||||
|
||||
exit 0
|
||||
|
@ -14,8 +14,11 @@ else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
rm -f /tmp/${MODULE}_logReport.tar.gz
|
||||
#get temp directory
|
||||
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
tar -zcf /tmp/${MODULE}_logReport.tar.gz /var/log/mariadb/columnstore > /dev/null 2>&1
|
||||
rm -f ${tmpDir}/${MODULE}_logReport.tar.gz
|
||||
|
||||
tar -zcf ${tmpDir}/${MODULE}_logReport.tar.gz /var/log/mariadb/columnstore > /dev/null 2>&1
|
||||
|
||||
exit 0
|
||||
|
@ -14,7 +14,10 @@ else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
rm -f /tmp/${MODULE}_resourceReport.txt
|
||||
#get temp directory
|
||||
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
rm -f ${tmpDir}/${MODULE}_resourceReport.txt
|
||||
|
||||
{
|
||||
echo " "
|
||||
@ -63,6 +66,6 @@ echo "################# bin/editem -i #################"
|
||||
echo " "
|
||||
$INSTALLDIR/bin/editem -i 2>/dev/null
|
||||
|
||||
} > /tmp/${MODULE}_resourceReport.txt
|
||||
} > ${tmpDir}/${MODULE}_resourceReport.txt
|
||||
|
||||
exit 0
|
||||
|
@ -14,7 +14,10 @@ else
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
fi
|
||||
|
||||
rm -f /tmp/${MODULE}_softwareReport.txt
|
||||
#get temp directory
|
||||
tmpDir=`$INSTALLDIR/bin/getConfig SystemConfig SystemTempFileDir`
|
||||
|
||||
rm -f ${tmpDir}/${MODULE}_softwareReport.txt
|
||||
|
||||
{
|
||||
echo " "
|
||||
@ -35,6 +38,6 @@ echo "################# mcsadmin getStorageConfig #################"
|
||||
echo " "
|
||||
$INSTALLDIR/bin/mcsadmin getStorageConfig
|
||||
|
||||
} > /tmp/${MODULE}_softwareReport.txt
|
||||
} > ${tmpDir}/${MODULE}_softwareReport.txt
|
||||
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user