/* $Id: //depot/tools/main/performance/perfstat_cluster/src/perfstat.hpp#43 $ */ #ifndef PERFSTAT_H #define PERFSTAT_H #include #include #include #ifdef WIN32 #include #else #include #include #endif #ifndef HAVE_NULLPTR #if defined(_WIN64) # define nullptr 0LL #elif defined(__GNUC__) # define nullptr __null #else # define nullptr 0L #endif #endif using namespace std; /** main header class */ class threadHandler; const int cmdRunTime = 120; // 2mins class perfstat { // Adding to make it singleton perfstat(){}; ~perfstat(){}; perfstat(const perfstat&); // Singleton Instance static perfstat* perfInstance; class fatalPerfstat; presetHandler presetHandle; CLIHandler* cliHandle; outputHandler* commonOutputHandle; connectionHandler* connectionHandle; bool connectionStatus; //Multi Cluster support vector clusterConnectionHandle; vector clusterConnectionStatus; vector nodeIPaddress; vector nodePrompts; int numOfNodesInCluster; threadHandler *threadHandle; map legacyFlags; string getMetroClusterInfo(int clusterIndex); vector requestClusterInfo(); vector parseNodeIPs(string); void setupSSHKeys(vector *); bool setupSSHKeyOnFiler(string, string, string, int i=0); void generateSSHKeys(vector *); string maskPassword(); string setupSystemShell(string); void loginNGShell(string, string); void cleanupSSHKeys(); void getAllFilesFromFilers(vector); string readPublicKey(); //int setDefaultTTY(); int suppress_echo(); int make_echo(); char* tty_path(); bool isSystemShellLocked(string nodeIP); public: static perfstat* getPerfInstance(); void runPerfstat(int, char**); int getNumOfNodesInCluster(); static bool signalStatus(); static int getSigCount(); static void setNodeEntered(bool bEntered); // Clean the system shell logout void cleanLogoutSystemShell(); bool askForLegacyMode(const string& nodeIP); bool isRunInLegacyMode(string ip); bool checkOpenSSHKey(string nodeIP, bool bPlink = false); bool checkRSH(const string& node); void checkCreds(const string& ip); bool checkFSAndHigher(string); static string convert_EPOCH_to_gmtime(time_t); void erase_clusterConnectionHandle(int); void closeConnections(vector conns, CLIHandler* cliHandle); void closeConnections(connectionHandler* conn); }; #endif