search cancel

Cannot make a database query in a nas Pre Processing script


Article ID: 123072


Updated On:


DX Unified Infrastructure Management (Nimsoft / UIM)


I am trying to make a database query in a nas pre- processing script. If I run the script in the editor, it runs fine.
It connects to the database, makes the query and prints the desired results.
However, when I try to enrich events with this script this line in the script throws an error:

local returnCode =,false)

(note: connectString is set previously and works when run through the editor)

The output message is: nas: PREPROCESSOR ERROR: scripts/cdm_event:71: attempt to index global 'database' (a nil value)

Why does the script throw an error when run through pre-processing?


Component: UIMNAS


nas pre-processing scripts do not allow the use of database related methods due to the impact on the slow down of alarms that these could cause.
These methods can be used with AO rules which can execute the script which invokes the database methods.