Skip to content

Commit a053600

Browse files
authored
🔀 Merge pull request #92 from SaaShup/23_socker_error
Add a log when Docker socket is not writable
2 parents aee6078 + fd1c23d commit a053600

File tree

3 files changed

+126
-40
lines changed

3 files changed

+126
-40
lines changed

‎flows.json

Lines changed: 117 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,9 @@
15901590
"cdf0ca856701cd23"
15911591
],
15921592
[],
1593-
[]
1593+
[
1594+
"c9f9930a51ca8c8f"
1595+
]
15941596
]
15951597
},
15961598
{
@@ -2540,6 +2542,72 @@
25402542
]
25412543
]
25422544
},
2545+
{
2546+
"id": "c9f9930a51ca8c8f",
2547+
"type": "switch",
2548+
"z": "a827fd671d6a227e",
2549+
"name": "",
2550+
"property": "payload.code",
2551+
"propertyType": "msg",
2552+
"rules": [
2553+
{
2554+
"t": "eq",
2555+
"v": "7",
2556+
"vt": "num"
2557+
}
2558+
],
2559+
"checkall": "true",
2560+
"repair": false,
2561+
"outputs": 1,
2562+
"x": 890,
2563+
"y": 880,
2564+
"wires": [
2565+
[
2566+
"d3292e92a3507d2c"
2567+
]
2568+
]
2569+
},
2570+
{
2571+
"id": "d3292e92a3507d2c",
2572+
"type": "change",
2573+
"z": "a827fd671d6a227e",
2574+
"name": "output",
2575+
"rules": [
2576+
{
2577+
"t": "set",
2578+
"p": "output.docker",
2579+
"pt": "msg",
2580+
"to": "error",
2581+
"tot": "str"
2582+
},
2583+
{
2584+
"t": "set",
2585+
"p": "payload",
2586+
"pt": "msg",
2587+
"to": "output",
2588+
"tot": "msg"
2589+
},
2590+
{
2591+
"t": "set",
2592+
"p": "payload.configured",
2593+
"pt": "msg",
2594+
"to": "socket error",
2595+
"tot": "str"
2596+
}
2597+
],
2598+
"action": "",
2599+
"property": "",
2600+
"from": "",
2601+
"to": "",
2602+
"reg": false,
2603+
"x": 1070,
2604+
"y": 880,
2605+
"wires": [
2606+
[
2607+
"7581057e6d016ca9"
2608+
]
2609+
]
2610+
},
25432611
{
25442612
"id": "e974d3bd502f614f",
25452613
"type": "http in",
@@ -5570,8 +5638,8 @@
55705638
"syntax": "mustache",
55715639
"template": "# HELP netbox_docker_agent_container_running Show if a container is running\n# TYPE netbox_docker_agent_container_running gauge\n{{#container.running}}\nnetbox_docker_agent_container_running{name=\"{{{Names.0}}}\", state=\"{{{ State }}}\", status=\"{{{ Status }}}\"} 1\n{{/container.running}}\n\n# HELP netbox_docker_agent_container_exited Show if a container is exited\n# TYPE netbox_docker_agent_container_exited gauge\n{{#container.exited}}\nnetbox_docker_agent_container_exited{name=\"{{{Names.0}}}\", state=\"{{{ State }}}\", status=\"{{{ Status }}}\"} 1\n{{/container.exited}}\n\n# HELP netbox_docker_agent_container_stopped Show if a container is exited\n# TYPE netbox_docker_agent_container_stopped gauge\n{{#container.stopped}}\nnetbox_docker_agent_container_stopped{name=\"{{{Names.0}}}\", state=\"{{{ State }}}\", status=\"{{{ Status }}}\"} 1\n{{/container.stopped}}\n\n# HELP netbox_docker_agent_docker_daemon Show if the connection to the daemon is working\n# TYPE netbox_docker_agent_docker_daemon gauge\nnetbox_docker_agent_docker_daemon{socket=\"/var/run/docker.socket\"} {{container.docker_daemon}}\n\n# HELP netbox_docker_agent_netbox_error_response Show the netbox error response counter\n# TYPE netbox_docker_agent_netbox_error_response counter\nnetbox_docker_agent_netbox_error_response{} {{global.errorCounter}}",
55725640
"output": "str",
5573-
"x": 990,
5574-
"y": 180,
5641+
"x": 1010,
5642+
"y": 120,
55755643
"wires": [
55765644
[
55775645
"cdecbe9f078ed45b"
@@ -5641,7 +5709,7 @@
56415709
"to": "",
56425710
"reg": false,
56435711
"x": 1220,
5644-
"y": 180,
5712+
"y": 120,
56455713
"wires": [
56465714
[]
56475715
]
@@ -5651,23 +5719,13 @@
56515719
"type": "inject",
56525720
"z": "3ee57a9d7dc5fae7",
56535721
"name": "",
5654-
"props": [
5655-
{
5656-
"p": "payload"
5657-
},
5658-
{
5659-
"p": "topic",
5660-
"vt": "str"
5661-
}
5662-
],
5722+
"props": [],
56635723
"repeat": "5",
56645724
"crontab": "",
56655725
"once": true,
56665726
"onceDelay": 0.1,
56675727
"topic": "",
5668-
"payload": "",
5669-
"payloadType": "date",
5670-
"x": 190,
5728+
"x": 170,
56715729
"y": 80,
56725730
"wires": [
56735731
[
@@ -5776,8 +5834,8 @@
57765834
"checkall": "true",
57775835
"repair": false,
57785836
"outputs": 1,
5779-
"x": 390,
5780-
"y": 460,
5837+
"x": 610,
5838+
"y": 420,
57815839
"wires": [
57825840
[
57835841
"efc97803a70d7841",
@@ -5798,8 +5856,8 @@
57985856
"targetType": "msg",
57995857
"statusVal": "payload",
58005858
"statusType": "auto",
5801-
"x": 780,
5802-
"y": 460,
5859+
"x": 1000,
5860+
"y": 420,
58035861
"wires": []
58045862
},
58055863
{
@@ -5821,8 +5879,8 @@
58215879
"from": "",
58225880
"to": "",
58235881
"reg": false,
5824-
"x": 590,
5825-
"y": 460,
5882+
"x": 810,
5883+
"y": 420,
58265884
"wires": [
58275885
[
58285886
"32266cc01be545d1"
@@ -5846,8 +5904,8 @@
58465904
"d10c0e59950649aa",
58475905
"eac6a267ba1d8eaf"
58485906
],
5849-
"x": 205,
5850-
"y": 460,
5907+
"x": 425,
5908+
"y": 420,
58515909
"wires": [
58525910
[
58535911
"df2cb95dca98e944"
@@ -5873,8 +5931,8 @@
58735931
"from": "",
58745932
"to": "",
58755933
"reg": false,
5876-
"x": 600,
5877-
"y": 520,
5934+
"x": 820,
5935+
"y": 480,
58785936
"wires": [
58795937
[
58805938
"b68cbe91e9163c46"
@@ -5886,8 +5944,8 @@
58865944
"type": "subflow:0455d311f0e53c09",
58875945
"z": "3ee57a9d7dc5fae7",
58885946
"name": "",
5889-
"x": 800,
5890-
"y": 520,
5947+
"x": 1020,
5948+
"y": 480,
58915949
"wires": []
58925950
},
58935951
{
@@ -5916,8 +5974,8 @@
59165974
"from": "",
59175975
"to": "",
59185976
"reg": false,
5919-
"x": 740,
5920-
"y": 180,
5977+
"x": 760,
5978+
"y": 120,
59215979
"wires": [
59225980
[
59235981
"990b1773880e3b7d"
@@ -5945,7 +6003,35 @@
59456003
"y": 180,
59466004
"wires": [
59476005
[
5948-
"b6ef3e45b5156055"
6006+
"b6ef3e45b5156055",
6007+
"8e2d58df583dd160"
6008+
]
6009+
]
6010+
},
6011+
{
6012+
"id": "8e2d58df583dd160",
6013+
"type": "change",
6014+
"z": "3ee57a9d7dc5fae7",
6015+
"name": "",
6016+
"rules": [
6017+
{
6018+
"t": "set",
6019+
"p": "payload",
6020+
"pt": "msg",
6021+
"to": "docker socket error",
6022+
"tot": "str"
6023+
}
6024+
],
6025+
"action": "",
6026+
"property": "",
6027+
"from": "",
6028+
"to": "",
6029+
"reg": false,
6030+
"x": 780,
6031+
"y": 200,
6032+
"wires": [
6033+
[
6034+
"32266cc01be545d1"
59496035
]
59506036
]
59516037
}

‎package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "netbox-docker-agent",
3-
"version": "0.21.0",
3+
"version": "0.21.1",
44
"description": "Saashup agent for netbox manager",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)