PMDAMYSQL(1)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– PMDAMYSQL πŸ’–

okay bestie, gather round, because we're about to talk about the pmdamysql manual page β€” that's the PMDAMYSQL(1) one, from the General Commands Manual section. it's giving database-girlie, it's giving monitoring royalty, and honestly? we're obsessed. πŸŽ€


✨ NAME ✨

pmdamysql β€” the MySQL and MariaDB database PMDA. that's it, that's the name, short and iconic. πŸ’…


🌸 DESCRIPTION 🌸

so like, pmdamysql is a Performance Co-Pilot PMDA (yes queen, a whole Performance Metrics Domain Agent) and what she does is extract live performance data from a running MySQL or MariaDB database. live. as in happening right now. as in she's watching your DB breathe and reporting back. main character energy fr fr. ✨


πŸ¦‹ INSTALLATION πŸ¦‹

okay so first things first, setup. pmdamysql pulls its config from a file, and she looks for it in this exact order:

  • /etc/pcpdbi.conf
  • $PCP_PMDAS_DIR/mysql/mysql.conf

that file can hold overridden values (and it's Perl code, jsyk) for the settings that get listed at the very start of pmdamysql.pl, namely:

  • database name β€” see DBI(3) for the details, default is "DBI:mysql:mysql"
  • database username β€” default is "dbmonitor"
  • database password β€” default is "dbmonitor"
  • login account β€” default is "pcp"
⚠️ heads up bestie: on some versions of MariaDB (10+) the performance schema is disabled by default, and it must be enabled or the PMDA simply will not function. no cap.

how do you fix it? you add the string "performance_schema" into the "[mysqld]" section of the MariaDB configuration file β€” that's either my.cnf or my.ini, pick your fighter. 🫢

and if you wanna check whether the performance schema is even supported, the "SHOW ENGINES" SQL statement will show you. slay.


once all that initial setup is done, you can go get the names and values for the mysql performance metrics by doing the following as root:

# cd $PCP_PMDAS_DIR/mysql
# ./Install

and to uninstall, this has to be done as root too:

# cd $PCP_PMDAS_DIR/mysql
# ./Remove

pmdamysql gets launched by pmcd(1) β€” she is never supposed to be executed directly, okay? don't do it. the Install and Remove scripts are the ones that notify pmcd(1) when the agent is installed or removed. they handle the gossip, you just vibe. πŸ’–


πŸ”₯ Binary Status values in text πŸ”₯

some of the status values come in the form of YES/NO or ON/OFF. cute, right? exceptβ€”

😭 they cannot be interpreted by tools like pmie(1). tragedy.

so they've been duplicated with a _num extension, and the values are 1 (for YES/ON) or 0 (for NO/OFF). periodt.

eg:

  • mysql.slave_status.slave_io_running
  • mysql.slave_status.slave_io_running_num

see how they match? iconic behaviour honestly. πŸ‘‘


πŸŽ€ FILES πŸŽ€

here's the whole cast, no one gets left out:

  • /etc/pcpdbi.conf β€” the configuration file for all PCP database monitors
  • $PCP_PMDAS_DIR/mysql/mysql.conf β€” the configuration file for pmdamysql
  • $PCP_PMDAS_DIR/mysql/Install β€” the installation script for the pmdamysql agent
  • $PCP_PMDAS_DIR/mysql/Remove β€” the undo installation script for the pmdamysql agent
  • $PCP_LOG_DIR/pmcd/mysql.log β€” the default log file for error messages from pmdamysql

🌈 PCP ENVIRONMENT 🌈

environment variables with the prefix PCP_ are used to parameterize the file and directory names that PCP uses. on each installation, the file /etc/pcp.conf contains the local values for these variables. and the $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). iykyk. πŸ’œ


⭐ SEE ALSO ⭐

go read these too, bestie, they're all part of the lore:

PCPIntro(1), pmcd(1), pmdadbping(1), pmie(1) and DBI(3).


and that's the whole page! πŸ’– this was brought to you by Performance Co-Pilot β€” that's the PCP release, version of PMDAMYSQL(1) β€” so mwah, stay monitored, stay hydrated, and don't run the agent directly. bye bestie! πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from