def get_database_size(self, request): sql_stmt = "SELECT datname, pg_database_size(datname) FROM pg_database;" stat, sub_stats = self._multi_value_stats(request, sql_stmt) # to MB value = nagios.BtoMB(stat) for k, v in sub_stats.iteritems(): sub_stats[k] = nagios.BtoMB(v) return self.get_result(request, value, 'total dbsize: %sMB' % value, 'total', UOM='MB', sub_perfs=sub_stats.iteritems())
def get_memory_used(self, request): value = nagios.BtoMB(self.get_status_value("used_memory", request)) return self.get_result(request, value, "%sMB used_memory" % value, 'used_memory', UOM="MB")