Hi, since N8N does not support SNMP querry, I’m using execute command with the linux snmp tool and some awk/sed/tr fu to manipulate the data output. My problem is that I getting multiple serial number of the devices I query and should logically return it as an array but I can’t format the output to result in a valid json syntax.
My output will be similar to this
oid.1 = "serial1"
oid.2 = "serial2"
oid.3 = "serial3"
Maybe it’s not the best way to do this in N8N but I used linux tools (awk, sed, tr, etc.) to format it in a standard array output like this
["serial1", "serial2", serial3"]
But the execute command node will add a double quote before and after the array like following
[
{
"exitCode":
0,
"stderr":
"",
"stdout":
"["serial1", "serial2", "serial3"]"
}
]
so, standard output isn’t a valid json syntax. Is their any way that the execute shell node will not add those double quote before and after the stdout data like in the following ?
[
{
"exitCode":
0,
"stderr":
"",
"stdout":
["serial1", "serial2", "serial3"]
}
]
Else, is their a better way to handle modifying the data in N8N to format it in a json valid output ?
Here is the workflow
thanks
Information on n8n setup
- **n8n version: 1.27.2
- **Database : SQLite
- **n8n EXECUTIONS_PROCESS setting (default: own, main): manual
- **Running n8n via npm (docker don’t include SNMP)
- **Operating system: debian 12 with nodejs 18.x (official ubuntu/debian repo)