summaryrefslogtreecommitdiff
path: root/src/pmdas/mysql/README
blob: 971046cf4a84e5f1e4dcf62948cecf82e712cd6f (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Performance Co-Pilot PMDA for Monitoring MySQL Databases
========================================================

This PMDA exports activity and performance metrics from a MySQL
database server on the local system.

The PMDA collects its data from the SQL commands:
    show variables;
    show global status;
    show processlist;
    show slave status;

Metrics
=======

Once the PMDA has been installed, the following command will list all of
the available metrics:

    + # $ pminfo -f mysql

Database Setup
==============

The PMDA needs access to the mysql database.  If you use the PMDA
as shipped, this implies a MySQL user 'dbmonitor' with password
'dbmonitor' has been created and has access to the mysql database.

Specifically, this means the following has been done:

    + # mysql -uroot -p...
      mysql> create user 'dbmonitor'@'localhost' identified by 'dbmonitor';
      mysql> grant select on mysql.* to 'dbmonitor'@'localhost';
      mysql> grant replication client on *.* to 'dbmonitor'@'localhost';

If this username and password combination does not suit, choose
some other, but you'll have to change these intializations in
pmdamysql.pl:

    my $username = 'dbmonitor';
    my $password = 'dbmonitor';

Installation
============

    + # cd $PCP_PMDAS_DIR/mysql

    + Check that there is no clash in the Performance Metrics Domain
      defined in ./domain.h and the other PMDA's currently in use (see
      $PCP_PMCDCONF_PATH). If there is, edit ./domain.h to choose another
      domain number (This should only be an issue on installations with
      third party PMDA's installed as the domain number given has been
      reserved for the mysql PMDA with base PCP installations).

    + Then simply use

        # ./Install

 	and choose both the “collector” and “monitor” installation
        configuration options.

De-Installation
===============

    + Simply use

        # cd $PCP_PMDAS_DIR/mysql
        #./Remove

Troubleshooting
===============

    + After installing or restarting the agent, the PMCD log file
      ($PCP_LOG_DIR/pmcd/pmcd.log) and the PMDA log file
      ($PCP_LOG_DIR/PMCD/mysql.log) should be checked for any warnings or
      errors.

    + In an event where no values are being returned for most of the 
      metrics check ensure that the username and password in pmdamysql.pl
      match the local MySQL setup.