ZabbixClient 6.0.1
See the version list below for details.
dotnet add package ZabbixClient --version 6.0.1
NuGet\Install-Package ZabbixClient -Version 6.0.1
<PackageReference Include="ZabbixClient" Version="6.0.1" />
paket add ZabbixClient --version 6.0.1
#r "nuget: ZabbixClient, 6.0.1"
// Install ZabbixClient as a Cake Addin #addin nuget:?package=ZabbixClient&version=6.0.1 // Install ZabbixClient as a Cake Tool #tool nuget:?package=ZabbixClient&version=6.0.1
ZabbixClient
C# Zabbix Api client to retrieve host data and and modify the configuration of Zabbix
Overview
This is a fork of HenriqueCaires/ZabbixApi with a fix to allow login after Zabbix changes the name of the username property.
Also updated the Newtonsoft.Json dependency to 12.0.3, updated Nuget license, readme and image links and a bump to dotnet 6.
We use the package internally and needed to fix this issue. We have not tested all the endpoints, but the login works and we can retrieve host data.
To allow publishing to NuGet I have renamed the package (and internal namespace) to ZabbixClient.
Todo
- Unit tests fail. This might be our test and prod server returning an empty array, enpoints Zabbix have removed or errors in this client.
- Warning 'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.'
- Test automation uses zabbix/zabbix-appliance docker image. This image has been discontinued. Use https://github.com/zabbix/zabbix-docker.git
This library allows you to make CRUD operations using Zabbix API. You just need to instantiate the context and the service that you want and call the operation.Like that:
Installing package
On the Package Manager Cosole type this to install:
Install-Package ZabbixClient
Using
Instantiate the context and the service that you want and call the operation:
using(var context = new Context(url, user, password))
{
var host = context.Hosts.GetByName("myHost");
}
You can make your own query too, like that:
using(var context = new Context(url, user, password))
{
var host = context.Hosts.Get(new {
name = "myHost"
});
}
Or that:
using (var context = new Context(url, user, password))
{
var host2 = context.Hosts.Get(new
{
hostid = "1"
});
}
Configuring via the appsettings.json
file
Instead of specifying the configuration in the constructor the appsettings.json
file can be used like that:
{
"ZabbixClient": {
"url": "http://MyZabbixServer/zabbix/api_jsonrpc.php",
"user": "Admin",
"password": "zabbix"
}
}
The empty constructor can then be used:
using(var context = new Context())
{
// ...
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Extensions.Configuration (>= 2.1.1)
- Microsoft.Extensions.Configuration.Json (>= 2.1.1)
- Newtonsoft.Json (>= 13.0.3)
-
net6.0
- Microsoft.Extensions.Configuration (>= 2.1.1)
- Microsoft.Extensions.Configuration.Json (>= 2.1.1)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.