Ad Widget

Collapse

API - Item.Create issues Using Perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • forgetit
    Junior Member
    • Nov 2011
    • 2

    #1

    API - Item.Create issues Using Perl

    Hi all-

    I apologise if this is duplicate issue, however I have crawled all over the forum looking for an answer and not found it.

    I am working on a script using perl that also makes use of the Zabbix.pm module. The end goal is to have a wrapper that can create items and triggers.

    I have triggers working, items however are a different story. Here is the request I am sending(output generated by using Data:umper to display the JSON request):

    "auth":"bab196ece0f0a7cfa7e19f2ec1a04781",
    "params":{

    "key_":"vfs.fs.size[/,pfree]",
    "applications":["1464"],
    "hostid":"10099",
    "description":"test"

    },
    "jsonrpc":"2.0",
    "id":3,
    "method":"item.create"



    After submitting this I will get the following response(again, data dumper):

    $VAR1 = {
    'jsonrpc' => '2.0',
    'error' => {
    'data' => 'Incorrect arguments passed to function',
    'message' => 'Invalid params.',
    'code' => -32602
    },
    'id' => 3
    };


    Any ideas on a method I can use to get some futher debug messages? Is there some method of enabling further debug messages in api_jsonrpc.php to write to my zabbix server log?
  • forgetit
    Junior Member
    • Nov 2011
    • 2

    #2
    Resolved

    Disregard, I got it working by using the definition of another item as a guide. I wasn't passing enough data to the API.

    Thanks

    Comment

    Working...