{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/comments/65449193","id":65449193,"diff_hunk":"@@ -0,0 +1,254 @@\n+#!/bin/bash\n+# Description:\tBash script to check drive health using pending, uncorrectable,\n+# and reallocated sector count\n+#\n+# Nagios return codes: 0 = OK; 1 = WARNING; 2 = CRITICAL; 3 = UNKNOWN\n+# SMART Attribute Codes:\n+#   5 = Reallocated\n+#   187 = Reported Uncorrect\n+#   197 = Pending\n+#   198 = Uncorrectable Sector Count\n+#\n+# TO-DO: Add support for dynamic SMART attribute lookup.  For example,\n+#        187 is reported for Seagate HDD and all SSDs but not Hitachi HDDs.\n+#\n+# See https://en.wikipedia.org/wiki/S.M.A.R.T.#ATA_S.M.A.R.T._attributes\n+\n+\n+### Pre-flight checks ###\n+# Set raid var then check for cli64 command and bail if missing\n+if lspci | grep -qi areca\n+then\n+  raid=true\n+else\n+  raid=false\n+fi\n+\n+if ! [ -x \"$(command -v cli64)\" ] && [ \"$raid\" = true ]","path":"roles/testnode/files/libexec/smart.sh","position":27,"original_position":27,"commit_id":"cd5cbd62d7fa76912b5bf9587b13d55cd5b07e93","original_commit_id":"cd5cbd62d7fa76912b5bf9587b13d55cd5b07e93","user":{"login":"dmick","id":1350673,"avatar_url":"https://avatars.githubusercontent.com/u/1350673?v=3","gravatar_id":"","url":"https://api.github.com/users/dmick","html_url":"https://github.com/dmick","followers_url":"https://api.github.com/users/dmick/followers","following_url":"https://api.github.com/users/dmick/following{/other_user}","gists_url":"https://api.github.com/users/dmick/gists{/gist_id}","starred_url":"https://api.github.com/users/dmick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmick/subscriptions","organizations_url":"https://api.github.com/users/dmick/orgs","repos_url":"https://api.github.com/users/dmick/repos","events_url":"https://api.github.com/users/dmick/events{/privacy}","received_events_url":"https://api.github.com/users/dmick/received_events","type":"User","site_admin":false},"body":"If you swap the order, then the shell doesn't have to hunt for the command if it's not doing raid.  Somewhat more efficient as well as more logical","created_at":"2016-06-01T21:46:56Z","updated_at":"2016-06-01T21:46:56Z","html_url":"https://github.com/ceph/ceph-cm-ansible/pull/245#discussion_r65449193","pull_request_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/comments/65449193"},"html":{"href":"https://github.com/ceph/ceph-cm-ansible/pull/245#discussion_r65449193"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245","id":72099005,"html_url":"https://github.com/ceph/ceph-cm-ansible/pull/245","diff_url":"https://github.com/ceph/ceph-cm-ansible/pull/245.diff","patch_url":"https://github.com/ceph/ceph-cm-ansible/pull/245.patch","issue_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/245","number":245,"state":"open","locked":false,"title":"testnode: Replace old smart.pl with rewritten smart.sh script","user":{"login":"djgalloway","id":11281208,"avatar_url":"https://avatars.githubusercontent.com/u/11281208?v=3","gravatar_id":"","url":"https://api.github.com/users/djgalloway","html_url":"https://github.com/djgalloway","followers_url":"https://api.github.com/users/djgalloway/followers","following_url":"https://api.github.com/users/djgalloway/following{/other_user}","gists_url":"https://api.github.com/users/djgalloway/gists{/gist_id}","starred_url":"https://api.github.com/users/djgalloway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djgalloway/subscriptions","organizations_url":"https://api.github.com/users/djgalloway/orgs","repos_url":"https://api.github.com/users/djgalloway/repos","events_url":"https://api.github.com/users/djgalloway/events{/privacy}","received_events_url":"https://api.github.com/users/djgalloway/received_events","type":"User","site_admin":false},"body":"Tested on:\r\n- senta01 (ARC-1222)\r\n- senta02 (mdadm RAID)\r\n- mira058 (ARC-1222 with one failing drive)\r\n- mira124 (ARC-1222 with 5 bad and 1 missing disk)\r\n- smithi005 (No bad disks)\r\n- magna008 (1 failing disk)\r\n\r\nFixes: http://tracker.ceph.com/issues/14682\r\n\r\nSigned-off-by: David Galloway <dgallowa@redhat.com>","created_at":"2016-05-31T22:56:26Z","updated_at":"2016-06-01T21:46:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be176a26021babeb378a67b6ae188f80c0f03482","assignee":{"login":"zmc","id":58307,"avatar_url":"https://avatars.githubusercontent.com/u/58307?v=3","gravatar_id":"","url":"https://api.github.com/users/zmc","html_url":"https://github.com/zmc","followers_url":"https://api.github.com/users/zmc/followers","following_url":"https://api.github.com/users/zmc/following{/other_user}","gists_url":"https://api.github.com/users/zmc/gists{/gist_id}","starred_url":"https://api.github.com/users/zmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmc/subscriptions","organizations_url":"https://api.github.com/users/zmc/orgs","repos_url":"https://api.github.com/users/zmc/repos","events_url":"https://api.github.com/users/zmc/events{/privacy}","received_events_url":"https://api.github.com/users/zmc/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/245/comments","statuses_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/statuses/cd5cbd62d7fa76912b5bf9587b13d55cd5b07e93","head":{"label":"ceph:wip-newsmart","ref":"wip-newsmart","sha":"cd5cbd62d7fa76912b5bf9587b13d55cd5b07e93","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":34542634,"name":"ceph-cm-ansible","full_name":"ceph/ceph-cm-ansible","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph-cm-ansible","description":"Ansible configurations for Ceph.com infrastructure","fork":false,"url":"https://api.github.com/repos/ceph/ceph-cm-ansible","forks_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/forks","keys_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/teams","hooks_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/events","assignees_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/tags","blobs_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/subscription","commits_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/merges","archive_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/downloads","issues_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/deployments","created_at":"2015-04-24T21:24:55Z","updated_at":"2016-05-20T19:38:53Z","pushed_at":"2016-06-01T17:19:37Z","git_url":"git://github.com/ceph/ceph-cm-ansible.git","ssh_url":"git@github.com:ceph/ceph-cm-ansible.git","clone_url":"https://github.com/ceph/ceph-cm-ansible.git","svn_url":"https://github.com/ceph/ceph-cm-ansible","homepage":"","size":2021,"stargazers_count":6,"watchers_count":6,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":6,"forks":15,"open_issues":6,"watchers":6,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"6cd35e48d89726f30307451d452dd71339271bbc","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":34542634,"name":"ceph-cm-ansible","full_name":"ceph/ceph-cm-ansible","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph-cm-ansible","description":"Ansible configurations for Ceph.com infrastructure","fork":false,"url":"https://api.github.com/repos/ceph/ceph-cm-ansible","forks_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/forks","keys_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/teams","hooks_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/events","assignees_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/tags","blobs_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/subscription","commits_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/merges","archive_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/downloads","issues_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph-cm-ansible/deployments","created_at":"2015-04-24T21:24:55Z","updated_at":"2016-05-20T19:38:53Z","pushed_at":"2016-06-01T17:19:37Z","git_url":"git://github.com/ceph/ceph-cm-ansible.git","ssh_url":"git@github.com:ceph/ceph-cm-ansible.git","clone_url":"https://github.com/ceph/ceph-cm-ansible.git","svn_url":"https://github.com/ceph/ceph-cm-ansible","homepage":"","size":2021,"stargazers_count":6,"watchers_count":6,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":6,"forks":15,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245"},"html":{"href":"https://github.com/ceph/ceph-cm-ansible/pull/245"},"issue":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/245"},"comments":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph-cm-ansible/statuses/cd5cbd62d7fa76912b5bf9587b13d55cd5b07e93"}}}}
{"actor":{"display_login":"dmick"}}