[MXS-1221] Nagios plugin scripts does not process -S option properly Created: 2017-04-14  Updated: 2020-08-25  Resolved: 2017-04-18

Status: Closed
Project: MariaDB MaxScale
Component/s: Plugin
Affects Version/s: 2.0.5
Fix Version/s: 2.0.6, 2.1.3, 2.2.0

Type: Bug Priority: Major
Reporter: Valerii Kravchuk Assignee: Massimiliano Pinto (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

It seems Nagios scripts (like check_maxscale_monitors.pl) does not process -S option properly (it seems -S is passed to maxadmin without argument):

openxs@ao756:~/maxscale$ ~/git/MaxScale/plugins/nagios/check_maxscale_monitors.pl -H 192.168.1.37 -u openxs -i /home/openxs/.ssh/id_rsa -m /home/openxs/maxscale/bin/maxadmin -S /tmp/maxadmin.sock
Enter passphrase for key '/home/openxs/.ssh/id_rsa':
CRITICAL: Unable to connect to MaxScale at show: No such file or directory

Note that "show" (part of "show monitors" command generated) was passed as a socket, and surely file does not exist.

Without explicit -S (as we still use default socket) everything works as expected:

openxs@ao756:~/maxscale$ ~/git/MaxScale/plugins/nagios/check_maxscale_monitors.pl -H 192.168.1.37 -u openxs -i /home/openxs/.ssh/id_rsa -m /home/openxs/maxscale/bin/maxadmin
Enter passphrase for key '/home/openxs/.ssh/id_rsa':
OK: 1 monitors found | monitor1=MySQL Monitor;running;192.168.1.37:3306;10000;disabled



 Comments   
Comment by Massimiliano Pinto (Inactive) [ 2017-04-18 ]

There is an error in the scripts.

The fix is:

Replace:
$MAXADMIN_SOCKET = ' -S $MAXADMIN_SOCKET';

with

$MAXADMIN_SOCKET = ' -S ' . $MAXADMIN_SOCKET;

Generated at Thu Feb 08 04:05:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.