Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2025
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.92 KB | Source Code | 0 0
  1. [
  2. {
  3. "id": "23d2490305cb0609",
  4. "type": "group",
  5. "z": "1e32d6e89ce21de1",
  6. "name": "MainOffice Status",
  7. "style": {
  8. "stroke": "#ffff00",
  9. "label": true,
  10. "color": "#000000",
  11. "fill": "#ffff00"
  12. },
  13. "nodes": [
  14. "2eda9e9146d0c28a",
  15. "95dbde41aedc2207",
  16. "fde7ace2244b6fca",
  17. "3282312c2ce6c0ec",
  18. "ec4e2a623b721c9d",
  19. "692678513817a5c4",
  20. "546d291493483958",
  21. "3f9c0d455921ed2a",
  22. "e70a45b001a9ee12",
  23. "e20b3a694b4cacde",
  24. "56b150a54d99e71d",
  25. "6d96c26b0c61368e",
  26. "da43c62cb7cd668c",
  27. "6b633b0827291612",
  28. "2b9cb8fbeab5f04b",
  29. "307619128adbc77b",
  30. "9f9f42d0b01c4f28",
  31. "96ac73962e0fa3fd"
  32. ],
  33. "x": 1074,
  34. "y": 239,
  35. "w": 862,
  36. "h": 389.5
  37. },
  38. {
  39. "id": "2eda9e9146d0c28a",
  40. "type": "ui-button",
  41. "z": "1e32d6e89ce21de1",
  42. "g": "23d2490305cb0609",
  43. "group": "811a74e1e67d6a78",
  44. "name": "Clear Badge Print Queue",
  45. "label": "Clear Badge Print Queue",
  46. "order": 3,
  47. "width": 0,
  48. "height": 0,
  49. "tooltip": "",
  50. "color": "",
  51. "bgcolor": "",
  52. "className": "",
  53. "icon": "",
  54. "payload": "",
  55. "payloadType": "str",
  56. "topic": "topic",
  57. "topicType": "msg",
  58. "x": 1210,
  59. "y": 500,
  60. "wires": [
  61. [
  62. "692678513817a5c4"
  63. ]
  64. ]
  65. },
  66. {
  67. "id": "95dbde41aedc2207",
  68. "type": "ui-button",
  69. "z": "1e32d6e89ce21de1",
  70. "g": "23d2490305cb0609",
  71. "group": "811a74e1e67d6a78",
  72. "name": "Reboot Badge Server",
  73. "label": "Reboot Badge Server",
  74. "order": 5,
  75. "width": 0,
  76. "height": 0,
  77. "tooltip": "",
  78. "color": "",
  79. "bgcolor": "",
  80. "className": "",
  81. "icon": "",
  82. "payload": "",
  83. "payloadType": "str",
  84. "topic": "topic",
  85. "topicType": "msg",
  86. "x": 1200,
  87. "y": 580,
  88. "wires": [
  89. [
  90. "ec4e2a623b721c9d"
  91. ]
  92. ]
  93. },
  94. {
  95. "id": "fde7ace2244b6fca",
  96. "type": "ui-text",
  97. "z": "1e32d6e89ce21de1",
  98. "g": "23d2490305cb0609",
  99. "group": "811a74e1e67d6a78",
  100. "order": 2,
  101. "width": 0,
  102. "height": 0,
  103. "name": "Step One",
  104. "label": "Step One",
  105. "format": "{{msg.payload}}",
  106. "layout": "row-spread",
  107. "x": 1160,
  108. "y": 460,
  109. "wires": []
  110. },
  111. {
  112. "id": "3282312c2ce6c0ec",
  113. "type": "ui-text",
  114. "z": "1e32d6e89ce21de1",
  115. "g": "23d2490305cb0609",
  116. "group": "811a74e1e67d6a78",
  117. "order": 4,
  118. "width": 0,
  119. "height": 0,
  120. "name": "Step Two",
  121. "label": "Step Two (if step one does not fix it)",
  122. "format": "{{msg.payload}}",
  123. "layout": "row-spread",
  124. "x": 1160,
  125. "y": 540,
  126. "wires": []
  127. },
  128. {
  129. "id": "ec4e2a623b721c9d",
  130. "type": "exec",
  131. "z": "1e32d6e89ce21de1",
  132. "g": "23d2490305cb0609",
  133. "command": "ssh [email protected] qm reboot 102",
  134. "addpay": false,
  135. "append": "",
  136. "useSpawn": "false",
  137. "timer": "",
  138. "winHide": false,
  139. "oldrc": false,
  140. "name": "",
  141. "x": 1475,
  142. "y": 580,
  143. "wires": [
  144. [
  145. "3f9c0d455921ed2a",
  146. "e20b3a694b4cacde"
  147. ],
  148. [],
  149. []
  150. ]
  151. },
  152. {
  153. "id": "692678513817a5c4",
  154. "type": "exec",
  155. "z": "1e32d6e89ce21de1",
  156. "g": "23d2490305cb0609",
  157. "command": "ssh -i /home/node-red-user/.ssh/id_rsa_printqueue [email protected] powershell.exe -NoProfile -ExecutionPolicy Bypass -EncodedCommand RwBlAHQALQBQAHIAaQBuAHQASgBvAGIAIAAtAFAAcgBpAG4AdABlAHIATgBhAG0AZQAgACIARQB2AG8AbABpAHMAIABQAHIAaQBtAGEAYwB5ACAAMgAiACAALQBFAHIAcgBvAHIAQQBjAHQAaQBvAG4AIABTAGkAbABlAG4AdABsAHkAQwBvAG4AdABpAG4AdQBlACAAfAAgAFIAZQBtAG8AdgBlAC0AUAByAGkAbgB0AEoAbwBiACAALQBFAHIAcgBvAHIAQQBjAHQAaQBvAG4AIABTAGkAbABlAG4AdABsAHkAQwBvAG4AdABpAG4AdQBlAA==",
  158. "addpay": false,
  159. "append": "",
  160. "useSpawn": "false",
  161. "timer": "",
  162. "winHide": false,
  163. "oldrc": false,
  164. "name": "Command",
  165. "x": 1410,
  166. "y": 500,
  167. "wires": [
  168. [
  169. "546d291493483958",
  170. "e70a45b001a9ee12"
  171. ],
  172. [],
  173. []
  174. ]
  175. },
  176. {
  177. "id": "546d291493483958",
  178. "type": "ui-notification",
  179. "z": "1e32d6e89ce21de1",
  180. "g": "23d2490305cb0609",
  181. "position": "top right",
  182. "displayTime": "3",
  183. "outputs": 0,
  184. "name": "Queue Notification",
  185. "x": 1610,
  186. "y": 500,
  187. "wires": []
  188. },
  189. {
  190. "id": "3f9c0d455921ed2a",
  191. "type": "ui-notification",
  192. "z": "1e32d6e89ce21de1",
  193. "g": "23d2490305cb0609",
  194. "position": "top right",
  195. "displayTime": "3",
  196. "outputs": 0,
  197. "name": "Reboot Notification",
  198. "x": 1750,
  199. "y": 580,
  200. "wires": []
  201. },
  202. {
  203. "id": "e70a45b001a9ee12",
  204. "type": "template",
  205. "z": "1e32d6e89ce21de1",
  206. "g": "23d2490305cb0609",
  207. "name": "",
  208. "field": "payload",
  209. "fieldType": "msg",
  210. "format": "handlebars",
  211. "syntax": "mustache",
  212. "template": "Queue Cleared\n",
  213. "output": "str",
  214. "x": 1580,
  215. "y": 460,
  216. "wires": [
  217. [
  218. "96ac73962e0fa3fd"
  219. ]
  220. ]
  221. },
  222. {
  223. "id": "e20b3a694b4cacde",
  224. "type": "template",
  225. "z": "1e32d6e89ce21de1",
  226. "g": "23d2490305cb0609",
  227. "name": "",
  228. "field": "payload",
  229. "fieldType": "msg",
  230. "format": "handlebars",
  231. "syntax": "mustache",
  232. "template": "Badge Server Rebooted",
  233. "output": "str",
  234. "x": 1700,
  235. "y": 540,
  236. "wires": [
  237. [
  238. "96ac73962e0fa3fd"
  239. ]
  240. ]
  241. },
  242. {
  243. "id": "56b150a54d99e71d",
  244. "type": "function",
  245. "z": "1e32d6e89ce21de1",
  246. "g": "23d2490305cb0609",
  247. "name": "Check Servers",
  248. "func": "// List of servers to check\nconst servers = [\n { name: 'BackupServer', host: '10.0.0.242' },\n { name: 'PrintServer', host: '10.0.0.205' },\n { name: 'ProxyServer1', host: '10.0.0.211' },\n { name: 'ProxyServer2', host: '10.0.0.240' },\n { name: 'ProxyServer3', host: '10.0.0.7' },\n { name: 'DatabaseServer', host: '10.0.0.33' },\n { name: 'GateControl', host: '10.0.0.252'}\n];\n\n// Placeholder for ping functionality\n// In a real environment, you would use an appropriate library\nconst ping = {\n promise: {\n probe: async (host) => {\n // This is a mock. Replace with actual ping logic.\n return { alive: Math.random() > 0.1 }; // Simulate 90% success rate\n }\n }\n};\n\n// Perform pings asynchronously\nasync function pingAll() {\n const failed = [];\n const failedNames = [];\n const pingPromises = servers.map(async (server) => {\n try {\n const res = await ping.promise.probe(server.host, { timeout: 5 });\n if (!res.alive) {\n failed.push(server.host);\n failedNames.push(server.name);\n }\n return res.alive;\n } catch (e) {\n failed.push(server.host);\n failedNames.push(server.name);\n return false;\n }\n });\n\n const results = await Promise.all(pingPromises);\n const allSuccessful = results.every(result => result === true);\n\n msg.payload = allSuccessful;\n msg.who = allSuccessful ? [] : failed;\n if (!allSuccessful) {\n msg.failedServers = failedNames.join(', ');\n }\n\n // Update node status\n if (allSuccessful) {\n node.status({ fill: 'green', shape: 'dot', text: 'All servers OK' });\n } else {\n node.status({ fill: 'red', shape: 'ring', text: `Failed: ${failed.join(', ')}` });\n }\n\n return msg;\n}\n\n// Execute pings and return message\nreturn pingAll();",
  249. "outputs": 1,
  250. "noerr": 0,
  251. "initialize": "",
  252. "finalize": "",
  253. "libs": [],
  254. "x": 1360,
  255. "y": 340,
  256. "wires": [
  257. [
  258. "6d96c26b0c61368e",
  259. "6b633b0827291612",
  260. "2b9cb8fbeab5f04b"
  261. ]
  262. ]
  263. },
  264. {
  265. "id": "6d96c26b0c61368e",
  266. "type": "ui_led",
  267. "z": "1e32d6e89ce21de1",
  268. "g": "928dac7e3004687d",
  269. "group": "894f972b49de2bb4",
  270. "order": 9,
  271. "width": 0,
  272. "height": 0,
  273. "label": "MainOffice Servers",
  274. "labelPlacement": "left",
  275. "labelAlignment": "left",
  276. "colorForValue": [
  277. {
  278. "color": "#ff0000",
  279. "value": "false",
  280. "valueType": "bool"
  281. },
  282. {
  283. "color": "#00ff00",
  284. "value": "true",
  285. "valueType": "bool"
  286. }
  287. ],
  288. "allowColorForValueInMessage": false,
  289. "shape": "circle",
  290. "showGlow": true,
  291. "name": "MainOffice Servers",
  292. "x": 1600,
  293. "y": 340,
  294. "wires": []
  295. },
  296. {
  297. "id": "da43c62cb7cd668c",
  298. "type": "ui-text",
  299. "z": "1e32d6e89ce21de1",
  300. "g": "23d2490305cb0609",
  301. "group": "894f972b49de2bb4",
  302. "order": 10,
  303. "width": 0,
  304. "height": 0,
  305. "name": "MainOfficeServersTxt",
  306. "label": "Issue List:",
  307. "format": "{{msg.payload}}",
  308. "layout": "row-left",
  309. "x": 1810,
  310. "y": 420,
  311. "wires": []
  312. },
  313. {
  314. "id": "6b633b0827291612",
  315. "type": "change",
  316. "z": "1e32d6e89ce21de1",
  317. "g": "23d2490305cb0609",
  318. "name": "",
  319. "rules": [
  320. {
  321. "t": "set",
  322. "p": "payload",
  323. "pt": "msg",
  324. "to": "failedServers",
  325. "tot": "msg"
  326. }
  327. ],
  328. "action": "",
  329. "property": "",
  330. "from": "",
  331. "to": "",
  332. "reg": false,
  333. "x": 1600,
  334. "y": 420,
  335. "wires": [
  336. [
  337. "da43c62cb7cd668c"
  338. ]
  339. ]
  340. },
  341. {
  342. "id": "2b9cb8fbeab5f04b",
  343. "type": "switch",
  344. "z": "1e32d6e89ce21de1",
  345. "g": "23d2490305cb0609",
  346. "name": "",
  347. "property": "payload",
  348. "propertyType": "msg",
  349. "rules": [
  350. {
  351. "t": "true"
  352. },
  353. {
  354. "t": "false"
  355. }
  356. ],
  357. "checkall": "true",
  358. "repair": false,
  359. "outputs": 2,
  360. "x": 1570,
  361. "y": 380,
  362. "wires": [
  363. [
  364. "307619128adbc77b"
  365. ],
  366. []
  367. ]
  368. },
  369. {
  370. "id": "307619128adbc77b",
  371. "type": "change",
  372. "z": "1e32d6e89ce21de1",
  373. "g": "23d2490305cb0609",
  374. "name": "",
  375. "rules": [
  376. {
  377. "t": "set",
  378. "p": "payload",
  379. "pt": "msg",
  380. "to": "All OK!",
  381. "tot": "str"
  382. }
  383. ],
  384. "action": "",
  385. "property": "",
  386. "from": "",
  387. "to": "",
  388. "reg": false,
  389. "x": 1720,
  390. "y": 380,
  391. "wires": [
  392. [
  393. "da43c62cb7cd668c"
  394. ]
  395. ]
  396. },
  397. {
  398. "id": "9f9f42d0b01c4f28",
  399. "type": "inject",
  400. "z": "1e32d6e89ce21de1",
  401. "g": "23d2490305cb0609",
  402. "name": "",
  403. "props": [
  404. {
  405. "p": "payload"
  406. },
  407. {
  408. "p": "topic",
  409. "vt": "str"
  410. }
  411. ],
  412. "repeat": "15",
  413. "crontab": "",
  414. "once": true,
  415. "onceDelay": 0.1,
  416. "topic": "",
  417. "payload": "",
  418. "payloadType": "date",
  419. "x": 1290,
  420. "y": 280,
  421. "wires": [
  422. [
  423. "56b150a54d99e71d"
  424. ]
  425. ]
  426. },
  427. {
  428. "id": "96ac73962e0fa3fd",
  429. "type": "http request",
  430. "z": "1e32d6e89ce21de1",
  431. "g": "23d2490305cb0609",
  432. "name": "",
  433. "method": "POST",
  434. "ret": "txt",
  435. "paytoqs": "ignore",
  436. "url": "https://ntfy.example.com/MyServers",
  437. "tls": "",
  438. "persist": false,
  439. "proxy": "",
  440. "authType": "",
  441. "x": 1830,
  442. "y": 500,
  443. "wires": [
  444. []
  445. ]
  446. },
  447. {
  448. "id": "811a74e1e67d6a78",
  449. "type": "ui_group",
  450. "name": "System Controls",
  451. "page": "c04e10945eb62c25",
  452. "width": "6",
  453. "height": "1",
  454. "order": -1,
  455. "showTitle": true,
  456. "tab": "c04e10945eb62c25"
  457. },
  458. {
  459. "id": "894f972b49de2bb4",
  460. "type": "ui-group",
  461. "name": "Servers",
  462. "page": "c04e10945eb62c25",
  463. "width": 6,
  464. "height": 1,
  465. "order": 2,
  466. "showTitle": true,
  467. "className": "",
  468. "visible": "true",
  469. "disabled": "false",
  470. "groupType": "default"
  471. },
  472. {
  473. "id": "c04e10945eb62c25",
  474. "type": "ui-page",
  475. "name": "Main Control",
  476. "ui": "45ca1105dfb31f68",
  477. "path": "/page1",
  478. "icon": "home",
  479. "layout": "grid",
  480. "theme": "63fdccd97cf5caec",
  481. "breakpoints": [
  482. {
  483. "name": "Default",
  484. "px": "0",
  485. "cols": "3"
  486. },
  487. {
  488. "name": "Tablet",
  489. "px": "576",
  490. "cols": "6"
  491. },
  492. {
  493. "name": "Small Desktop",
  494. "px": "768",
  495. "cols": "9"
  496. },
  497. {
  498. "name": "Desktop",
  499. "px": "1024",
  500. "cols": "12"
  501. }
  502. ],
  503. "order": 1,
  504. "className": "",
  505. "visible": "true",
  506. "disabled": "false"
  507. },
  508. {
  509. "id": "45ca1105dfb31f68",
  510. "type": "ui-base",
  511. "name": "My Dashboard",
  512. "path": "/dashboard",
  513. "appIcon": "",
  514. "includeClientData": true,
  515. "acceptsClientConfig": [
  516. "ui-notification",
  517. "ui-control"
  518. ],
  519. "showPathInSidebar": false,
  520. "headerContent": "page",
  521. "navigationStyle": "default",
  522. "titleBarStyle": "default",
  523. "showReconnectNotification": true,
  524. "notificationDisplayTime": 1,
  525. "showDisconnectNotification": true,
  526. "allowInstall": true
  527. },
  528. {
  529. "id": "63fdccd97cf5caec",
  530. "type": "ui-theme",
  531. "name": "Default Theme",
  532. "colors": {
  533. "surface": "#ffffff",
  534. "primary": "#0094CE",
  535. "bgPage": "#eeeeee",
  536. "groupBg": "#ffffff",
  537. "groupOutline": "#cccccc"
  538. },
  539. "sizes": {
  540. "density": "default",
  541. "pagePadding": "12px",
  542. "groupGap": "12px",
  543. "groupBorderRadius": "4px",
  544. "widgetGap": "12px"
  545. }
  546. },
  547. {
  548. "id": "9f14354163ed49e0",
  549. "type": "global-config",
  550. "env": [],
  551. "modules": {
  552. "@flowfuse/node-red-dashboard": "1.24.2"
  553. }
  554. }
  555. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement