Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- use strict;
- use warnings;
- use Zabbix::Tiny;
- use Data::Dumper;
- # Import config file
- require '/home/cnc-admin/zabbix/API/config.pl';
- # Pull variables from config file
- my $url = config_url();
- my $password = config_password();
- my $username = config_username();
- # Connect o zabbix server
- my $zabbix = Zabbix::Tiny->new(
- server => $url,
- password => $password,
- user => $username
- );
- # API request
- my $info = $zabbix->do(
- 'configuration.import', # First argument is the Zabbix API method
- {
- source => $ARGV[0],
- format => "json",
- rules => {
- templates => {
- createMissing => "true",
- updateExisting => "true",
- }
- }
- }
- );
- # Print the requested information
- print Dumper $info
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement