RE: [Nagios-db-devel] Postgres Views not updated - Continued
Status: Beta
Brought to you by:
bench23
From: Thibault G. <thi...@sr...> - 2005-05-04 15:16:32
|
First of all, the update_views has no problem. It just doesn't contain = the data I wanted. Now with the 'bug'=20 De=A0: Ben [mailto:be...@si...]=20 Envoy=E9=A0: mercredi 4 mai 2005 17:03 >Oh, so you're saying that the plugin output may not update correctly?=20 >That's certainly possible.... I seem to recall thinking this should=20 >work, but not having enough time to give it more than a cursory test,=20 >and perhaps my test wasn't good enough. >Let me know what you find.... The function update_service(), around line 211, contains code that = updates the content of the history for a service. There is the following = block: IF (state_is_the_same_as_before) IF (it_is_an_error_state) Update the history END IF (*) ELSE Update the history And Insert a row with the new state END IF Now what happens if some test is still in the same, non-error state as = for the previous check ? It does nothing ! So I have hacked my script by adding an update on the PluginOuput member = where I put an asterisk (*) above, and it works. Now the host_detail = view contains the right, Nagios synchronized values. More values than the single PluginOuput might also need to be updated at = this point, but I don't know Nagios-DB enough as of now to tell. On May 4, 2005, at 5:04 AM, Thibault GENESSAY wrote: > After a deeper analysis, it appears that not all the information is=20 > outdated, only some subset of it. Logging the updates in the NEB=20 > module, I see that nagios-DB is notified when something changes, but=20 > the history is not updated correctly. See: > > File: /database/postgres/SPs/service.sql > Function: update_service() > Line 211: > update service_history set current_attempt =3D CurrentAttempt,=20 > plugin_output =3D PluginOutput where serviceid =3D thisServiceID and=20 > lasted is null; > > It seems that either this line does not update the PluginOuput=20 > correctly or it gets the outdated value. > I'm investigating this (unless I've missed something) and keep you=20 > guys in touch > > ________________________________________ > De=A0: Thibault GENESSAY > Envoy=E9=A0: mercredi 4 mai 2005 11:06 > =C0=A0: nag...@li... > Objet=A0: [Nagios-db-devel] Postgres Views not updated > > Hello > > I've been using nagios-db for a few days only so please apologize if=20 > it's a dummy question, but I'm going crazy with it. > First, I am using nagios-db-0.91 with Postgres NEB. > It seems that the data from the views does not get updated, even if I=20 > use the update_views.sql script as stated in the doc. The php=20 > interface reflects the information in the service_history table and=20 > host_details view, which is completely outdated. On the other hand,=20 > the service_check table contains the correct, latest information that=20 > nagios' CGIs show. > Any clues ? > > Regards > > Thibault > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great=20 > events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |