From dd4b70dce3e2833f3b39a5ba1ec3a7052bee6127 Mon Sep 17 00:00:00 2001 From: ssbunyk Date: Tue, 15 Oct 2013 11:51:55 +0300 Subject: [PATCH] fix objects.xml --- ZenPacks/zenoss/MySqlMonitor/dsplugins.py | 16 - .../zenoss/MySqlMonitor/objects/objects.xml | 769 +++++++++--------- ZenPacks/zenoss/MySqlMonitor/objects_gen.py | 23 +- 3 files changed, 372 insertions(+), 436 deletions(-) diff --git a/ZenPacks/zenoss/MySqlMonitor/dsplugins.py b/ZenPacks/zenoss/MySqlMonitor/dsplugins.py index e27e775..a329c74 100644 --- a/ZenPacks/zenoss/MySqlMonitor/dsplugins.py +++ b/ZenPacks/zenoss/MySqlMonitor/dsplugins.py @@ -8,22 +8,6 @@ from ZenPacks.zenoss.MySqlMonitor.utils import parse_mysql_connection_string -class RandomPlugin(PythonDataSourcePlugin): - @defer.inlineCallbacks - def collect(self, config): - print '*' * 200 - for ds in config.datasources: - yield - - def onSuccess(self, result, config): - return { - 'events': [], - 'values': { - 'localhost.localdomain': { - 'random': (2, time.time()), - }, - }, - } class MySqlMonitorPlugin(PythonDataSourcePlugin): proxy_attributes = ('zMySQLConnectionString',) diff --git a/ZenPacks/zenoss/MySqlMonitor/objects/objects.xml b/ZenPacks/zenoss/MySqlMonitor/objects/objects.xml index 26ba1f6..24bb593 100644 --- a/ZenPacks/zenoss/MySqlMonitor/objects/objects.xml +++ b/ZenPacks/zenoss/MySqlMonitor/objects/objects.xml @@ -21,63 +21,6 @@ Products.ZenModel.Device - - - - COMMAND - - - True - - - ${here/id} - - - /Cmd/Fail - - - 3 - - - mysql -e "SELECT table_schema, sum(data_length + index_length) size, sum(index_length) index_size, sum(data_length) data_size FROM information_schema.TABLES GROUP BY table_schema;" - - - 300 - - - True - - - ZenPacks.zenoss.MySqlMonitor.parsers.database - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - @@ -206,95 +149,6 @@ Products.ZenModel.Device - - - - COMMAND - - - True - - - ${here/id} - - - /Cmd/Fail - - - 3 - - - ${here/zMySQLCommand} -e "select TABLE_SCHEMA, TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH, MAX_DATA_LENGTH, INDEX_LENGTH, DATA_FREE from information_schema.tables" - - - 5 - - - True - - - ZenPacks.zenoss.MySqlMonitor.parsers.tables_schema - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - GAUGE - - - True - - - - - @@ -560,6 +414,7 @@ + Products.ZenModel.Device @@ -586,33 +441,17 @@ ZenPacks.zenoss.MySqlMonitor.dsplugins.MySqlMonitorPlugin - - - - COMMAND - - - True - - - /Cmd/Fail - - - 3 - - - /usr/bin/mysql -e 'show global status' - - - 5 - - - True - - - ZenPacks.zenoss.MySQL.parsers.mysql_parser - + + + + GAUGE + + + True + + + GAUGE @@ -621,6 +460,7 @@ True + GAUGE @@ -629,7 +469,8 @@ True - + + GAUGE @@ -637,7 +478,8 @@ True - + + GAUGE @@ -645,6 +487,7 @@ True + GAUGE @@ -653,6 +496,7 @@ True + GAUGE @@ -661,6 +505,7 @@ True + GAUGE @@ -669,6 +514,7 @@ True + GAUGE @@ -677,6 +523,7 @@ True + GAUGE @@ -685,6 +532,7 @@ True + GAUGE @@ -693,6 +541,7 @@ True + GAUGE @@ -701,6 +550,7 @@ True + GAUGE @@ -709,7 +559,8 @@ True - + + GAUGE @@ -717,7 +568,8 @@ True - + + GAUGE @@ -725,6 +577,7 @@ True + GAUGE @@ -733,6 +586,7 @@ True + GAUGE @@ -741,6 +595,7 @@ True + GAUGE @@ -749,6 +604,7 @@ True + GAUGE @@ -757,6 +613,7 @@ True + GAUGE @@ -765,7 +622,8 @@ True - + + GAUGE @@ -773,7 +631,8 @@ True - + + GAUGE @@ -781,6 +640,7 @@ True + GAUGE @@ -789,6 +649,7 @@ True + GAUGE @@ -797,6 +658,7 @@ True + GAUGE @@ -805,6 +667,7 @@ True + GAUGE @@ -813,6 +676,7 @@ True + GAUGE @@ -821,7 +685,8 @@ True - + + GAUGE @@ -829,7 +694,8 @@ True - + + GAUGE @@ -837,6 +703,7 @@ True + GAUGE @@ -845,6 +712,7 @@ True + GAUGE @@ -853,7 +721,8 @@ True - + + GAUGE @@ -861,7 +730,8 @@ True - + + GAUGE @@ -869,7 +739,8 @@ True - + + GAUGE @@ -877,7 +748,8 @@ True - + + GAUGE @@ -885,7 +757,8 @@ True - + + GAUGE @@ -893,7 +766,8 @@ True - + + GAUGE @@ -901,7 +775,8 @@ True - + + GAUGE @@ -909,7 +784,8 @@ True - + + GAUGE @@ -917,7 +793,8 @@ True - + + GAUGE @@ -925,7 +802,8 @@ True - + + GAUGE @@ -933,7 +811,8 @@ True - + + GAUGE @@ -941,7 +820,8 @@ True - + + GAUGE @@ -949,7 +829,8 @@ True - + + GAUGE @@ -957,7 +838,8 @@ True - + + GAUGE @@ -965,6 +847,7 @@ True + GAUGE @@ -973,6 +856,7 @@ True + GAUGE @@ -981,6 +865,7 @@ True + GAUGE @@ -989,6 +874,7 @@ True + GAUGE @@ -997,6 +883,7 @@ True + GAUGE @@ -1005,6 +892,7 @@ True + GAUGE @@ -1013,6 +901,7 @@ True + GAUGE @@ -1021,6 +910,7 @@ True + GAUGE @@ -1029,18 +919,73 @@ True - - - GAUGE + + + + + + + + + + 100 + + + 500 + + + False + + + False + + + -1 + + + -1 + + + True + + + 0 + + + + + + 1 - - True + + LINE + + + 1 + + + False + + + %5.2lf%s + + + Threads connected + + + -1 + + + MySQL_threads_connected + + + AVERAGE + - - + 100 @@ -1067,6 +1012,7 @@ 0 + 1 @@ -1096,6 +1042,7 @@ AVERAGE + 1 @@ -1125,8 +1072,10 @@ AVERAGE + + 100 @@ -1153,7 +1102,8 @@ 0 - + + 1 @@ -1170,19 +1120,20 @@ %5.2lf%s - Bytes received + Bytes sent -1 - MySQL_bytes_received + MySQL_bytes_sent AVERAGE - + + 1 @@ -1199,20 +1150,22 @@ %5.2lf%s - Bytes sent + Bytes received -1 - MySQL_bytes_sent + MySQL_bytes_received AVERAGE + + 100 @@ -1239,6 +1192,7 @@ 0 + 1 @@ -1268,6 +1222,7 @@ AVERAGE + 1 @@ -1297,6 +1252,7 @@ AVERAGE + 1 @@ -1326,6 +1282,7 @@ AVERAGE + 1 @@ -1355,6 +1312,7 @@ AVERAGE + 1 @@ -1384,6 +1342,7 @@ AVERAGE + 1 @@ -1413,6 +1372,7 @@ AVERAGE + 1 @@ -1442,6 +1402,7 @@ AVERAGE + 1 @@ -1471,7 +1432,8 @@ AVERAGE - + + 1 @@ -1488,19 +1450,20 @@ %5.2lf%s - Com delete + Com delete multi -1 - MySQL_com_delete + MySQL_com_delete_multi AVERAGE - + + 1 @@ -1517,18 +1480,19 @@ %5.2lf%s - Com delete multi + Com delete -1 - MySQL_com_delete_multi + MySQL_com_delete AVERAGE + 1 @@ -1558,6 +1522,7 @@ AVERAGE + 1 @@ -1587,6 +1552,7 @@ AVERAGE + 1 @@ -1616,6 +1582,7 @@ AVERAGE + 1 @@ -1645,6 +1612,7 @@ AVERAGE + 1 @@ -1674,7 +1642,8 @@ AVERAGE - + + 1 @@ -1691,19 +1660,20 @@ %5.2lf%s - Com insert + Com insert select -1 - MySQL_com_insert + MySQL_com_insert_select AVERAGE - + + 1 @@ -1720,18 +1690,19 @@ %5.2lf%s - Com insert select + Com insert -1 - MySQL_com_insert_select + MySQL_com_insert AVERAGE + 1 @@ -1761,6 +1732,7 @@ AVERAGE + 1 @@ -1790,6 +1762,7 @@ AVERAGE + 1 @@ -1819,6 +1792,7 @@ AVERAGE + 1 @@ -1848,6 +1822,7 @@ AVERAGE + 1 @@ -1877,7 +1852,8 @@ AVERAGE - + + 1 @@ -1894,19 +1870,20 @@ %5.2lf%s - Com update + Com update multi -1 - MySQL_com_update + MySQL_com_update_multi AVERAGE - + + 1 @@ -1923,21 +1900,23 @@ %5.2lf%s - Com update multi + Com update -1 - MySQL_com_update_multi + MySQL_com_update AVERAGE + - + + 100 @@ -1963,7 +1942,8 @@ 0 - + + 1 @@ -1980,75 +1960,19 @@ %5.2lf%s - Threads connected + Handler commit -1 - MySQL_threads_connected - - - AVERAGE - - - - - - - 100 - - - 500 - - - False - - - False - - - -1 - - - -1 - - - True - - - 0 - - - - - 1 - - - LINE - - - 1 - - - False - - - %5.2lf%s - - - Handler commit - - - -1 - - - MySQL_handler_commit + MySQL_handler_commit AVERAGE + 1 @@ -2078,7 +2002,8 @@ AVERAGE - + + 1 @@ -2095,19 +2020,20 @@ %5.2lf%s - Handler read first + Handler rollback -1 - MySQL_handler_read_first + MySQL_handler_rollback AVERAGE - + + 1 @@ -2124,19 +2050,20 @@ %5.2lf%s - Handler read key + Handler update -1 - MySQL_handler_read_key + MySQL_handler_update AVERAGE - + + 1 @@ -2153,19 +2080,20 @@ %5.2lf%s - Handler read last + Handler write -1 - MySQL_handler_read_last + MySQL_handler_write AVERAGE - + + 1 @@ -2182,19 +2110,20 @@ %5.2lf%s - Handler read next + Handler read first -1 - MySQL_handler_read_next + MySQL_handler_read_first AVERAGE - + + 1 @@ -2211,19 +2140,20 @@ %5.2lf%s - Handler read prev + Handler read key -1 - MySQL_handler_read_prev + MySQL_handler_read_key AVERAGE - + + 1 @@ -2240,19 +2170,20 @@ %5.2lf%s - Handler read rnd + Handler read last -1 - MySQL_handler_read_rnd + MySQL_handler_read_last AVERAGE - + + 1 @@ -2269,19 +2200,20 @@ %5.2lf%s - Handler read rnd next + Handler read next -1 - MySQL_handler_read_rnd_next + MySQL_handler_read_next AVERAGE - + + 1 @@ -2298,19 +2230,20 @@ %5.2lf%s - Handler rollback + Handler read prev -1 - MySQL_handler_rollback + MySQL_handler_read_prev AVERAGE - + + 1 @@ -2327,19 +2260,20 @@ %5.2lf%s - Handler savepoint + Handler read rnd -1 - MySQL_handler_savepoint + MySQL_handler_read_rnd AVERAGE - + + 1 @@ -2356,19 +2290,20 @@ %5.2lf%s - Handler update + Handler read rnd next -1 - MySQL_handler_update + MySQL_handler_read_rnd_next AVERAGE - + + 1 @@ -2385,21 +2320,23 @@ %5.2lf%s - Handler write + Handler savepoint -1 - MySQL_handler_write + MySQL_handler_savepoint AVERAGE + - + + 100 @@ -2425,65 +2362,8 @@ 0 - - - 1 - - - LINE - - - 1 - - - False - - - %5.2lf%s - - - Select full join - - - -1 - - - MySQL_select_full_join - - - AVERAGE - - - - - 1 - - - LINE - - - 1 - - - False - - - %5.2lf%s - - - Select full range join - - - -1 - - - MySQL_select_full_range_join - - - AVERAGE - - - + + 1 @@ -2500,19 +2380,20 @@ %5.2lf%s - Select range + Key reads -1 - MySQL_select_range + MySQL_key_reads AVERAGE - + + 1 @@ -2529,19 +2410,20 @@ %5.2lf%s - Select range check + Key writes -1 - MySQL_select_range_check + MySQL_key_writes AVERAGE - + + 1 @@ -2558,21 +2440,23 @@ %5.2lf%s - Select scan + Key read requests -1 - MySQL_select_scan + MySQL_key_read_requests AVERAGE + - + + 100 @@ -2598,7 +2482,8 @@ 0 - + + 1 @@ -2615,19 +2500,20 @@ %5.2lf%s - Key read requests + Open files -1 - MySQL_key_read_requests + MySQL_open_files AVERAGE - + + 1 @@ -2644,19 +2530,20 @@ %5.2lf%s - Key reads + Open streams -1 - MySQL_key_reads + MySQL_open_streams AVERAGE - + + 1 @@ -2673,21 +2560,23 @@ %5.2lf%s - Key writes + Open tables -1 - MySQL_key_writes + MySQL_open_tables AVERAGE + - + + 100 @@ -2713,7 +2602,8 @@ 0 - + + 1 @@ -2730,19 +2620,20 @@ %5.2lf%s - Open files + Select full join -1 - MySQL_open_files + MySQL_select_full_join AVERAGE - + + 1 @@ -2759,19 +2650,20 @@ %5.2lf%s - Open streams + Select full range join -1 - MySQL_open_streams + MySQL_select_full_range_join AVERAGE - + + 1 @@ -2788,20 +2680,83 @@ %5.2lf%s - Open tables + Select range -1 - MySQL_open_tables + MySQL_select_range + + + AVERAGE + + + + + + 1 + + + LINE + + + 1 + + + False + + + %5.2lf%s + + + Select range check + + + -1 + + + MySQL_select_range_check + + + AVERAGE + + + + + + 1 + + + LINE + + + 1 + + + False + + + %5.2lf%s + + + Select scan + + + -1 + + + MySQL_select_scan AVERAGE + + + diff --git a/ZenPacks/zenoss/MySqlMonitor/objects_gen.py b/ZenPacks/zenoss/MySqlMonitor/objects_gen.py index c6ca47b..d8313a8 100644 --- a/ZenPacks/zenoss/MySqlMonitor/objects_gen.py +++ b/ZenPacks/zenoss/MySqlMonitor/objects_gen.py @@ -5,30 +5,27 @@ def get_monitoring_template(graphs): Products.ZenModel.Device - + - COMMAND + Python True + + ${here/id} + - /Cmd/Fail + /Status 3 - - /usr/bin/mysql -e 'show global status' - - - 5 - - - True + + 300 - - ZenPacks.zenoss.MySQL.parsers.mysql_parser + + ZenPacks.zenoss.MySqlMonitor.dsplugins.MySqlMonitorPlugin ''')