Created
May 14, 2013 19:33
-
-
Save christianchristensen/5578780 to your computer and use it in GitHub Desktop.
PhpZabbixApi with composer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "https://github.com/christianchristensen/PhpZabbixApi" | |
} | |
], | |
"require": { | |
"confirmitsolutionsgmbh/phpzabbixapi": "dev-composer" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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