ZabbixSender.Secure 1.0.2

dotnet add package ZabbixSender.Secure --version 1.0.2
                    
NuGet\Install-Package ZabbixSender.Secure -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZabbixSender.Secure" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZabbixSender.Secure" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="ZabbixSender.Secure" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZabbixSender.Secure --version 1.0.2
                    
#r "nuget: ZabbixSender.Secure, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZabbixSender.Secure@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZabbixSender.Secure&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=ZabbixSender.Secure&version=1.0.2
                    
Install as a Cake Tool

ZabbixSender.Secure

TLS-PSK and TLS-certificate support for ZabbixSender.Async. Drop-in ISender replacement that uses BouncyCastle for encryption. Zabbix 7 compatible.

Getting started

TLS-PSK

using ZabbixSender.Secure;

var sender = new SecureSender(
    "zabbix.example.com",
    new CredentialsPreSharedKey("MyPSKIdentity", "aabbccdd01234567..."));

var response = await sender.Send("MyHost", "my.item.key", "42");

if (response.IsSuccess)
{
    var info = response.ParseInfo();
    Console.WriteLine($"processed: {info.Processed}, failed: {info.Failed}");
}

TLS-certificate

var sender = new SecureSender(
    "zabbix.example.com",
    new CredentialsCertificate("/path/to/cert.pem", "/path/to/key.pem"));

For self-signed server certificates:

var sender = new SecureSender(
    "zabbix.example.com",
    new CredentialsCertificate(certPath, keyPath, verifyServerCertificate: false));

Sending JSON payloads

For trapper templates that use a master item with dependent items (see ZabbixSender.Template):

// send full payload, key derived from class name
await sender.SendJson("MyHost", payload);

// send just one section
await sender.SendJson<WebShopPayload, OrderMetrics>("MyHost", orderMetrics);

Sending multiple items

using ZabbixSender.Async;

var data = new[]
{
    new SendData { Host = "MyHost", Key = "cpu.usage", Value = "45.2" },
    new SendData { Host = "MyHost", Key = "mem.free", Value = "2048" },
};

await sender.Send(data);

Configuration

var sender = new SecureSender(
    zabbixServer: "zabbix.example.com",
    credentials: new CredentialsPreSharedKey("id", "key"),
    port: 10051,        // default: 10051
    timeout: 5000,      // milliseconds, default: 500
    bufferSize: 4096);  // bytes, default: 1024

API

Method Description
Send(host, key, value) send a single value
Send(params SendData[]) send multiple items
Send(IEnumerable<SendData>, ct) send with cancellation
SendJson<T>(host, payload) serialize to camelCase JSON, key derived from class name
SendJson<TPayload, TMetrics>(host, metrics) send one section, wrapped in payload structure
SendJson<T>(host, key, payload) serialize with explicit key
Credentials Use case
CredentialsPreSharedKey(identity, hexKey) TLS-PSK (most common)
CredentialsPreSharedKey(identity, byte[] key) TLS-PSK with raw bytes
CredentialsCertificate(certPath, keyPath) TLS certificate (PEM files)
CredentialsCertificate(certPath, keyPath, verifyServer) with optional server verification

Why this exists

ZabbixSender.Async only supports unencrypted connections. .NET's SslStream doesn't support PSK cipher suites, so BouncyCastle is needed.

This package reuses ISender, IFormatter, SendData, and SenderResponse from the base library. Only the TCP+TLS connection lifecycle is reimplemented.

Dependencies

License

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 94 4/10/2026