Gilles Pion
2018-09-26 08:23:07 UTC
Hello,
I'm referring to this (old) announcement:
Check_MK Werk 0928: runas: new plugin script to include and execute
mrpe, local and plugin scripts as different user
Link: http://lists.mathias-kettner.de/pipermail/checkmk-werks-lvl2/2014-May/000146.html
I've tried to implement it without success.
* Contents of "/etc/check_mk/runas.cfg":
mrpe mysql /home/mysql/mrpe_commands.cfg
* Contents of "/home/mysql/mrpe_commands.cfg"
MYSQL-connection-time /home/mysql/bin/check_mysql_health --username
<user> --password <pass> --socket /path/to/socket.sock --mode
connection-time
Here's what happens when manually running agent in trace/debug (-d) mode:
++ eval 'su mysql -c \'\''/home/mysql/bin/check_mysql_health
--username <user> --password <pass> --socket /path/to/socket.sock
--mode connection-time\'\'''
+++ su mysql -c ''\''/home/mysql/bin/check_mysql_health' --username
<user> --password <pass> --socket /path/to/socket.sock --mode
'connection-time'\'''
su: unrecognized option '--username'
Apparently there is a parsing error and the MRPE plugin switches are
passed to the "su" command instead
I'm referring to this (old) announcement:
Check_MK Werk 0928: runas: new plugin script to include and execute
mrpe, local and plugin scripts as different user
Link: http://lists.mathias-kettner.de/pipermail/checkmk-werks-lvl2/2014-May/000146.html
I've tried to implement it without success.
* Contents of "/etc/check_mk/runas.cfg":
mrpe mysql /home/mysql/mrpe_commands.cfg
* Contents of "/home/mysql/mrpe_commands.cfg"
MYSQL-connection-time /home/mysql/bin/check_mysql_health --username
<user> --password <pass> --socket /path/to/socket.sock --mode
connection-time
Here's what happens when manually running agent in trace/debug (-d) mode:
++ eval 'su mysql -c \'\''/home/mysql/bin/check_mysql_health
--username <user> --password <pass> --socket /path/to/socket.sock
--mode connection-time\'\'''
+++ su mysql -c ''\''/home/mysql/bin/check_mysql_health' --username
<user> --password <pass> --socket /path/to/socket.sock --mode
'connection-time'\'''
su: unrecognized option '--username'
Apparently there is a parsing error and the MRPE plugin switches are
passed to the "su" command instead