path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files # ######################################################################## # A wrapper around pidof, which might not exist. The first argument is the # command name to match. # ######################################################################## path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files # ######################################################################## _pidof() { if ! pidof "${1}" 2>/dev/null; then ps axo pid,ucomm | awk -v comm="${1}" '$2 == comm { print $1 }' fi path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files # TODO: We could auto-check every running instance, not just one. local NOTE="OK no deleted files" local PROC_ID=$(_pidof mysqld | head -n1) if [ "${PROC_ID}" ]; then local TEMP=$(mktemp -t "${0##*/}.XXXXXX") || exit $? path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-deleted-files # command name to match. # ######################################################################## _pidof() { if ! pidof "${1}" 2>/dev/null; then ps axo pid,ucomm | awk -v comm="${1}" '$2 == comm { print $1 }' path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs else # Find all MySQL server instances. for pid in $(_pidof mysqld); do ps -p ${pid} -o pid,command | grep "${pid}" >> "${TEMP}" done path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs # ######################################################################## _pidof() { if ! pidof "${1}" 2>/dev/null; then ps axo pid,ucomm | awk -v comm="${1}" '$2 == comm { print $1 }' fi path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs # ######################################################################## # A wrapper around pidof, which might not exist. The first argument is the # command name to match. # ######################################################################## path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-file-privs # command name to match. # ######################################################################## _pidof() { if ! pidof "${1}" 2>/dev/null; then ps axo pid,ucomm | awk -v comm="${1}" '$2 == comm { print $1 }' path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile else # Find all MySQL server instances. for pid in $(_pidof mysqld); do ps -p ${pid} -o pid,command | grep "${pid}" >> "${TEMP}" done path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile # command name to match. # ######################################################################## _pidof() { if ! pidof "${1}" 2>/dev/null; then ps axo pid,ucomm | awk -v comm="${1}" '$2 == comm { print $1 }' path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile # ######################################################################## _pidof() { if ! pidof "${1}" 2>/dev/null; then ps axo pid,ucomm | awk -v comm="${1}" '$2 == comm { print $1 }' fi path: nagios-plugins-contrib_48.20250420/percona-nagios-plugins/nagios/bin/pmp-check-mysql-pidfile # ######################################################################## # A wrapper around pidof, which might not exist. The first argument is the # command name to match. # ########################################################################