)]}'
{"monasca_agent/collector/checks_d/ntp.py":[{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"e6ad6626ca965261e3ffafb21f50bdff3e3c0adf","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            ntp_ts \u003d None"},{"line_number":36,"context_line":"        else:"},{"line_number":37,"context_line":"            ntp_offset \u003d ntp_stats.offset"},{"line_number":38,"context_line":"            "},{"line_number":39,"context_line":"            # Use the ntp server\u0027s timestamp for the time of the result in"},{"line_number":40,"context_line":"            # case the agent host\u0027s clock is messed up."},{"line_number":41,"context_line":"            ntp_ts \u003d ntp_stats.recv_time"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_02ae092e","line":38,"updated":"2015-02-11 22:59:47.000000000","message":"There\u0027s some extra whitespace here.","commit_id":"a84405fc722072c8dc27bd1e1b3387b644e655cc"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":1,"context_line":"import ntplib"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"from monasca_agent.collector.checks import AgentCheck"},{"line_number":4,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_5100cd00","line":1,"updated":"2015-02-12 01:28:55.000000000","message":"Do you need a license and copyright header at the top of this file?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"4609ad0b98ada154c0609739f4c7b9369e909e79","unresolved":false,"context_lines":[{"line_number":1,"context_line":"import ntplib"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"from monasca_agent.collector.checks import AgentCheck"},{"line_number":4,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_3def8bea","line":1,"in_reply_to":"da86d52c_5100cd00","updated":"2015-02-12 17:01:49.000000000","message":"This was copied from data dog, I am not sure how the copyright header should be treated in that case. None of the others largely copied from data dog have it.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":5,"context_line":"DEFAULT_OFFSET_THRESHOLD \u003d 600  # in seconds"},{"line_number":6,"context_line":"DEFAULT_NTP_VERSION \u003d 3"},{"line_number":7,"context_line":"DEFAULT_TIMEOUT \u003d 1  # in seconds"},{"line_number":8,"context_line":"DEFAULT_HOST \u003d \"pool.ntp.org\""},{"line_number":9,"context_line":"DEFAULT_PORT \u003d \"ntp\""},{"line_number":10,"context_line":""},{"line_number":11,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_56efe386","line":8,"updated":"2015-02-12 01:28:55.000000000","message":"Just wondering if you really want a default HOST or if one isn\u0027t configured, then don\u0027t do the check at all.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"4609ad0b98ada154c0609739f4c7b9369e909e79","unresolved":false,"context_lines":[{"line_number":5,"context_line":"DEFAULT_OFFSET_THRESHOLD \u003d 600  # in seconds"},{"line_number":6,"context_line":"DEFAULT_NTP_VERSION \u003d 3"},{"line_number":7,"context_line":"DEFAULT_TIMEOUT \u003d 1  # in seconds"},{"line_number":8,"context_line":"DEFAULT_HOST \u003d \"pool.ntp.org\""},{"line_number":9,"context_line":"DEFAULT_PORT \u003d \"ntp\""},{"line_number":10,"context_line":""},{"line_number":11,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_bdb29b03","line":8,"in_reply_to":"da86d52c_56efe386","updated":"2015-02-12 17:01:49.000000000","message":"I think pool.ntp.org is a reasonable standard, it is widely used, most OS packages default to it.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"class NtpCheck(AgentCheck):"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"    DEFAULT_MIN_COLLECTION_INTERVAL \u003d 20  # in seconds"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"    def check(self, instance):"},{"line_number":17,"context_line":"        dimensions \u003d instance.get(\u0027dimensions\u0027, {})"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_7666a752","line":14,"updated":"2015-02-12 01:28:55.000000000","message":"Shouldn\u0027t this declaration be moved to up above?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"4609ad0b98ada154c0609739f4c7b9369e909e79","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"class NtpCheck(AgentCheck):"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"    DEFAULT_MIN_COLLECTION_INTERVAL \u003d 20  # in seconds"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"    def check(self, instance):"},{"line_number":17,"context_line":"        dimensions \u003d instance.get(\u0027dimensions\u0027, {})"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_7d8ae31b","line":14,"in_reply_to":"da86d52c_7666a752","updated":"2015-02-12 17:01:49.000000000","message":"Not necessarily it is specific to this class. Granted it is the only class in the module, I could move it or not it, either way works for me.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        try:"},{"line_number":31,"context_line":"            ntp_stats \u003d ntplib.NTPClient().request(**req_args)"},{"line_number":32,"context_line":"        except ntplib.NTPException:"},{"line_number":33,"context_line":"            self.log.warning(\"Could not connect to NTP Server\")"},{"line_number":34,"context_line":"            status \u003d 1"},{"line_number":35,"context_line":"            ntp_ts \u003d None"},{"line_number":36,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_36f6ef5d","line":33,"updated":"2015-02-12 01:28:55.000000000","message":"Should this be a warning or an error. I would probably say that this should be an error.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"e3d4207cdada12c0b219a1c75d589b21eb79d22b","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        try:"},{"line_number":31,"context_line":"            ntp_stats \u003d ntplib.NTPClient().request(**req_args)"},{"line_number":32,"context_line":"        except ntplib.NTPException:"},{"line_number":33,"context_line":"            self.log.warning(\"Could not connect to NTP Server\")"},{"line_number":34,"context_line":"            status \u003d 1"},{"line_number":35,"context_line":"            ntp_ts \u003d None"},{"line_number":36,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_b70ab4cf","line":33,"in_reply_to":"da86d52c_1da0078f","updated":"2015-02-12 18:31:26.000000000","message":"I think I would treat as a error. You are correct, it is only one plugin out of many, but it still an error IMHO.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"4609ad0b98ada154c0609739f4c7b9369e909e79","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        try:"},{"line_number":31,"context_line":"            ntp_stats \u003d ntplib.NTPClient().request(**req_args)"},{"line_number":32,"context_line":"        except ntplib.NTPException:"},{"line_number":33,"context_line":"            self.log.warning(\"Could not connect to NTP Server\")"},{"line_number":34,"context_line":"            status \u003d 1"},{"line_number":35,"context_line":"            ntp_ts \u003d None"},{"line_number":36,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_1da0078f","line":33,"in_reply_to":"da86d52c_36f6ef5d","updated":"2015-02-12 17:01:49.000000000","message":"In the context of the agent as a whole, this is one plugin having a problem, the rest will continue to function fine so I could see it as a warning, if you would like I could move to an error.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":31,"context_line":"            ntp_stats \u003d ntplib.NTPClient().request(**req_args)"},{"line_number":32,"context_line":"        except ntplib.NTPException:"},{"line_number":33,"context_line":"            self.log.warning(\"Could not connect to NTP Server\")"},{"line_number":34,"context_line":"            status \u003d 1"},{"line_number":35,"context_line":"            ntp_ts \u003d None"},{"line_number":36,"context_line":"        else:"},{"line_number":37,"context_line":"            ntp_offset \u003d ntp_stats.offset"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_b66f3ffb","line":34,"updated":"2015-02-12 01:28:55.000000000","message":"Do you really want to report a status of 1 if you can\u0027t contact the NTP server. The problem is that status reported is now over-loaded. It could mean that the offset is greater than some threshold or the server is down or not reachable.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"4609ad0b98ada154c0609739f4c7b9369e909e79","unresolved":false,"context_lines":[{"line_number":31,"context_line":"            ntp_stats \u003d ntplib.NTPClient().request(**req_args)"},{"line_number":32,"context_line":"        except ntplib.NTPException:"},{"line_number":33,"context_line":"            self.log.warning(\"Could not connect to NTP Server\")"},{"line_number":34,"context_line":"            status \u003d 1"},{"line_number":35,"context_line":"            ntp_ts \u003d None"},{"line_number":36,"context_line":"        else:"},{"line_number":37,"context_line":"            ntp_offset \u003d ntp_stats.offset"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_bd337b60","line":34,"in_reply_to":"da86d52c_b66f3ffb","updated":"2015-02-12 17:01:49.000000000","message":"You are right it is overloaded now, however it does at least let you know something is wrong. Do you have any suggestion of how to notify the user there is an issue without overloading?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            # Use the ntp server\u0027s timestamp for the time of the result in"},{"line_number":40,"context_line":"            # case the agent host\u0027s clock is messed up."},{"line_number":41,"context_line":"            ntp_ts \u003d ntp_stats.recv_time"},{"line_number":42,"context_line":"            self.gauge(\u0027ntp.offset\u0027, ntp_offset, timestamp\u003dntp_ts, dimensions\u003ddimensions)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"            if abs(ntp_offset) \u003e offset_threshold:"},{"line_number":45,"context_line":"                status \u003d 1"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_b6149f4d","line":42,"updated":"2015-02-12 01:28:55.000000000","message":"So, you are reporting a 0 or 1 based on whether the current offset is less than/equal or greater than a threshold.\n\nWouldn\u0027t you want to report the offset and then have then use the threshold engine to evaluate if the offset is greater than some amount?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"4609ad0b98ada154c0609739f4c7b9369e909e79","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            # Use the ntp server\u0027s timestamp for the time of the result in"},{"line_number":40,"context_line":"            # case the agent host\u0027s clock is messed up."},{"line_number":41,"context_line":"            ntp_ts \u003d ntp_stats.recv_time"},{"line_number":42,"context_line":"            self.gauge(\u0027ntp.offset\u0027, ntp_offset, timestamp\u003dntp_ts, dimensions\u003ddimensions)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"            if abs(ntp_offset) \u003e offset_threshold:"},{"line_number":45,"context_line":"                status \u003d 1"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_1d51e761","line":42,"in_reply_to":"da86d52c_b6149f4d","updated":"2015-02-12 17:01:49.000000000","message":"This metric is the offset. The lag below is the one that is 0 or 1. I do like the idea of removing the lag altogether and just using an alarm. That pushes the config for this to the server side, I will work on that.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"819e37f05a6f319b7b1e868d9c0d097c3dff7aa5","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            else:"},{"line_number":47,"context_line":"                status \u003d 0"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        self.gauge(\u0027ntp.in_sync\u0027, status, timestamp\u003dntp_ts, dimensions\u003ddimensions)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_75d92a21","line":49,"updated":"2015-02-12 12:52:45.000000000","message":"So, if we calculate the lag, I would say we have a metric name of \"ntp.lag_secs\"","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"}],"monasca_agent/collector/checks_d/postfix.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":1,"context_line":"import os"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"from monasca_agent.collector.checks import AgentCheck"},{"line_number":4,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_b122e9a0","line":1,"updated":"2015-02-12 01:28:55.000000000","message":"License and copyright header?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _get_queue_count(self, directory, queues, dimensions):"},{"line_number":47,"context_line":"        for queue in queues:"},{"line_number":48,"context_line":"            queue_path \u003d os.path.join(directory, queue)"},{"line_number":49,"context_line":"            if not os.path.exists(queue_path):"},{"line_number":50,"context_line":"                raise Exception(\u0027%s does not exist\u0027 % queue_path)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            count \u003d 0"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_519c4dc0","line":49,"updated":"2015-02-12 01:28:55.000000000","message":"Should probably have a log.error here to inform the user what coud be going wrong.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _get_queue_count(self, directory, queues, dimensions):"},{"line_number":47,"context_line":"        for queue in queues:"},{"line_number":48,"context_line":"            queue_path \u003d os.path.join(directory, queue)"},{"line_number":49,"context_line":"            if not os.path.exists(queue_path):"},{"line_number":50,"context_line":"                raise Exception(\u0027%s does not exist\u0027 % queue_path)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            count \u003d 0"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_92ebfe11","line":49,"in_reply_to":"da86d52c_519c4dc0","updated":"2015-02-12 18:56:35.000000000","message":"The exception is caught in the collector which runs this plugin and logs it as an exception at that point.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        for queue in queues:"},{"line_number":48,"context_line":"            queue_path \u003d os.path.join(directory, queue)"},{"line_number":49,"context_line":"            if not os.path.exists(queue_path):"},{"line_number":50,"context_line":"                raise Exception(\u0027%s does not exist\u0027 % queue_path)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            count \u003d 0"},{"line_number":53,"context_line":"            if os.geteuid() \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_f13e21b7","line":50,"updated":"2015-02-12 01:28:55.000000000","message":"Just for sanity, where does this exception end-up getting caught. Are we safe?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            else:"},{"line_number":57,"context_line":"                # can agent user run sudo?"},{"line_number":58,"context_line":"                test_sudo \u003d os.system(\u0027setsid sudo -l \u003e /dev/null\u0027)"},{"line_number":59,"context_line":"                if test_sudo \u003d\u003d 0:"},{"line_number":60,"context_line":"                    count \u003d os.popen(\u0027sudo find %s -type f | wc -l\u0027 % queue_path)"},{"line_number":61,"context_line":"                    count \u003d count.readlines()[0].strip()"},{"line_number":62,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_31b3594e","line":59,"updated":"2015-02-12 01:28:55.000000000","message":"Sanity check, but should this be test \"\u003d\u003d 0\" or \"is FALSE\"?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                if test_sudo \u003d\u003d 0:"},{"line_number":60,"context_line":"                    count \u003d os.popen(\u0027sudo find %s -type f | wc -l\u0027 % queue_path)"},{"line_number":61,"context_line":"                    count \u003d count.readlines()[0].strip()"},{"line_number":62,"context_line":"                else:"},{"line_number":63,"context_line":"                    raise Exception(\u0027The monasca-agent user does not have sudo access\u0027)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"            # emit an individually tagged metric"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_91a245fa","line":62,"updated":"2015-02-12 01:28:55.000000000","message":"Probably should have a log.error here too.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                if test_sudo \u003d\u003d 0:"},{"line_number":60,"context_line":"                    count \u003d os.popen(\u0027sudo find %s -type f | wc -l\u0027 % queue_path)"},{"line_number":61,"context_line":"                    count \u003d count.readlines()[0].strip()"},{"line_number":62,"context_line":"                else:"},{"line_number":63,"context_line":"                    raise Exception(\u0027The monasca-agent user does not have sudo access\u0027)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"            # emit an individually tagged metric"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_d2f1f601","line":62,"in_reply_to":"da86d52c_91a245fa","updated":"2015-02-12 18:56:35.000000000","message":"Same as above.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                    count \u003d os.popen(\u0027sudo find %s -type f | wc -l\u0027 % queue_path)"},{"line_number":61,"context_line":"                    count \u003d count.readlines()[0].strip()"},{"line_number":62,"context_line":"                else:"},{"line_number":63,"context_line":"                    raise Exception(\u0027The monasca-agent user does not have sudo access\u0027)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"            # emit an individually tagged metric"},{"line_number":66,"context_line":"            dimensions.update({\u0027queue\u0027: queue, \u0027instance\u0027: os.path.basename(directory)})"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_d1683dbc","line":63,"updated":"2015-02-12 01:28:55.000000000","message":"Same comment as above. Is this exception caught and handled?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"            # emit an individually tagged metric"},{"line_number":66,"context_line":"            dimensions.update({\u0027queue\u0027: queue, \u0027instance\u0027: os.path.basename(directory)})"},{"line_number":67,"context_line":"            self.gauge(\u0027postfix.queue.size\u0027, count, dimensions\u003ddimensions)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_118d757c","line":67,"updated":"2015-02-12 01:28:55.000000000","message":"I think this should be called \"postfix.queue_size\" according to the conventions that we\u0027ve been trying to establish. Probably should take a quick look at the agent documentation first.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"}],"monasca_setup/detection/plugins/ntp.py":[{"author":{"_account_id":12108,"name":"Gary Hessler","email":"gary.hessler@hp.com","username":"garyh"},"change_message_id":"e1355ba8f0fd4557b8ce8e732cc8463320f034b4","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"class Ntp(monasca_setup.detection.Plugin):"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"    \"\"\"Detect Zookeeper daemons and setup configuration to monitor them."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"    \"\"\""},{"line_number":17,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_f8a36b9b","line":14,"updated":"2015-02-11 21:40:38.000000000","message":"Zookeeper?","commit_id":"f2e860d307008263ef939f590f56b1cd61e6683c"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":1,"context_line":"import logging"},{"line_number":2,"context_line":"import os"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"import yaml"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_31e1992a","line":1,"updated":"2015-02-12 01:28:55.000000000","message":"Copyright and license header?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"import logging"},{"line_number":2,"context_line":"import os"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"import yaml"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_32c17280","line":1,"in_reply_to":"da86d52c_31e1992a","updated":"2015-02-12 18:56:35.000000000","message":"I did write this and our team wrote all of the moansca-setup but there is no header in all of the files. Perhaps this is something we need to correct. I\u0027ll leave it to be corrected on a mass basis in another review.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"class Ntp(monasca_setup.detection.Plugin):"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"    \"\"\"Detect NTP daemon and setup configuration to monitor them."},{"line_number":15,"context_line":"    \"\"\""},{"line_number":16,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_71d6b150","line":13,"updated":"2015-02-12 01:28:55.000000000","message":"I don\u0027t think this empty line should be here.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        \"\"\""},{"line_number":26,"context_line":"        config \u003d monasca_setup.agent_config.Plugins()"},{"line_number":27,"context_line":"        log.info(\"\\tEnabling the ntp plugin\")"},{"line_number":28,"context_line":"        with open(os.path.join(self.template_dir, \u0027conf.d/ntp.yaml.example\u0027), \u0027r\u0027) as ntp_template:"},{"line_number":29,"context_line":"            ntp_config \u003d yaml.load(ntp_template.read())"},{"line_number":30,"context_line":"        config[\u0027ntp\u0027] \u003d ntp_config"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_b15ae9ef","line":28,"updated":"2015-02-12 01:28:55.000000000","message":"I was a little confused here. You are opening the example config, but this is the production code, right?\n\nAlso, do you need to handle any exceptions if open fails?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        \"\"\""},{"line_number":26,"context_line":"        config \u003d monasca_setup.agent_config.Plugins()"},{"line_number":27,"context_line":"        log.info(\"\\tEnabling the ntp plugin\")"},{"line_number":28,"context_line":"        with open(os.path.join(self.template_dir, \u0027conf.d/ntp.yaml.example\u0027), \u0027r\u0027) as ntp_template:"},{"line_number":29,"context_line":"            ntp_config \u003d yaml.load(ntp_template.read())"},{"line_number":30,"context_line":"        config[\u0027ntp\u0027] \u003d ntp_config"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_b263a2af","line":28,"in_reply_to":"da86d52c_b15ae9ef","updated":"2015-02-12 18:56:35.000000000","message":"Yes the example configs are routinely used as templates for the config generated by monasca-setup that way any changes to the config format only need to be made in one file.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        config \u003d monasca_setup.agent_config.Plugins()"},{"line_number":27,"context_line":"        log.info(\"\\tEnabling the ntp plugin\")"},{"line_number":28,"context_line":"        with open(os.path.join(self.template_dir, \u0027conf.d/ntp.yaml.example\u0027), \u0027r\u0027) as ntp_template:"},{"line_number":29,"context_line":"            ntp_config \u003d yaml.load(ntp_template.read())"},{"line_number":30,"context_line":"        config[\u0027ntp\u0027] \u003d ntp_config"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return config"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_710b11d6","line":29,"updated":"2015-02-12 01:28:55.000000000","message":"Do you need to handle exceptions generated by yaml.load? I\u0027m assuming an exception occurs if the file isn\u0027t yaml.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        config \u003d monasca_setup.agent_config.Plugins()"},{"line_number":27,"context_line":"        log.info(\"\\tEnabling the ntp plugin\")"},{"line_number":28,"context_line":"        with open(os.path.join(self.template_dir, \u0027conf.d/ntp.yaml.example\u0027), \u0027r\u0027) as ntp_template:"},{"line_number":29,"context_line":"            ntp_config \u003d yaml.load(ntp_template.read())"},{"line_number":30,"context_line":"        config[\u0027ntp\u0027] \u003d ntp_config"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return config"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_124d4e3e","line":29,"in_reply_to":"da86d52c_710b11d6","updated":"2015-02-12 18:56:35.000000000","message":"This is just the setup program, if yaml dies the entire setup will die but that is acceptable.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        log.info(\"\\tEnabling the ntp plugin\")"},{"line_number":28,"context_line":"        with open(os.path.join(self.template_dir, \u0027conf.d/ntp.yaml.example\u0027), \u0027r\u0027) as ntp_template:"},{"line_number":29,"context_line":"            ntp_config \u003d yaml.load(ntp_template.read())"},{"line_number":30,"context_line":"        config[\u0027ntp\u0027] \u003d ntp_config"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return config"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_d1f91dc9","line":30,"updated":"2015-02-12 01:28:55.000000000","message":"Do you need to validate the config?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        log.info(\"\\tEnabling the ntp plugin\")"},{"line_number":28,"context_line":"        with open(os.path.join(self.template_dir, \u0027conf.d/ntp.yaml.example\u0027), \u0027r\u0027) as ntp_template:"},{"line_number":29,"context_line":"            ntp_config \u003d yaml.load(ntp_template.read())"},{"line_number":30,"context_line":"        config[\u0027ntp\u0027] \u003d ntp_config"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        return config"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_72fccab5","line":30,"in_reply_to":"da86d52c_d1f91dc9","updated":"2015-02-12 18:56:35.000000000","message":"I am assuming the that example config we ship with the code is valid. The only way to validate it would be to have a standard also shipped with the code to compare against. In that case we would have to both maintain the standard and the example config, in this we just have to maintain the one.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f7781e3fc3061acc11949fcda2e461624edbcd71","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def dependencies_installed(self):"},{"line_number":35,"context_line":"        try:"},{"line_number":36,"context_line":"            import ntplib"},{"line_number":37,"context_line":"        except ImportError:"},{"line_number":38,"context_line":"            return False"},{"line_number":39,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_f11d4110","line":36,"updated":"2015-02-12 01:28:55.000000000","message":"Why not just import ntplib at the top of the file rather than here?","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def dependencies_installed(self):"},{"line_number":35,"context_line":"        try:"},{"line_number":36,"context_line":"            import ntplib"},{"line_number":37,"context_line":"        except ImportError:"},{"line_number":38,"context_line":"            return False"},{"line_number":39,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_526a6681","line":36,"in_reply_to":"da86d52c_f11d4110","updated":"2015-02-12 18:56:35.000000000","message":"If you import at the top of the file the lack of ntplib will result in the entire setup run failing to finish. Here it will just not configure this plugin and will still properly configure other plugins.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"}],"monasca_setup/detection/plugins/postfix.py":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"ed7bade25cddac84a952cd8407e0abc158d24db6","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"    \"\"\""},{"line_number":16,"context_line":"    # todo this is is disabled as postfix requires passwordless sudo for the"},{"line_number":17,"context_line":"    # monasca-agent user, a bad practice"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"    def _detect(self):"},{"line_number":20,"context_line":"        \"\"\"Run detection, set self.available True if the service is detected."}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_a2da9d48","line":17,"updated":"2015-02-11 22:48:56.000000000","message":"Is this comment accurate? It doesn\u0027t seem to be disabled","commit_id":"4077f9f2662d54db616bc9d32cd9a8974e092236"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"5be0f6415524e449e0876f63c78e519cc9824416","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"    \"\"\""},{"line_number":16,"context_line":"    # todo this is is disabled as postfix requires passwordless sudo for the"},{"line_number":17,"context_line":"    # monasca-agent user, a bad practice"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"    def _detect(self):"},{"line_number":20,"context_line":"        \"\"\"Run detection, set self.available True if the service is detected."}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_22f94d4e","line":17,"in_reply_to":"da86d52c_a2da9d48","updated":"2015-02-11 22:56:58.000000000","message":"Done","commit_id":"4077f9f2662d54db616bc9d32cd9a8974e092236"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"ed7bade25cddac84a952cd8407e0abc158d24db6","unresolved":false,"context_lines":[{"line_number":22,"context_line":"        \"\"\""},{"line_number":23,"context_line":"        if monasca_setup.detection.find_process_cmdline(\u0027postfix\u0027) is not None:"},{"line_number":24,"context_line":"            # Test for sudo access"},{"line_number":25,"context_line":"            test_sudo \u003d os.system(\u0027sudo -l -U monasca-agent ls /var/spool/postfix/incoming \u003e /dev/null\u0027)"},{"line_number":26,"context_line":"            if test_sudo !\u003d 0:"},{"line_number":27,"context_line":"                log.info(\"Postfix found but the required sudo access is not configured.\\n\\t\" +"},{"line_number":28,"context_line":"                         \"Refer to plugin documentation for more detail\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_42c2c153","line":25,"updated":"2015-02-11 22:48:56.000000000","message":"The collector postfix.py first checks if user is root. Should this code do that?","commit_id":"4077f9f2662d54db616bc9d32cd9a8974e092236"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"5be0f6415524e449e0876f63c78e519cc9824416","unresolved":false,"context_lines":[{"line_number":22,"context_line":"        \"\"\""},{"line_number":23,"context_line":"        if monasca_setup.detection.find_process_cmdline(\u0027postfix\u0027) is not None:"},{"line_number":24,"context_line":"            # Test for sudo access"},{"line_number":25,"context_line":"            test_sudo \u003d os.system(\u0027sudo -l -U monasca-agent ls /var/spool/postfix/incoming \u003e /dev/null\u0027)"},{"line_number":26,"context_line":"            if test_sudo !\u003d 0:"},{"line_number":27,"context_line":"                log.info(\"Postfix found but the required sudo access is not configured.\\n\\t\" +"},{"line_number":28,"context_line":"                         \"Refer to plugin documentation for more detail\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_0200c932","line":25,"in_reply_to":"da86d52c_42c2c153","updated":"2015-02-11 22:56:58.000000000","message":"No this code shouldn\u0027t do that. The plugin needs to work with whatever config is setup by the user. The monasca-setup is building our default config which very intentionally does not run the agent as root but as the monasca-agent so we know for our default setup that root check in the agent isn\u0027t really needed. Also though we setup the agent to run as a low privilege user monasca-setup itself runs as root and so the root check just confuses things.","commit_id":"4077f9f2662d54db616bc9d32cd9a8974e092236"},{"author":{"_account_id":12443,"name":"David Schroeder","email":"openstack@a7n.net","username":"dschroeder"},"change_message_id":"e6ad6626ca965261e3ffafb21f50bdff3e3c0adf","unresolved":false,"context_lines":[{"line_number":17,"context_line":"        \"\"\""},{"line_number":18,"context_line":"        if monasca_setup.detection.find_process_cmdline(\u0027postfix\u0027) is not None:"},{"line_number":19,"context_line":"            # Test for sudo access"},{"line_number":20,"context_line":"            test_sudo \u003d os.system(\u0027sudo -l -U monasca-agent ls /var/spool/postfix/incoming \u003e /dev/null\u0027)"},{"line_number":21,"context_line":"            if test_sudo !\u003d 0:"},{"line_number":22,"context_line":"                log.info(\"Postfix found but the required sudo access is not configured.\\n\\t\" +"},{"line_number":23,"context_line":"                         \"Refer to plugin documentation for more detail\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_427ba1bd","line":20,"updated":"2015-02-11 22:59:47.000000000","message":"Shouldn\u0027t test_sudo run a \u0027find\u0027 instead of an \u0027ls\u0027?  The actual check runs a find, and the example /etc/sudoers entries indicate \u0027/usr/bin/find\u0027.","commit_id":"a84405fc722072c8dc27bd1e1b3387b644e655cc"}],"monasca_setup/detection/plugins/swift.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"f460edca9d1e88ba07ea047e6916ec9a42c86b6d","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                       \"/usr/local/bin/diagnostics --swift_services \u0026\u0026 \" + \\"},{"line_number":41,"context_line":"                       \"/usr/local/bin/swift-checker --diskusage \u0026\u0026 \" + \\"},{"line_number":42,"context_line":"                       \"/usr/local/bin/swift-checker --healthcheck \u0026\u0026 \" + \\"},{"line_number":43,"context_line":"                       \"/usr/local/bin/swift-checker --replication\u0027\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        if os.path.exists(\u0027/usr/local/bin/diagnostics\u0027) and os.path.exists(\u0027/usr/local/bin/swift-checker\u0027):"},{"line_number":46,"context_line":"            config[\u0027nagios_wrapper\u0027] \u003d {\u0027init_config\u0027: None,"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_78b75f3a","line":43,"updated":"2015-02-12 13:04:46.000000000","message":"We should track down where these scripts came from. Were these developed for Helion or part of OpenStack? I\u0027m wondering if this is something special for Helion that the Swift team did, whether we should get this code delivered with our Agent as this won\u0027t be useful for anyone else unless they have these scripts available. It would be nice to deliver something that is self-contained.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"},{"author":{"_account_id":11094,"name":"Tim Kuhlman","email":"timothy.kuhlman@canonical.com","username":"kuhlmant"},"change_message_id":"54b0b7ce5911056e715556adff6c0051f5fb0b2b","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                       \"/usr/local/bin/diagnostics --swift_services \u0026\u0026 \" + \\"},{"line_number":41,"context_line":"                       \"/usr/local/bin/swift-checker --diskusage \u0026\u0026 \" + \\"},{"line_number":42,"context_line":"                       \"/usr/local/bin/swift-checker --healthcheck \u0026\u0026 \" + \\"},{"line_number":43,"context_line":"                       \"/usr/local/bin/swift-checker --replication\u0027\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        if os.path.exists(\u0027/usr/local/bin/diagnostics\u0027) and os.path.exists(\u0027/usr/local/bin/swift-checker\u0027):"},{"line_number":46,"context_line":"            config[\u0027nagios_wrapper\u0027] \u003d {\u0027init_config\u0027: None,"}],"source_content_type":"text/x-python","patch_set":6,"id":"da86d52c_d2249661","line":43,"in_reply_to":"da86d52c_78b75f3a","updated":"2015-02-12 18:56:35.000000000","message":"I agree this section needs validation and testing. As soon as we have an environment to test in we should do that.","commit_id":"011167b174f58e404f030f57f82b8123fa2ee761"}]}
