Re: [Nagios-devel] NAGIOS_LASTHOSTSTATE and NAGIOS_LASTSERVICESTATE

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] NAGIOS_LASTHOSTSTATE and NAGIOS_LASTSERVICESTATE

Post by Guest »


> Thomas Guyot-Sionnest wrote:
> > Christian Mies wrote:
> >> Hi Devel List,
> >> I found an Issue, in the Nagios 3.0.6 Environment due to writing an
> >> advanced notification script.
> >> I want to use NAGIOS_HOSTSTATE and NAGIOS_LASTHOSTSTATE.
> >> If my Hoststate changed from DOWN to UP everything looks good.
> >> Vice versa I get NAGIOS_HOSTSTATE=3DDOWN (is correct) and
> >> NAGIOS_LASTHOSTSTATE=3DDOWN (wrong, must be UP).
> >
> >> In the NAGIOS_SERVICESTATE and NAGIOS_LASTSERVICESTATE there will be
> the
> >> same issue.
> >
> >> Can anybody confirm these issues?
> >
> > The DOWN notification usually happens on the 3rd attempt, so the two
> > last attempts were down as well.
> >
> > You could record the state changes to disk with an event handler and
> use
> > them in your script instead.
> >
>
> Although we could consider adding $LASTHARDHOSTSTATE$ and
> $LASTHARDSERVICESTATE$ for that purpose... Ethan?
>
> If we need to modify structs exported to event broker modules it may
> require waiting until the next major release though...

I second that idea. I ran into this as well and just wrote my notification=
scripts around it.

>
> - --
> Thomas





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked