Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

Can't specify database with pmp-check-mysql-replication-delay #17

@muffl0n

Description

@muffl0n

With pt-heartbeat I am writing entries to the table "heartbeat" in the database "heartbeat" on our master server:

pt-heartbeat -D heartbeat -h mysql-master -u root -pbar --update --create-table

When trying to use pmp-check-mysql-replication-delay on the slave to check the delay I have trouble reading those values:

# /usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay -H mysql-slave -l root -p bar -T heartbeat.heartbeat
/usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay: 71: [: unexpected operator
Warning: Using a password on the command line interface can be insecure.
CRIT 4286 seconds of replication delay | replication_delay=4286;300;600;0;

The value I get is correct, but the error message confuses me.

Snippet from pmp-check-mysql-replication-delay:

     64    # Get replication delay from a heartbeat table or from SHOW SLAVE STATUS.
     65    if [ "${OPT_TABLE}" ]; then
     66       if [ -z "${OPT_UTC}" ]; then
     67          NOW_FUNC='UNIX_TIMESTAMP()'
     68       else
     69          NOW_FUNC='UNIX_TIMESTAMP(UTC_TIMESTAMP)'
     70       fi
     71       if [ "${OPT_SRVID}" == "MASTER" ]; then

Only specifying the table does not work either:

# /usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay -H mysql-slave -l root -p bar -T heartbeat
/usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay: 71: [: unexpected operator
Warning: Using a password on the command line interface can be insecure.
ERROR 1046 (3D000) at line 1: No database selected
UNK could not determine replication delay

I'm using the latest version:

# /usr/lib64/nagios/plugins/pmp-check-mysql-replication-delay --version
Percona Monitoring Plugins pmp-check-mysql-replication-delay 1.1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions