{"action":"created","comment":{"url":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/comments/197803225","pull_request_review_id":131616378,"id":197803225,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzgwMzIyNQ==","diff_hunk":"@@ -515,6 +533,20 @@ main(int argc, char **argv)\n         one_shot = TRUE;\n     }\n \n+    /* to enable stonith-connection when called via some application like pcs \n+     */\n+    if (getenv(\"FENCE_HISTORY\") != NULL) {\n+        fence_history = TRUE;\n+        fence_connect = TRUE;\n+        show |= mon_show_fence_history;\n+    }\n+    if (getenv(\"FENCE_FULL_HISTORY\") != NULL) {\n+        fence_full_history = TRUE;\n+        fence_history = TRUE;\n+        fence_connect = TRUE;\n+        show |= mon_show_fence_history;\n+    }","path":"tools/crm_mon.c","position":122,"original_position":122,"commit_id":"a3a8594fad8c1648b4160c946333377b1aa0d597","original_commit_id":"bf2045bd922062d56513b4c6b5297f516a525265","user":{"login":"kgaillot","id":8730570,"node_id":"MDQ6VXNlcjg3MzA1NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/8730570?v=4","gravatar_id":"","url":"https://api.github.com/users/kgaillot","html_url":"https://github.com/kgaillot","followers_url":"https://api.github.com/users/kgaillot/followers","following_url":"https://api.github.com/users/kgaillot/following{/other_user}","gists_url":"https://api.github.com/users/kgaillot/gists{/gist_id}","starred_url":"https://api.github.com/users/kgaillot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgaillot/subscriptions","organizations_url":"https://api.github.com/users/kgaillot/orgs","repos_url":"https://api.github.com/users/kgaillot/repos","events_url":"https://api.github.com/users/kgaillot/events{/privacy}","received_events_url":"https://api.github.com/users/kgaillot/received_events","type":"User","site_admin":false},"body":"Makes sense. I think I'd rather pull this out before release. I prefer to avoid environment variables except when there's no better way (e.g. settings that pacemaker needs at daemon start-up).","created_at":"2018-06-25T13:51:03Z","updated_at":"2018-06-25T13:51:03Z","html_url":"https://github.com/ClusterLabs/pacemaker/pull/1521#discussion_r197803225","pull_request_url":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/comments/197803225"},"html":{"href":"https://github.com/ClusterLabs/pacemaker/pull/1521#discussion_r197803225"},"pull_request":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521"}},"in_reply_to_id":197500500},"pull_request":{"url":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521","id":196779449,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2Nzc5NDQ5","html_url":"https://github.com/ClusterLabs/pacemaker/pull/1521","diff_url":"https://github.com/ClusterLabs/pacemaker/pull/1521.diff","patch_url":"https://github.com/ClusterLabs/pacemaker/pull/1521.patch","issue_url":"https://api.github.com/repos/ClusterLabs/pacemaker/issues/1521","number":1521,"state":"open","locked":false,"title":"Feature: crm_mon: rhbz#1461964 - add fence history features","user":{"login":"wenningerk","id":15136666,"node_id":"MDQ6VXNlcjE1MTM2NjY2","avatar_url":"https://avatars2.githubusercontent.com/u/15136666?v=4","gravatar_id":"","url":"https://api.github.com/users/wenningerk","html_url":"https://github.com/wenningerk","followers_url":"https://api.github.com/users/wenningerk/followers","following_url":"https://api.github.com/users/wenningerk/following{/other_user}","gists_url":"https://api.github.com/users/wenningerk/gists{/gist_id}","starred_url":"https://api.github.com/users/wenningerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenningerk/subscriptions","organizations_url":"https://api.github.com/users/wenningerk/orgs","repos_url":"https://api.github.com/users/wenningerk/repos","events_url":"https://api.github.com/users/wenningerk/events{/privacy}","received_events_url":"https://api.github.com/users/wenningerk/received_events","type":"User","site_admin":false},"body":"Enable crm_mon to show fence-history grabbed from stonith\r\n \r\n```\r\n     r192.168.123.104   (ocf::heartbeat:IPaddr2):\tStarted node2\r\n     petulant   (service:pacemaker-cts-dummyd@10):\tStarted node2\r\n     r192.168.123.105   (ocf::heartbeat:IPaddr2):\tStarted node2\r\nlsb-dummy\t(lsb:/usr/share/pacemaker/tests/cts/LSBDummy):  Started node2\r\n\r\nFailed Resource Actions:\r\n* Fencing_start_0 on node2 'unknown error' (1): call=77, status=Timed Out, exitreason='',\r\n    last-rc-change='Fri Jun 22 17:01:42 2018', queued=0ms, exec=60097ms\r\n* Fencing_start_0 on node3 'unknown error' (1): call=68, status=Timed Out, exitreason='',\r\n    last-rc-change='Thu Jun 21 14:39:14 2018', queued=0ms, exec=60084ms\r\n\r\nFailed Fencing Actions:\r\n* reboot of node4 failed: delegate=node2, client=pacemaker-controld.7817, origin=node3,\r\n    last-failed='Fri Jun 22 16:59:39 2018'\r\n\r\nFencing History:\r\n* reboot of node4 pending: client=pacemaker-controld.7817, origin=node3\r\n* reboot of node4 successful: delegate=node3, client=pacemaker-controld.7817, origin=node3,\r\n    last-successful='Mon Jun 25 14:13:28 2018'\r\n```\r\n\r\nconfigurable via console (just available if switch was given on the cmdline):\r\n```\r\n  R:    Show more details (node IDs, individual clone instances)\r\n  b:    Brief output\r\n* j:    Display pending state if 'record-pending' is enabled\r\n* m:    Show fence history\r\n```\r\nschema adapted and switchable via environment variable as well as cmdline-option\r\njust connecting to stonith if specified via cmdline-option or environment variable\r\n```\r\n[root@node2 ~]# crm_mon --help\r\n...\r\n -W, --watch-fencing\t\tListen for fencing events. For use with --external-agent\r\n -m, --fence-history[=value]\tShow fence history\r\n\t\t\t\t\t0=off, 1=failures, 2=add successful and pending (default),\r\n\t\t\t\t\t3=show full history without reduction to most recent of each flavor\r\n -L, --neg-locations[=value]\tDisplay negative location constraints [optionally filtered by id prefix]\r\n...\r\n[root@node2 ~]# crm_mon -m -1\r\n...\r\n[root@node2 ~]# FENCE_HISTORY=1 pcs config\r\nCluster Name: test\r\nCorosync Nodes:\r\n node2 node3 node4\r\n```\r\n\r\nxml-output available (always full history atm) to be processed by e.g. pcs\r\n``` xml\r\n<tickets>\r\n    </tickets>\r\n    <fence_history>\r\n        <fence_event target=\"node4\" action=\"reboot\" state=\"failed\" origin=\"node3\" client=\"pacemaker-controld.7817\" delegate=\"node2\" completed=\"Fri Jun 22 17:35:36 2018\" />\r\n        <fence_event target=\"node4\" action=\"reboot\" state=\"failed\" origin=\"node3\" client=\"pacemaker-controld.7817\" delegate=\"node2\" completed=\"Fri Jun 22 16:59:39 2018\" />\r\n        <fence_event target=\"node4\" action=\"reboot\" state=\"failed\" origin=\"node3\" client=\"pacemaker-controld.7817\" delegate=\"node2\" completed=\"Fri Jun 22 16:57:38 2018\" />\r\n    </fence_history>\r\n    <bans>\r\n```\r\n\r\nfollowing optional elements aren't filled yet but they are in the schema for highlevel-tooling to be prepared\r\n``` xml\r\n<optional>\r\n  <!-- especially interesting in the pending case -->\r\n  <attribute name=\"started\"> <text/> </attribute>\r\n</optional>\r\n<optional>\r\n  <!-- in case output is reduced to most recent -->\r\n  <attribute name=\"last-failed\"> <text/> </attribute>\r\n</optional>\r\n<optional>\r\n  <!-- in case output is reduced to most recent -->\r\n  <attribute name=\"last-successful\"> <text/> </attribute>\r\n</optional>\r\n<optional>\r\n  <!-- why was the fencing action triggered -->\r\n  <attribute name=\"exec-reason\"> <text/> </attribute>\r\n</optional>\r\n<optional>\r\n  <!-- details on the execution like failure reason -->\r\n  <attribute name=\"exec-details\"> <text/> </attribute>\r\n</optional> ","created_at":"2018-06-22T15:59:14Z","updated_at":"2018-06-25T13:51:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b046b42118eb4273203560a73088f41ae070792","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521/commits","review_comments_url":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521/comments","review_comment_url":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ClusterLabs/pacemaker/issues/1521/comments","statuses_url":"https://api.github.com/repos/ClusterLabs/pacemaker/statuses/a3a8594fad8c1648b4160c946333377b1aa0d597","head":{"label":"wenningerk:crm_mon_add_fence_history_2.0","ref":"crm_mon_add_fence_history_2.0","sha":"a3a8594fad8c1648b4160c946333377b1aa0d597","user":{"login":"wenningerk","id":15136666,"node_id":"MDQ6VXNlcjE1MTM2NjY2","avatar_url":"https://avatars2.githubusercontent.com/u/15136666?v=4","gravatar_id":"","url":"https://api.github.com/users/wenningerk","html_url":"https://github.com/wenningerk","followers_url":"https://api.github.com/users/wenningerk/followers","following_url":"https://api.github.com/users/wenningerk/following{/other_user}","gists_url":"https://api.github.com/users/wenningerk/gists{/gist_id}","starred_url":"https://api.github.com/users/wenningerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenningerk/subscriptions","organizations_url":"https://api.github.com/users/wenningerk/orgs","repos_url":"https://api.github.com/users/wenningerk/repos","events_url":"https://api.github.com/users/wenningerk/events{/privacy}","received_events_url":"https://api.github.com/users/wenningerk/received_events","type":"User","site_admin":false},"repo":{"id":58066294,"node_id":"MDEwOlJlcG9zaXRvcnk1ODA2NjI5NA==","name":"pacemaker","full_name":"wenningerk/pacemaker","owner":{"login":"wenningerk","id":15136666,"node_id":"MDQ6VXNlcjE1MTM2NjY2","avatar_url":"https://avatars2.githubusercontent.com/u/15136666?v=4","gravatar_id":"","url":"https://api.github.com/users/wenningerk","html_url":"https://github.com/wenningerk","followers_url":"https://api.github.com/users/wenningerk/followers","following_url":"https://api.github.com/users/wenningerk/following{/other_user}","gists_url":"https://api.github.com/users/wenningerk/gists{/gist_id}","starred_url":"https://api.github.com/users/wenningerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenningerk/subscriptions","organizations_url":"https://api.github.com/users/wenningerk/orgs","repos_url":"https://api.github.com/users/wenningerk/repos","events_url":"https://api.github.com/users/wenningerk/events{/privacy}","received_events_url":"https://api.github.com/users/wenningerk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wenningerk/pacemaker","description":"Pacemaker is an advanced, scalable High-Availability cluster resource manager","fork":true,"url":"https://api.github.com/repos/wenningerk/pacemaker","forks_url":"https://api.github.com/repos/wenningerk/pacemaker/forks","keys_url":"https://api.github.com/repos/wenningerk/pacemaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wenningerk/pacemaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wenningerk/pacemaker/teams","hooks_url":"https://api.github.com/repos/wenningerk/pacemaker/hooks","issue_events_url":"https://api.github.com/repos/wenningerk/pacemaker/issues/events{/number}","events_url":"https://api.github.com/repos/wenningerk/pacemaker/events","assignees_url":"https://api.github.com/repos/wenningerk/pacemaker/assignees{/user}","branches_url":"https://api.github.com/repos/wenningerk/pacemaker/branches{/branch}","tags_url":"https://api.github.com/repos/wenningerk/pacemaker/tags","blobs_url":"https://api.github.com/repos/wenningerk/pacemaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wenningerk/pacemaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wenningerk/pacemaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/wenningerk/pacemaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wenningerk/pacemaker/statuses/{sha}","languages_url":"https://api.github.com/repos/wenningerk/pacemaker/languages","stargazers_url":"https://api.github.com/repos/wenningerk/pacemaker/stargazers","contributors_url":"https://api.github.com/repos/wenningerk/pacemaker/contributors","subscribers_url":"https://api.github.com/repos/wenningerk/pacemaker/subscribers","subscription_url":"https://api.github.com/repos/wenningerk/pacemaker/subscription","commits_url":"https://api.github.com/repos/wenningerk/pacemaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/wenningerk/pacemaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/wenningerk/pacemaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/wenningerk/pacemaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/wenningerk/pacemaker/contents/{+path}","compare_url":"https://api.github.com/repos/wenningerk/pacemaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wenningerk/pacemaker/merges","archive_url":"https://api.github.com/repos/wenningerk/pacemaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wenningerk/pacemaker/downloads","issues_url":"https://api.github.com/repos/wenningerk/pacemaker/issues{/number}","pulls_url":"https://api.github.com/repos/wenningerk/pacemaker/pulls{/number}","milestones_url":"https://api.github.com/repos/wenningerk/pacemaker/milestones{/number}","notifications_url":"https://api.github.com/repos/wenningerk/pacemaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wenningerk/pacemaker/labels{/name}","releases_url":"https://api.github.com/repos/wenningerk/pacemaker/releases{/id}","deployments_url":"https://api.github.com/repos/wenningerk/pacemaker/deployments","created_at":"2016-05-04T16:15:09Z","updated_at":"2018-06-11T10:59:55Z","pushed_at":"2018-06-25T08:11:18Z","git_url":"git://github.com/wenningerk/pacemaker.git","ssh_url":"git@github.com:wenningerk/pacemaker.git","clone_url":"https://github.com/wenningerk/pacemaker.git","svn_url":"https://github.com/wenningerk/pacemaker","homepage":"http://www.clusterlabs.org","size":51369,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ClusterLabs:2.0","ref":"2.0","sha":"1aead0acdabc733a52e027693d0c2bca7eed5875","user":{"login":"ClusterLabs","id":574912,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NDkxMg==","avatar_url":"https://avatars2.githubusercontent.com/u/574912?v=4","gravatar_id":"","url":"https://api.github.com/users/ClusterLabs","html_url":"https://github.com/ClusterLabs","followers_url":"https://api.github.com/users/ClusterLabs/followers","following_url":"https://api.github.com/users/ClusterLabs/following{/other_user}","gists_url":"https://api.github.com/users/ClusterLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterLabs/subscriptions","organizations_url":"https://api.github.com/users/ClusterLabs/orgs","repos_url":"https://api.github.com/users/ClusterLabs/repos","events_url":"https://api.github.com/users/ClusterLabs/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":2304962,"node_id":"MDEwOlJlcG9zaXRvcnkyMzA0OTYy","name":"pacemaker","full_name":"ClusterLabs/pacemaker","owner":{"login":"ClusterLabs","id":574912,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3NDkxMg==","avatar_url":"https://avatars2.githubusercontent.com/u/574912?v=4","gravatar_id":"","url":"https://api.github.com/users/ClusterLabs","html_url":"https://github.com/ClusterLabs","followers_url":"https://api.github.com/users/ClusterLabs/followers","following_url":"https://api.github.com/users/ClusterLabs/following{/other_user}","gists_url":"https://api.github.com/users/ClusterLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterLabs/subscriptions","organizations_url":"https://api.github.com/users/ClusterLabs/orgs","repos_url":"https://api.github.com/users/ClusterLabs/repos","events_url":"https://api.github.com/users/ClusterLabs/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterLabs/pacemaker","description":"Pacemaker is an advanced, scalable High-Availability cluster resource manager","fork":false,"url":"https://api.github.com/repos/ClusterLabs/pacemaker","forks_url":"https://api.github.com/repos/ClusterLabs/pacemaker/forks","keys_url":"https://api.github.com/repos/ClusterLabs/pacemaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterLabs/pacemaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterLabs/pacemaker/teams","hooks_url":"https://api.github.com/repos/ClusterLabs/pacemaker/hooks","issue_events_url":"https://api.github.com/repos/ClusterLabs/pacemaker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterLabs/pacemaker/events","assignees_url":"https://api.github.com/repos/ClusterLabs/pacemaker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterLabs/pacemaker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterLabs/pacemaker/tags","blobs_url":"https://api.github.com/repos/ClusterLabs/pacemaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterLabs/pacemaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterLabs/pacemaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterLabs/pacemaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterLabs/pacemaker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterLabs/pacemaker/languages","stargazers_url":"https://api.github.com/repos/ClusterLabs/pacemaker/stargazers","contributors_url":"https://api.github.com/repos/ClusterLabs/pacemaker/contributors","subscribers_url":"https://api.github.com/repos/ClusterLabs/pacemaker/subscribers","subscription_url":"https://api.github.com/repos/ClusterLabs/pacemaker/subscription","commits_url":"https://api.github.com/repos/ClusterLabs/pacemaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterLabs/pacemaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterLabs/pacemaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterLabs/pacemaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterLabs/pacemaker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterLabs/pacemaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterLabs/pacemaker/merges","archive_url":"https://api.github.com/repos/ClusterLabs/pacemaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterLabs/pacemaker/downloads","issues_url":"https://api.github.com/repos/ClusterLabs/pacemaker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterLabs/pacemaker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterLabs/pacemaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterLabs/pacemaker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterLabs/pacemaker/releases{/id}","deployments_url":"https://api.github.com/repos/ClusterLabs/pacemaker/deployments","created_at":"2011-09-01T00:08:16Z","updated_at":"2018-06-25T12:54:23Z","pushed_at":"2018-06-25T08:11:19Z","git_url":"git://github.com/ClusterLabs/pacemaker.git","ssh_url":"git@github.com:ClusterLabs/pacemaker.git","clone_url":"https://github.com/ClusterLabs/pacemaker.git","svn_url":"https://github.com/ClusterLabs/pacemaker","homepage":"http://www.clusterlabs.org","size":51238,"stargazers_count":522,"watchers_count":522,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":218,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":218,"open_issues":12,"watchers":522,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521"},"html":{"href":"https://github.com/ClusterLabs/pacemaker/pull/1521"},"issue":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/issues/1521"},"comments":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/issues/1521/comments"},"review_comments":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521/comments"},"review_comment":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/pulls/1521/commits"},"statuses":{"href":"https://api.github.com/repos/ClusterLabs/pacemaker/statuses/a3a8594fad8c1648b4160c946333377b1aa0d597"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kgaillot"}}