Zabbix API library for .NET writen in C#
Branch: master
Clone or download
Latest commit 5d34f01 Jun 26, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
ZabbixApi Update API.cs Apr 5, 2017
.gitattributes Initial Commit Oct 29, 2015
.gitignore Initial commit Oct 29, 2015 Update Jun 26, 2018
ZabbixApi.sln Removed ZabbixApiTest projects May 25, 2017


Zabbix.NET is .NET Zabbix API library which is incredible easy to use thanks to C# dynamic objects. There is no need for special classes for zabbix API methods. You can pass parameters via the anonymous objects. Or just your regular objects.


Zabbix zabbix = new Zabbix(user, pass, zabbixUrl);
// Zabbix zabbix = new Zabbix(user, pass, zabbixUrl, true); // Add true as a parameter if you need to use Basic Auth
string resultStr = zabbix.jsonResponse("host.get", new {output: "extend"});
Response resultObj = zabbix.objectResponse("host.get", new {output: "extend"});

Response class

public string jsonrpc { get; set; }
public dynamic result = new ExpandoObject();
public int id { get; set; }

Example (Log all hosts with active triggers):

Zabbix zabbix = new Zabbix("yourapiuser", "yourpassword", "");

Response responseObj = zabbix.objectResponse("trigger.get", new
	{ output = new string[] {"hostname", "description", "lastchange", "priority", "value", "status", "triggerid" },
      min_severity = 3,
      expandData = true,
      expandDescription = true,
      expandExpression = true,
      selectHosts = "extend",
      selectGroups = "extend",
      monitored = true,
      sortfield = "hostname",
      skipDependent = true,
      filter = new {value = 1 }

foreach (dynamic data in responseObj.result)

Example using Zabbix.NET from Powershell (Log all hosts with active triggers):

$Zabbix = New-Object "ZabbixApi.Zabbix" ("yourapiuser", "yourpassword", "");
$params.output=@("hostname", "description", "lastchange","priority","value","status","triggerid");
$params.min_severity = 3;
$params.expandData = $true;
$params.expandDescription = $true;
$params.expandExpression = $true;
$params.selectHosts = "extend";
$params.selectGroups = "extend";
$params.monitored = $true;
$params.sortfield = "hostname";
$params.skipDependent = $true;
$params.filter = @{"value" = 1;}
$responseObj = $zabbix.objectResponse("trigger.get", $params);

foreach ( $data in $responseObj.result) {
        write-output $data.Hostname;

Note that you pass API method to Zabbix.jsonRespopnse (objectResponse) method as a string.


  • You need to use login() method after creating Zabbix class and logout() after you are done with the API to make sure there are no open sessions left.
  • Zabbix.NET uses Newtonsoft.Json library for json serialization and deserialization
  • .NET 4.0, but you can compile to any version of .NET as long as it supports ExpandoObject and Newtonsoft.Json
  • Now available on NuGET PM> Install-Package Zabbix.NET