Ad Widget

Collapse

Calculated item prototype on template with custom query mssql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ivanpl82
    Junior Member
    • Aug 2024
    • 1

    #1

    Calculated item prototype on template with custom query mssql

    Hello,

    I have an item prototype in a discovery rules using the mssql plugin which has the key bellow:

    Code:
    mssql.custom.query[,,,cpu_per_db,{#DBNAME}]
    Now I want to get that value on a new item prototype calculated. So I set a new name, a new key for this new item, and set the next formula:

    Code:
    last(mssql.custom.query[,,,cpu_per_db,{#DBNAME}])*100
    It's only an example, but I alway get the same error:

    Code:
    Cannot evaluate function "last("","","cpu_per_db","TEST]")": item "host1:mssql.custom.query[" does not exist.
    TEST is the value of DBNAME.
    The error shows me that it has troubles with quotes.
    I tried several combinations but I always get the same error.

    Another try:
    - Formula: last("mssql.custom.query[,,,cpu_per_db,{#DBNAME}]")*100
    - Error: Cannot evaluate function "last(,,cpu_per_db,{#DBNAME}])": item "host1:mssql.custom.query[" does not exist.

    Doesn't get the value of DBNAME.

    Another try:
    - Formula: last("mssql.custom.query[",,,cpu_per_db,{#DBNAME}"]")*100
    - Error: Cannot evaluate function "last(,,cpu_per_db,{#DBNAME}"])": item "host1:mssql.custom.query["" does not exist.

    One more time:
    - Formula: last(mssql.custom.query[",,,cpu_per_db,{#DBNAME}"])*100
    - Error: Cannot evaluate function "last("","","cpu_per_db","TEST\\"]")": item "host1:mssql.custom.query["" does not exist.

    And the finally test:
    - Formula: last(mssql.custom.query[",,,cpu_per_db,{#DBNAME}"])*100
    - Error: Cannot evaluate function "last("","","cpu_per_db","TEST"]")": item "host1:mssql.custom.query["" does not exist.

    Is it possible to create an item calculated prototype according another item prototype?

    Thank you in advance.​
Working...