Hi
I've installed the Splunk Add-on for MySQL as per the documentation and it is not working. I have tested DB Connect to and from the server and it is working.
I checked the splunkd.log and I get the following python errors:
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" Traceback (most recent call last):
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py", line 232, in <module>
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" main()
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py", line 226, in main
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" run()
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py", line 154, in run
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" meta, stanzas, global_settings = mysql_conf.get_configs()
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql_config.py", line 39, in get_configs
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" self._update_stanza_configs(default_configs)
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql_config.py", line 73, in _update_stanza_configs
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" defaults[c.mysql_data_collection_settings])
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql_common.py", line 24, in get_mysql_variables
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" p = subprocess.Popen(mysql, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/lib/python2.7/subprocess.py", line 710, in __init__
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" errread, errwrite)
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" File "/mnt/splunkstore/splunk/lib/python2.7/subprocess.py", line 1335, in _execute_child
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" raise child_exception
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" OSError: [Errno 2] No such file or directory
Thanks
Brandon
Line 20-24 in mysql_common.py are below:
mysql = ["mysql", "--host={}".format(host), "--port={}".format(port),
"--user={}".format(config[c.username]),
"--password={}".format(config[c.password]),
"-e", "SHOW VARIABLES"]
p = subprocess.Popen(mysql, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Here, it is trying to execute mysql as the SplunkD user. Can you confirm that the SplunkD user has access to mysql? Can you confirm mysql is in the SplunkD user's path? If it's not in the path, you might use which mysql
to find it's path and edit mysql_common.py line 20 as follows mysql = ["/path/to/mysql"....
If the splunkd user can run msyql just by typing mysql
at a prompt, then check the username & password being sent to mysql command:
mysql --host=localhost --port=3306 --user="<YOURmysqlUser>" --password="<mysqlPass>" -e SHOW VARIABLES
No, still no progress.
I'm having the same problem with the same build on CENTOS 6.5
Hi - did you make any progress on this?
what stage of the installation are you at when it produces that error? It looks like it's trying to read a config file and can't find it... that might be spurious if the config hasn't been created yet?
I had completed the installation - as per the documentation steps.
Everything seemed fine however I noticed that no data was being collected when I enabled the inputs.
I tested DB connect 2 and I made a test connection - working.
I downloaded and installed the add-on, ran through the configuration and then looked at the logs.
Forgot to mention:
Running Splunk 6.3.1 (also tested on 6.3) on Centos 7
hi brandon,
what version of dbconnect are using?
latest - 2.0.6