NAME

Zabbix7::API::Script -- Zabbix script objects

SYNOPSIS

use Zabbix7::API::Script;

# Create a script
use Zabbix7::API::Script qw/:script_hostperms/;
my $script = Zabbix7::API::Script->new(
    root => $zabbix,
    data => {
        name => 'nmap',
        command => '/usr/bin/nmap {HOST.CONN}',
        host_access => SCRIPT_HOSTPERM_READ,
    },
);
$script->create;

DESCRIPTION

Handles CRUD for Zabbix script objects.

This is a subclass of Zabbix7::API::CRUDE; see there for inherited methods.

METHODS

name()

Mutator for the script's name (the "name" attribute); returns the empty string if no description is set, for instance if the script has not been created on the server yet.

command()

Mutator for the command to be run by the Zabbix server; returns the empty string if no command is set, for instance if the script has not been created on the server yet.

EXPORTS

Some constants:

SCRIPT_HOSTPERM_READ
SCRIPT_HOSTPERM_READWRITE

They are not exported by default, only on request; or you could import the :script_hostperms tag.

SEE ALSO

Zabbix7::API::CRUDE.

AUTHOR

SCOTTH

COPYRIGHT AND LICENSE

Copyright (C) 2011, 2012, 2013, 2014 SFR Copyright (C) 2020 Fabrice Gabolde Copyright (C) 2025 ScottH

This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.