# Copyright (C) 2001-2023 Zabbix SIA
#
# Zabbix SIA licenses this file to you under the MIT License.
# See the LICENSE file in the project root for more information.

from zabbix_utils import Sender

# Create an instance of the Sender class with specified parameters
# Parameters: (server, port, source_ip)
sender = Sender("127.0.0.1", 10051, source_ip="10.10.1.5")

# Send a value to a Zabbix server/proxy with specified parameters
# Parameters: (host, key, value, clock)
response = sender.send_value('host', 'item.key', 'value', 1695713666)

# Check if the value sending was successful
if response.failed == 0:
    # Print a success message along with the response time
    print(f"Value sent successfully in {response.time}")
else:
    # Print a failure message
    print("Failed to send value")
