18.09.2011, 00:03 UTC+2

Sie sind nicht angemeldet.

icinga-api not returning any hosts or services

neocoretech

Anfänger

Beiträge: 6

Geschlecht: Männlich

Betriebssystem(e): Linux/Windows

1

18.03.2011, 15:26

icinga-api not returning any hosts or services

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)


neocoretech

Anfänger

Beiträge: 6

Geschlecht: Männlich

Betriebssystem(e): Linux/Windows

2

31.03.2011, 13:14

Der einzige fehler der immer wieder in den logs auftaucht:

PHP-Quelltext

1
2
3
4
5
6
7
8
9
10
11
Mar 28 07:19:57 icinga ido2dbSuccessfully disconnected from pgsql database
Mar 28 07:19:59 icinga icingaidomodError writing to data sink!  Some output may get lost...
Mar 28 07:19:59 icinga icingaidomodPlease check remote ido2db logdatabase connection or SSL Parameters
Mar 28 07:20:15 icinga icingaidomodSuccessfully reconnected to data sink!  0 items lost38 queued items to flush.
Mar 28 07:20:15 icinga ido2dbClient connecteddata available.
Mar 28 07:20:15 icinga ido2dbHandling client connection...
Mar 28 07:20:15 icinga icingaidomodSuccessfully flushed 38 queued items to data sink.
Mar 28 07:20:15 icinga ido2dbSuccessfully connected to pgsql database
Mar 28 07:21:15 icinga ido2dbSuccessfully connected to pgsql database
Mar 28 07:24:47 icinga ido2dbErrordatabase query failed for 'INSERT INTO icinga_servicechecks (instance_id, service_object_id, check_type, current_check_attempt, max_check_attempts, state, state_type, start_time, start_time_usec, end_time, end_time_usec, timeout, early_timeout, execution_time, latency, return_code, output, long_output, perfdata, command_object_id, command_args, command_line) VALUES (1, 106, 0, 1, 3, 0, 1, FROM_UNIXTIME(1301289876), 960645, FROM_UNIXTIME(1301289877), 411301, 60, 0, 0.450660, 0.960000, 0, 'OK load average0.000.000.00', 'Ê#005#010#004\\n', 'load1=0.000;20.000;30.000;0; load5=0.000;15.000;25.000;0; load15=0.000;10.000;20.000;0;', 105, '', '/usr/local/icinga/libexec/check_nrpe -t 60 -H 92.51.133.81 -c check_load -a \'20,15,10\' \'30,25,20\'')' - 'ERROR:  invalid byte sequence for encoding "UTF8": 0xca05#012HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".#012'
Mar 28 07:24:47 icinga ido2dbSuccessfully disconnected from pgsql database


ido2db ist mit unix sockets konfiguriert, mit tcp funktionierts leider nicht
(bei tcp, ohne ssl kommt beim neustart von icinga folgender fehler und die servicechecks landen auch nicht in der datenbank):

PHP-Quelltext

1
2
Mar 31 13:03:26 icinga icingaidomodError writing to data sink!  Some output may get lost...
Mar 31 13:03:26 icinga icingaidomodPlease check remote ido2db logdatabase connection or SSL Parameters


nachdem ja aber die datenbank trotz der fehlermeldungen bei verwendung des unix sockets korrekt befüllt ist,
bin ich mir eben nicht sicher, ob das mit dem problem zusammenhängt, dass im icinga-web keine hosts und services angezeigt werden...

bin über jeden hinweis dankbar...

Grüße

Ähnliche Themen