-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
122 lines (86 loc) · 3.36 KB
/
README
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# mysql.rb
# Facts related to MySQL status
#
# Author: Frederic -lefred- Descamps
# http://www.lefred.be/
# license: GPLv2
# this code is hosted on github : https://github.com/lefred/facter-mysql
# mysql.rb should be installed in your facter directory, for example on a fedora 14 it is
# in /usr/lib/ruby/site_ruby/1.8/facter
This facter allows you to retrieve information from MySQL.
For the moment the version (mysql_version), all the returned values
of SHOW STATUS are available as a fact (prefixed with mysql_), so
"open_files" becomes "mysql_open_files" and
the returned values of SHOW SLAVE STATUS prefixec with mysql_replica_
The goal of this facter was to be able to use it within mcollective.
INFO: the username and password used to connect to the mysql server
should be present in the [client] version of the my.cnf
example:
[client]
username=lefred
password=mysqlisgreat
Some examples:
=============
with facter:
------------
[root@delvaux facter]# facter mysql_version 2>/dev/null
5.5.10
[root@delvaux facter]# facter mysql_max_used_connections 2>/dev/null
3
with mcollective:
-----------------
[root@delvaux facter]# mc-facts mysql_version
Report for fact: mysql_version
5.0.51a-24+lenny5-log found 1 times
5.5.10 found 1 times
Finished processing 2 / 2 hosts in 64.36 ms
[root@delvaux facter]# mc-facts mysql_open_files
Report for fact: mysql_open_files
16 found 1 times
18 found 1 times
Finished processing 2 / 2 hosts in 2418.13 ms
[root@delvaux facter]# mc-facts mysql_open_files -v
Determining the amount of hosts matching filter for 2 seconds .... 2
Report for fact: mysql_open_files
16 found 1 times
delvaux.maladree.be
18 found 1 times
debian1.maladree.be
---- rpc stats ----
Nodes: 2 / 2
Pass / Fail: 0 / 0
Start Time: Sat Apr 02 00:11:46 +0200 2011
Discovery Time: 2001.84ms
Agent Time: 1344.24ms
Total Time: 3346.08ms
[root@delvaux facter]# mc-facts mysql_threads_connected
Report for fact: mysql_threads_connected
2 found 2 times
Finished processing 2 / 2 hosts in 3270.86 ms
[root@delvaux facter]# mc-facts mysql_threads_connected -v
Determining the amount of hosts matching filter for 2 seconds .... 2
Report for fact: mysql_threads_connected
2 found 2 times
debian1.maladree.be
delvaux.maladree.be
---- rpc stats ----
Nodes: 2 / 2
Pass / Fail: 0 / 0
Start Time: Sat Apr 02 00:12:47 +0200 2011
Discovery Time: 2001.73ms
Agent Time: 50.43ms
Total Time: 2052.15ms
[root@delvaux facter]# mc-facts mysql_replica_slave_sql_running -v
Determining the amount of hosts matching filter for 2 seconds .... 3
Report for fact: mysql_replica_slave_sql_running
Yes found 2 times
debian1
debian2
---- rpc stats ----
Nodes: 3 / 3
Pass / Fail: 0 / 0
Start Time: Sat Apr 02 23:22:31 +0200 2011
Discovery Time: 2005.77ms
Agent Time: 51.02ms
Total Time: 2056.79ms