Ad Widget

Collapse

Creating Database monitoring item programmatically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eithco
    Junior Member
    • Jul 2015
    • 21

    #1

    Creating Database monitoring item programmatically

    I'm creating Database monitoring items programmatically but there are some values that I need to pass and their keys doesn't seem to work.

    So does anyone know what are the keys for these:

    The SQL query. I tried:

    .paramEntry("sql", "the query itself;")
    or
    .paramEntry("query", "the query itself;")

    but they aren't working and the sql textarea in the zabbix site stays empty.

    Also the template id. I tried:

    .paramEntry("templateid", "MyTemplateName")

    but it doesn't work and gives an error: cannot set value for templateid.

    And finally interfaceid. I tried:

    .paramEntry("interfaceid", 1)

    which I found in one of the examples on the net. It works, but I have no idea why "1" works while others dont'.

    Any help would be greatly appreciated.
  • Eithco
    Junior Member
    • Jul 2015
    • 21

    #2
    My solution:

    Passing the sql: The way to add the sql to the request it is not by adding
    .paramEntry("sql", some sql query")

    but by adding .paramEntry("params", "some sql query")

    Once I did that, it solved my problem.

    Regarding templateid: I thought I'd use tempates as a way for creating a namespace but apparently this is not the usage. So scratch that.

    Regarding interfaceid:
    it seems like this is not required for Databas monitoring type items.

    Comment

    Working...