Debug failing scan inserts
How to figure out why a scan isn't inserting
Sometimes inventory scans will be rejected without a stated reason as to why. This now can be debugged somewhat better (in 8.7)
Way to do it:
- run SVCCFG in 8.7 and go to the INVENTORY-tab, then to “ADVANCED SETTINGS” (remember – we keep the Inventory server’s parameters now in the DB itself, no longer in the registry. The table to look for is KEYVALUE, where you sort it by application (Inventory server == “LDINV32”).
- In the options, go to “Rolling Log” and set it to “1”.
- Restart the Inventory service.
- Insert the scan-file that’s failed – note, this will be quite slow and create quite a big log,
- Set the “Rolling Log” back to 0, and re-start the inventory service.
- Look at the LDINV32.LOG in LDMAIN
- You want to look for the place just BEFORE we start cancelling all the inserts (i.e. – look from the bottom up). The last thing we’re trying to insert will give a clue as to what the problem is. For instance, if we’re trying to insert FIXED DRIVE-information into UNMODELLEDDATA, the problem needs to be resolved with DBREPAIR (FIXED DRIVE is a One-to-many information structure – UNMODELLED DATA can only hold one-to-one data structures).
- All this is stuff that a normal DBREPAIR with “clear all” can sort out, but at least if you need to go by precise removal, the above can help you better in this regard I hope :-).
Background Explanation – and why “GENERATE SQL” doesn’t work anymore:
So when LANDesk last re-wrote the Inventory Service, we went to a Bulk-insert approach. This looks – in basics – essentially like this:
- Inventory Service reads out all the tables from the Database caching them, then disconnects.
- Inventory Service looks at the scanfile (which you’ll see in LDINV32.LOG) and logs what to insert, and what doesn’t need to be inserted.
- Once the Inventory service has prepared its list of “what to insert”, we then connect to the DB again and proceed to do so (hence “bulk copy”).
GENERATE SQL doesn’t really work anymore, as we no longer generate / insert line-by-line, but rather create a list of things to insert in bulk, depending on the scan-file verus the cached DB.
Rgds,
Sergio