forked from mikeda/ZabbixAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
36 lines (29 loc) · 736 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
This is an Zabbix Perl API.
See:
http://www.zabbix.com/documentation/1.8/api
Require:
Zabbix 1.8 or later
CPAN modules
JSON
LWP::UserAgent
Data::Dumper
Usage:
use ZabbixAPI;
### initialize an object and login
my $za = ZabbixAPI->new("http://127.0.0.1/zabbix/");
$za->login("api_user", "api_password");
### To use "method.name" method, call method_name().
my $version = $za->apiinfo_version();
print "$version\n";
### The first argument is a reference of "params".
my $hosts = $za->host_get(
{
filter => {
host => [ 'test01', 'test02' ]
},
output => "extend"
}
);
for my $h (@$hosts){
print "host:". $h->{host} ." hostid:". $h->{hostid} ."\n";
}