I am trying to poorly work around an issue that is rather interesting, we have one series of old MySQL 5.1 servers which don't communicate using any of the latest plugins (SSL/Socket problems). Due to this, I've come up with a solution, but I am experiencing an execution issue and wondering if anyone has any input.....
I created a docker image on the Ubuntu 20.14LTS ubuntu server. I then authorized the nagios user to access docker. I then created a check_mysql_health setup inside the docker image (using older 6.1 MySQL binaries). The results from the command line work perfectly from inside nagios server as the nagios user (see below):
sudo docker exec -it mysql61 /usr/local/nagios/libexec/check_mysql_health --hostname=10.20.222.40 --port=5029 --username=nagios --password="goodpassword" --database=information_schema --mode uptime --warning 10: --critical 5:
OK - database is up since 35358 minutes | uptime=2121489s
echo $?
0
sudo docker exec -it mysql61 /usr/local/nagios/libexec/check_mysql_health --hostname=10.20.222.40 --port=5029 --username=
nagios --password="badpassword" --database=information_schema --mode uptime --warning 10: --critical 5:
DBI connect('database=information_schema;host=10.20.222.40;port=5029','nagios',...) failed: Access denied for user 'nagios'@'10.0.105.17' (using password: YES) at /usr/local/nagios/libexec/check_mysql_health line 1963.
CRITICAL - cannot connect to information_schema. Access denied for user 'nagios'@'10.0.105.17' (using password: YES)
echo $?
2
So I expected it to work without issue from inside nagios. However, when implemented (exact same command) with Defaults:nagios !requiretty added into /etc/sudoers and then when run actively inside nagios, I get the error:
(No output on stdout) stderr: the input device is not a TTY
Anyone have any ideas how to resolve?
(No output on stdout) stderr: the input device is not a TTY
-
morganmiskell
- Posts: 7
- Joined: Thu May 23, 2019 4:21 pm
-
morganmiskell
- Posts: 7
- Joined: Thu May 23, 2019 4:21 pm
Re: (No output on stdout) stderr: the input device is not a
Wow, sorry for the noise, my docker command should have been docker -t not docker -it.....
Re: (No output on stdout) stderr: the input device is not a
Good catch! Let us know when we're okay to lock this up and mark it as resolve.