seems like I'm having a bit of trouble with the icinga-api.
Icinga-web is not showing any hosts or services...
hostgroups and servicehistory are shown.
icinga and icinga-api version is 1.3.0,
stable package from icinga.org website...
database is a postgres 8.3, with php 5.3 and pgsql also in version 8.3
When I try to manually access the icinga-api with the following script:
 |
PHP-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Path to icinga api file
$apiFile = '/usr/local/icinga/share/icinga-api/IcingaApi.php';
// Database connection
$idoConfig = array (
'type' => 'pgsql',
'host' => 'localhost',
'database' => 'icinga',
'user' => 'xxxxxxxxx',
'password' => 'xxxxxxxxxx',
'persistent' => true,
'table_prefix' => 'icinga_',
);
// Include required files
require_once($apiFile);
// Instance the class
$api = IcingaApi::getConnection(IcingaApi::CONNECTION_IDO, $idoConfig);
// Create search
$apiRes = $api->createSearch()
->setSearchTarget(IcingaApi::TARGET_HOST)
->setResultColumns(array('HOST_NAME', 'HOST_CURRENT_STATE'))
->fetch();
// Create output
foreach($apiRes as $apiHandle){
echo 'Host '.$apiHandle->HOST_NAME.' has the current state '.$apiHandle->HOST_CURRENT_STATE.' ';
}
|
There is no result, although the host and service tables in the database are filled with the correct data.
All logs (icinga-api (with LOGLEVEL_DEBUG_API), icinga-web, icinga, apache-error, messages)
have no related error entries...
Any help welcome, as this leaves the icinga-web useless at the moment.
The old cgi-interface is working fine though...
Dominic
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »neocoretech« (18.03.2011, 15:34)