Chris is probably right about your table definition having the 'key' attribute set on fields that will have duplicate values. If you want the ability for those fields to have duplicate or null values, don't enable the key. Note: it's not necessary to set any fields as keys because your custom table will automatically have a key column as well as the ResourceGuid of the machine included without you needing to specify it.
If that's not the issue, check the SMP server logs after the NSE is submitted and I believe it will show details if there are NSE processing problems (including key violations).
------------------------------
Joe
------------------------------
Original Message:
Sent: Mar 06, 2022 04:57 AM
From: Mordechai Pereg
Subject: Custom inventory with multirow problems
hi,
i have a custom inv. script that should insert multirow per server.
i can see that the nse.Xml include all rows but in the DB only the first row in inserted.
<?xml version="1.0"?> <message> <to>{1592B913-72F3-4C36-91D2-D4EDA21D2F96}</to> <priority>1</priority> <msgId>{6B3322D0-04C3-42DD-BED4-F7A1A3AE5714}</msgId> <time>20220306113433.131000-120</time> <from> <resource typeGuid="{2C3CB3BB-FEE9-48DF-804F-90856198B600}" guid="{8E534F1F-8D16-4A77-9755-BB6D9DB11B5C}" name="server"> <key name="fqdn" value="server.xxxx"/> <key name="name.domain" value="server.xxxx"/> <key name="uniqueid" value="a1aJmI3BkYbfDSA7q9+QtA=="/> <key name="uniqueid" value="BJ6PcRMsqA5pclBylJ9NWg=="/> <key name="uniqueid" value="DiyjVyKAFQaWKmXYv4/kpw=="/> <key name="uniqueid" value="TwTiiwrLVEZ+yWFXn7LqHg=="/> <key name="uniqueid" value="WLmR6ZZm60z46Wlm+Y779Q=="/> <key name="uniqueid" value="y8mgzW1VhUdUoN1RA85DeQ=="/> </resource> </from> <body> <inventory> <dataClass guid="{0db3960f-eba3-4c61-a8c5-c9244cb3d6de}"> <data> <resource partialUpdate="false"> <row c0="server" c1="user1" c2="server\user1" c3="" c4="0" c5="server" c6="" c7="0" c8="0" c9="OK" hash="54OhiHhEevKUO7IIP4yrGA=="/> <row c0="server" c1="user2" c2="server\user2" c3="" c4="0" c5="server" c6="" c7="0" c8="1" c9="OK" hash="a25TTb9LYsJKgIeZICm+6g=="/> <row c0="server" c1="user3" c2="server\user3" c3="" c4="0" c5="server" c6="" c7="0" c8="0" c9="OK" hash="y2Z5JPdPDScPZYcigHd3Iw=="/> </resource> </data> </dataClass> </inventory> </body> </message>
i have triple checked (and also untick and tick again) the "allow multiple rows.." in the new dataclass but without any luck.
what am i missing? what should i check?
thanks