{
 "systemd 與 systemctl 唯讀查詢#1": {
  "type": "table",
  "head": [
   "重點",
   "做法"
  ],
  "rows": [
   [
    "服務不存在",
    "show 退出碼仍為 0,查載入狀態"
   ],
   [
    "活動狀態",
    "active、inactive、failed"
   ],
   [
    "重啟次數屬性",
    "找出反覆當掉的服務"
   ],
   [
    "enabled",
    "代表開機自動啟動"
   ]
  ],
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   4
  ]
 },
 "systemd 與 systemctl 唯讀查詢#4": {
  "type": "table",
  "head": [
   "屬性",
   "值"
  ],
  "rows": [
   [
    "LoadState",
    "loaded"
   ],
   [
    "ActiveState",
    "active"
   ],
   [
    "SubState",
    "running"
   ],
   [
    "MainPID",
    "1234"
   ]
  ],
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   4
  ]
 },
 "systemd 與 systemctl 唯讀查詢#5": {
  "type": "bar",
  "labels": [
   "ssh",
   "nginx",
   "apache2",
   "mysql",
   "mariadb",
   "mongod"
  ],
  "values": [
   22,
   80,
   80,
   3306,
   3306,
   27017
  ],
  "unit": "埠",
  "reveal": [
   0,
   0,
   0,
   6
  ]
 },
 "Apache 與 Nginx 檢查#1": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   3,
   3,
   3,
   3,
   3
  ],
  "nodes": [
   {
    "label": "連接埠",
    "sub": "有在監聽?",
    "color": 0
   },
   {
    "label": "HTTP 探測",
    "sub": "有回應?",
    "color": 1
   },
   {
    "label": "設定語法檢查",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "Apache 與 Nginx 檢查#6": {
  "type": "table",
  "head": [
   "伺服器",
   "測試指令"
  ],
  "rows": [
   [
    "nginx",
    "/usr/sbin/nginx -t"
   ],
   [
    "apache",
    "/usr/sbin/apache2ctl configtest"
   ]
  ],
  "reveal": [
   0,
   2,
   2
  ]
 },
 "MySQL 與 MongoDB 狀態檢查#1": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3,
   3
  ],
  "nodes": [
   {
    "label": "systemd 狀態",
    "sub": "單元是否 active",
    "color": 0
   },
   {
    "label": "連接埠",
    "sub": "不需帳號密碼",
    "color": 1
   },
   {
    "label": "應用層 ping",
    "sub": "選配,低權限帳號",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "受控的服務重啟#1": {
  "type": "table",
  "head": [
   "規則",
   "重點"
  ],
  "rows": [
   [
    "1 預設唯讀",
    "變更工具需人工確認"
   ],
   [
    "2 只提供必要動作",
    "只有 Nginx、Apache"
   ],
   [
    "3 前後都檢查",
    "先設定檢查,再查狀態"
   ],
   [
    "4 冷卻時間",
    "避免連續重啟"
   ],
   [
    "5 低權限帳號",
    "sudoers 精準授權"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ]
 },
 "受控的服務重啟#2": {
  "type": "table",
  "head": [
   "sudoers 要點",
   "說明"
  ],
  "rows": [
   [
    "絕對路徑與完整參數",
    "參數需完全相符"
   ],
   [
    "不用星號萬用字元",
    "不授權 shell、編輯器"
   ],
   [
    "權限設為 440",
    "visudo 檢查語法"
   ],
   [
    "另一種做法",
    "polkit 規則"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ]
 },
 "受控的服務重啟#4": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "建立專用帳號",
    "sub": "不能登入的 shell",
    "color": 0
   },
   {
    "label": "加入日誌群組",
    "sub": "adm、systemd-journal",
    "color": 1
   },
   {
    "label": "用 visudo 編輯",
    "sub": "專屬 sudoers 檔",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "受控的服務重啟#5": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2
  ],
  "cards": [
   {
    "title": "設定測試",
    "points": [
     "nginx -t",
     "apache2ctl configtest"
    ]
   },
   {
    "title": "服務控制",
    "points": [
     "nginx reload / restart",
     "apache2 reload / restart"
    ]
   }
  ]
 },
 "受控的服務重啟#7": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   0,
   1,
   4
  ],
  "nodes": [
   {
    "label": "檢查冷卻時間",
    "sub": "60 秒",
    "color": 0
   },
   {
    "label": "測試設定檔",
    "sub": "失敗就中止",
    "color": 1
   },
   {
    "label": "sudo 執行",
    "color": 2
   },
   {
    "label": "回傳服務狀態",
    "color": 3,
    "kind": "end"
   }
  ]
 }
}