Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed warning on SHOW SLAVE STATUS #809

Merged
merged 1 commit into from
Feb 5, 2014
Merged

Conversation

ive
Copy link

@ive ive commented Jan 28, 2014

Hello,

This PR fixes warning that occurs to us running datadog for monitoring mysql slave. Here is example:

2014-01-28 11:10:16,760 | ERROR | dd.collector | checks.mysql(mysql.py:233) | Error while running SHOW SLAVE STATUS
Traceback (most recent call last):
File "/usr/share/datadog/agent/checks.d/mysql.py", line 226, in _collect_dict
self.gauge(metric, float(result[col_idx]), tags=tags)
TypeError: float() argument must be a string or a number

This is not a big problem - but it's annoying while running "datadog-agent info" command and also garbage collector.log.

@remh
Copy link
Contributor

remh commented Jan 28, 2014

Thanks @ive

Could you log something in debug level when

result[col_idx] is None

?

@ive
Copy link
Author

ive commented Jan 29, 2014

Sure, updated PR

2014-01-29 08:52:29,569 | DEBUG | dd.collector | checks.mysql(mysql.py:91) | Connected to MySQL
2014-01-29 08:52:29,569 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW GLOBAL STATUS LIKE 'Created_tmp_disk_tables'
2014-01-29 08:52:29,570 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 0
2014-01-29 08:52:29,571 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW GLOBAL STATUS LIKE 'Slow_queries'
2014-01-29 08:52:29,572 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 0
2014-01-29 08:52:29,573 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW GLOBAL STATUS LIKE 'Questions'
2014-01-29 08:52:29,574 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 112263
2014-01-29 08:52:29,574 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW GLOBAL STATUS LIKE 'Queries'
2014-01-29 08:52:29,575 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 112264
2014-01-29 08:52:29,576 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Connections'
2014-01-29 08:52:29,577 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 16942
2014-01-29 08:52:29,613 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Max_used_connections'
2014-01-29 08:52:29,614 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 2
2014-01-29 08:52:29,615 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Open_files'
2014-01-29 08:52:29,616 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 21
2014-01-29 08:52:29,616 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Table_locks_waited'
2014-01-29 08:52:29,617 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 0
2014-01-29 08:52:29,618 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Threads_connected'
2014-01-29 08:52:29,619 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 1
2014-01-29 08:52:29,619 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Innodb_data_reads'
2014-01-29 08:52:29,620 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 43
2014-01-29 08:52:29,621 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Innodb_data_writes'
2014-01-29 08:52:29,622 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 3
2014-01-29 08:52:29,622 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Innodb_os_log_fsyncs'
2014-01-29 08:52:29,623 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 3
2014-01-29 08:52:29,624 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Innodb_data_reads'
2014-01-29 08:52:29,625 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 43
2014-01-29 08:52:29,625 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Innodb_page_size'
2014-01-29 08:52:29,626 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 16384
2014-01-29 08:52:29,627 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Innodb_buffer_pool_pages_total'
2014-01-29 08:52:29,628 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 65536
2014-01-29 08:52:29,628 | DEBUG | dd.collector | checks.mysql(mysql.py:174) | Collecting data with SHOW STATUS LIKE 'Innodb_buffer_pool_pages_free'
2014-01-29 08:52:29,629 | DEBUG | dd.collector | checks.mysql(mysql.py:184) | Collecting done, value 65456
2014-01-29 08:52:29,630 | DEBUG | dd.collector | checks.mysql(mysql.py:219) | Recieved value is None for index 32
2014-01-29 08:52:29,631 | DEBUG | dd.collector | checks.mysql(mysql.py:272) | pid file: /var/run/mysqld/mysqld.pid
2014-01-29 08:52:29,632 | DEBUG | dd.collector | checks.mysql(mysql.py:278) | Cannot read mysql pid file /var/run/mysqld/mysqld.pid
2014-01-29 08:52:29,685 | DEBUG | dd.collector | checks.mysql(mysql.py:235) | pid: 1478

@remh
Copy link
Contributor

remh commented Feb 5, 2014

Thanks!

remh added a commit that referenced this pull request Feb 5, 2014
Fixed warning on SHOW SLAVE STATUS
@remh remh merged commit 23a1129 into DataDog:master Feb 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants