summaryrefslogtreecommitdiffabout
path: root/src/mysqlstat.h
blob: 1fc724e5a8996157e2b3a4d27bb2b0c5d28910ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* This file is part of Mysqlstat -*- autoconf -*-
 * Copyright (C) 2014-2016 Sergey Poznyakoff
 *
 * Mysqlstat is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * Mysqlstat is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Mysqlstat.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <config.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>

#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>

#define CACHE_TIMEOUT 10

enum {
	MYSQLSTAT_CACHE_REPL,
	MYSQLSTAT_MAX_CACHE
};

typedef struct mysqlstat_connection *mysqlstat_connection_t;

struct repl_stat {
	char *replMasterLogFile;
	uint32_t replReadMasterLogPos;
	char *replRelayLogFile;
	uint32_t replRelayLogPos;
	char *replRelayMasterLogFile;
	int replSlaveIORunning;
	int replSlaveSQLRunning;
	int replLastSQLErrno;
	char *replLastSQLError;
	int replLastIOErrno;
	char *replLastIOError;
	uint32_t replExecMasterLogPos;
	uint64_t replRelayLogSpace;
	uint32_t replSecondsBehindMaster;
};
 
mysqlstat_connection_t mysqlstat_connect(void);
void mysqlstat_disconnect(mysqlstat_connection_t);

char const *mysqlstat_get(int id, char const *name);

Return to:

Send suggestions and report system problems to the System administrator.