MXS-2177 Move check_monitor_permissions() into class
This commit is contained in:
@ -40,12 +40,10 @@ AuroraMonitor* AuroraMonitor::create(const std::string& name, const std::string&
|
||||
return new AuroraMonitor(name, module);
|
||||
}
|
||||
|
||||
bool AuroraMonitor::has_sufficient_permissions() const
|
||||
bool AuroraMonitor::has_sufficient_permissions()
|
||||
{
|
||||
return check_monitor_permissions(m_monitor,
|
||||
"SELECT @@aurora_server_id, server_id FROM "
|
||||
"information_schema.replica_host_status "
|
||||
"WHERE session_id = 'MASTER_SESSION_ID'");
|
||||
return test_permissions("SELECT @@aurora_server_id, server_id FROM "
|
||||
"information_schema.replica_host_status WHERE session_id = 'MASTER_SESSION_ID'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
static AuroraMonitor* create(const std::string& name, const std::string& module);
|
||||
|
||||
protected:
|
||||
bool has_sufficient_permissions() const;
|
||||
bool has_sufficient_permissions();
|
||||
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
|
||||
|
||||
private:
|
||||
|
@ -86,9 +86,9 @@ CsMonitor* CsMonitor::create(const std::string& name, const std::string& module)
|
||||
return new CsMonitor(name, module);
|
||||
}
|
||||
|
||||
bool CsMonitor::has_sufficient_permissions() const
|
||||
bool CsMonitor::has_sufficient_permissions()
|
||||
{
|
||||
return check_monitor_permissions(m_monitor, alive_query);
|
||||
return test_permissions(alive_query);
|
||||
}
|
||||
|
||||
void CsMonitor::update_server_status(MXS_MONITORED_SERVER* srv)
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
static CsMonitor* create(const std::string& name, const std::string& module);
|
||||
|
||||
protected:
|
||||
bool has_sufficient_permissions() const;
|
||||
bool has_sufficient_permissions();
|
||||
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
|
||||
|
||||
private:
|
||||
|
@ -118,9 +118,9 @@ bool GaleraMonitor::configure(const MXS_CONFIG_PARAMETER* params)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GaleraMonitor::has_sufficient_permissions() const
|
||||
bool GaleraMonitor::has_sufficient_permissions()
|
||||
{
|
||||
return check_monitor_permissions(m_monitor, "SHOW STATUS LIKE 'wsrep_local_state'");
|
||||
return test_permissions("SHOW STATUS LIKE 'wsrep_local_state'");
|
||||
}
|
||||
|
||||
void GaleraMonitor::update_server_status(MXS_MONITORED_SERVER* monitored_server)
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
|
||||
protected:
|
||||
bool configure(const MXS_CONFIG_PARAMETER* param);
|
||||
bool has_sufficient_permissions() const;
|
||||
bool has_sufficient_permissions();
|
||||
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
|
||||
void pre_tick();
|
||||
void post_tick();
|
||||
|
@ -40,7 +40,7 @@ GRMon* GRMon::create(const std::string& name, const std::string& module)
|
||||
return new GRMon(name, module);
|
||||
}
|
||||
|
||||
bool GRMon::has_sufficient_permissions() const
|
||||
bool GRMon::has_sufficient_permissions()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
static GRMon* create(const std::string& name, const std::string& module);
|
||||
|
||||
protected:
|
||||
bool has_sufficient_permissions() const;
|
||||
bool has_sufficient_permissions();
|
||||
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
|
||||
|
||||
private:
|
||||
|
@ -69,9 +69,9 @@ bool MMMonitor::configure(const MXS_CONFIG_PARAMETER* params)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MMMonitor::has_sufficient_permissions() const
|
||||
bool MMMonitor::has_sufficient_permissions()
|
||||
{
|
||||
return check_monitor_permissions(m_monitor, "SHOW SLAVE STATUS");
|
||||
return test_permissions("SHOW SLAVE STATUS");
|
||||
}
|
||||
|
||||
void MMMonitor::update_server_status(MXS_MONITORED_SERVER* monitored_server)
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
|
||||
protected:
|
||||
bool configure(const MXS_CONFIG_PARAMETER* params);
|
||||
bool has_sufficient_permissions() const;
|
||||
bool has_sufficient_permissions();
|
||||
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
|
||||
void post_tick();
|
||||
|
||||
|
@ -37,9 +37,9 @@ NDBCMonitor* NDBCMonitor::create(const std::string& name, const std::string& mod
|
||||
return new NDBCMonitor(name, module);
|
||||
}
|
||||
|
||||
bool NDBCMonitor::has_sufficient_permissions() const
|
||||
bool NDBCMonitor::has_sufficient_permissions()
|
||||
{
|
||||
return check_monitor_permissions(m_monitor, "SHOW STATUS LIKE 'Ndb_number_of_ready_data_nodes'");
|
||||
return test_permissions("SHOW STATUS LIKE 'Ndb_number_of_ready_data_nodes'");
|
||||
}
|
||||
|
||||
void NDBCMonitor::update_server_status(MXS_MONITORED_SERVER* monitored_server)
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
static NDBCMonitor* create(const std::string& name, const std::string& module);
|
||||
|
||||
protected:
|
||||
bool has_sufficient_permissions() const;
|
||||
bool has_sufficient_permissions();
|
||||
void update_server_status(MXS_MONITORED_SERVER* monitored_server);
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user