{"id":15696848,"url":"https://github.com/western/zix","last_synced_at":"2025-07-26T21:10:23.107Z","repository":{"id":81872913,"uuid":"257450439","full_name":"western/zix","owner":"western","description":"Zabbix api caller","archived":false,"fork":false,"pushed_at":"2020-04-24T07:39:03.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-05T15:42:13.068Z","etag":null,"topics":["perl","zabbix"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/western.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-21T01:38:49.000Z","updated_at":"2022-06-22T13:22:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"209defe4-9642-4246-8c9f-2127bf5bb098","html_url":"https://github.com/western/zix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/western%2Fzix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/western%2Fzix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/western%2Fzix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/western%2Fzix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/western","download_url":"https://codeload.github.com/western/zix/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246326600,"owners_count":20759436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["perl","zabbix"],"created_at":"2024-10-03T19:10:14.002Z","updated_at":"2025-03-30T13:43:43.709Z","avatar_url":"https://github.com/western.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap:ix\n\nYet:smiling_imp: another zabbix perl:camel: api engine ;)\n\n# Examples\n\nMake some constructor:\n```perl\n#!/usr/bin/perl\n\nuse strict;\nuse warnings;\nuse Data::Dumper;\n\nuse lib 'lib';\nuse Zix;\n\nmy $z = new Zix(\n    home     =\u003e 'https://domain.tld/zabbix',\n    \n    user     =\u003e 'Admin',\n    password =\u003e '***password',\n    \n    #basic_user     =\u003e 'userlogin',\n    #basic_password =\u003e '***password',\n);\n\n```\n\nThen call api version. There is non auth :)\n```perl\nwarn 'apiinfo.version: '.$z-\u003eapiinfo_version-\u003e{result};\n```\n\nAuth check wrapper\n```perl\n\nif( $z-\u003eis_auth ){\n    \n    # get all hosts\n    my $hosts = $z-\u003ehost_get;\n    for my $h ( @$hosts ){\n        warn 'hostid: '.$h-\u003ehostid;\n        warn 'name: '.$h-\u003ehost;\n    }\n    \n    # get one host object\n    my $h = $z-\u003ehost_get('media');\n    \n    warn $h-\u003ehostid;\n    warn Dumper($h-\u003eapplication);\n    warn Dumper($h-\u003eitem);\n    warn Dumper($h-\u003eitem(applicationids =\u003e 498));\n    warn Dumper($h-\u003ehostgroup);\n    warn Dumper($h-\u003ehostinterface);\n    warn Dumper($h-\u003etemplate);\n    \n}\n\n```\n\nUse this universal method (theatrical pause) **-\u003euniversal** :smiley: It's flexible:\n```perl\n    $z-\u003euniversal(\n        'application.get',\n        \n        hostids =\u003e 10107,\n    );\n    \n    $z-\u003euniversal(\n        'item.get',\n        \n        hostid =\u003e 10114,\n    );\n    \n    $z-\u003euniversal(\n        'item.create',\n        \n        name         =\u003e $it.'['.$dev.']',\n        key_         =\u003e $it.'['.$dev.']',\n        hostid       =\u003e 10107,\n        interfaceid  =\u003e 3,\n        type         =\u003e 0,\n        value_type   =\u003e 3, # 3 - numeric unsigned; 0 - numeric float;\n        applications =\u003e [506],\n        delay        =\u003e 30,\n        delta        =\u003e 1, # 1 - Delta, speed per second; # 2 - Delta, simple change.\n    );\n    \n    $z-\u003euniversal(\n        'host.create',\n        \n        host =\u003e 'host name 1',\n        groups =\u003e [\n            {\n                groupid =\u003e 2,\n            }\n        ],\n        interfaces =\u003e [\n            {\n                type  =\u003e 1,\n                main  =\u003e 1,\n                useip =\u003e 1,\n                ip    =\u003e 'x.x.x.x',\n                port  =\u003e 10050,\n                dns   =\u003e '',\n            }\n        ],\n        templates =\u003e [\n            {\n                templateid =\u003e 10001,\n            }\n        ],\n    );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwestern%2Fzix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwestern%2Fzix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwestern%2Fzix/lists"}