SNMP repeating objects

when I create SNMP node it works fine, but when I have an IP listing where one of these IP is without access or turned off for example, it repeats the information it collected from another IP.
I don't know how to put my code here, but value there.

[
    {
        "id": "ddd2b570de4e9841",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": ""
    },
    {
        "id": "85e286d49b3e53d6",
        "type": "template",
        "z": "ddd2b570de4e9841",
        "name": "Listagem de Impressoras",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "172.16.17.49\n172.16.17.50\n172.16.17.100\n172.16.17.200",
        "output": "str",
        "x": 270,
        "y": 240,
        "wires": [
            [
                "a3517001fd1b0593"
            ]
        ]
    },
    {
        "id": "a3517001fd1b0593",
        "type": "split",
        "z": "ddd2b570de4e9841",
        "name": "",
        "splt": "\\n",
        "spltType": "str",
        "arraySplt": 1,
        "arraySpltType": "len",
        "stream": false,
        "addname": "",
        "x": 390,
        "y": 180,
        "wires": [
            [
                "59f97d3aa77baba7"
            ]
        ]
    },
    {
        "id": "6a3f7a7f29bdd465",
        "type": "inject",
        "z": "ddd2b570de4e9841",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payloadType": "date",
        "x": 160,
        "y": 180,
        "wires": [
            [
                "85e286d49b3e53d6"
            ]
        ]
    },
    {
        "id": "59f97d3aa77baba7",
        "type": "change",
        "z": "ddd2b570de4e9841",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "host",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "port",
                "pt": "msg",
                "to": "161",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 560,
        "y": 180,
        "wires": [
            [
                "fde8f473dc2b3cab"
            ]
        ]
    },
    {
        "id": "fde8f473dc2b3cab",
        "type": "snmp",
        "z": "ddd2b570de4e9841",
        "host": "",
        "community": "public",
        "version": "1",
        "oids": "1.3.6.1.2.1.25.3.2.1.3.1,1.3.6.1.2.1.43.16.5.1.2.1.1\n",
        "timeout": 5,
        "name": "",
        "x": 730,
        "y": 180,
        "wires": [
            [
                "e89a0b42a1c38d80"
            ]
        ]
    },
    {
        "id": "168fbe6d4fe96eb9",
        "type": "debug",
        "z": "ddd2b570de4e9841",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1170,
        "y": 220,
        "wires": []
    },
    {
        "id": "e89a0b42a1c38d80",
        "type": "function",
        "z": "ddd2b570de4e9841",
        "name": "",
        "func": "if(msg.payload !== false){\nmsg.payload.push( { \"ip\" : msg.host } );\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 860,
        "y": 180,
        "wires": [
            [
                "2c2c8297ce237f2a"
            ]
        ]
    },
    {
        "id": "4cf8c8d5842b4159",
        "type": "function",
        "z": "ddd2b570de4e9841",
        "name": "",
        "func": "\n\nvar aJsonArray = new Array();\n\nfor (var i = 0; i < msg.payload.length; i++)\n{\n    var aJson = new Object();\n    \n    aJson.modelo = msg.payload[i][0];\n    aJson.status = msg.payload[i][1];\n    aJson.ip = msg.payload[i][2].ip;\n    aJsonArray.push(aJson);\n}\n\nvar text = JSON.stringify(aJsonArray);\nvar obj = JSON.parse(text);\nmsg.payload = obj;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 860,
        "y": 300,
        "wires": [
            [
                "168fbe6d4fe96eb9"
            ]
        ]
    },
    {
        "id": "2c2c8297ce237f2a",
        "type": "join",
        "z": "ddd2b570de4e9841",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 850,
        "y": 240,
        "wires": [
            [
                "4cf8c8d5842b4159"
            ]
        ]
    }
]
```![flow2|541x500](upload://V5le57ldthhTMaE96Vhguf3tgy.png)
![flow|690x158](upload://nnbuIqgZYzfPKUhLE6xA9qIark9.png)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.