Skip to content

Instantly share code, notes, and snippets.

@christianchristensen
Created May 14, 2013 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christianchristensen/5578780 to your computer and use it in GitHub Desktop.
Save christianchristensen/5578780 to your computer and use it in GitHub Desktop.
PhpZabbixApi with composer
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/christianchristensen/PhpZabbixApi"
}
],
"require": {
"confirmitsolutionsgmbh/phpzabbixapi": "dev-composer"
}
}
<?php
// Autoload ZabbixApi
require __DIR__ . '/vendor/autoload.php';
try {
// connect to Zabbix API
$api = new ZabbixApi('http://zabbix.example.com/api_jsonrpc.php', 'USER', 'PASS');
$api->printCommunication();
var_dump($api->apiinfoVersion(array("output"=>"extend")));
}
catch(Exception $e) {
// Exception in ZabbixApi
echo $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment