/usr/sbin/mmm_control is in mysql-mmm-monitor 2.2.1-1.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
use English qw( PROGRAM_NAME );
use File::Basename;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($INFO);
# Define version
use constant MMM_VERSION => '2.2.1';
# Include parts of the system
use MMM::Common::Config;
use MMM::Common::Socket;
# Maybe we were just asked for our version
if (scalar(@ARGV) && $ARGV[0] eq "--version") {
printf "%s %s\n", basename($PROGRAM_NAME), MMM_VERSION;
exit(0);
}
my $postfix = '';
if (scalar(@ARGV) && $ARGV[0] =~ /^@(.*)/) {
shift(@ARGV);
$postfix = "_$1";
}
# Read configuration
our $config = new MMM::Common::Config::;
$config->read("mmm_mon$postfix");
$config->check('CONTROL');
die "See '$0 help' for usage information" if (scalar(@ARGV) < 1);
my $socket = MMM::Common::Socket::create_sender($config->{monitor}->{ip}, $config->{monitor}->{port}, 10);
unless ($socket && $socket->connected) {
print "ERROR: Can't connect to monitor daemon!\n";
exit(1);
}
print $socket join(' ', @ARGV), "\nquit\n";
my $res = '';
my $line;
$res .= $line while ($line = <$socket>);
print $res, "\n";
exit(0);
|