no Host duration : N/A (no Host Uptime)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: no Host duration : N/A (no Host Uptime)

Post by tgriep »

Here is the definition of the Initial State setting.
initial_state: By default Nagios will assume that all hosts are in UP states when it starts. You can override the initial state for a host by using this directive. Valid options are: o = UP, d = DOWN, and u = UNREACHABLE.
So if you set the initial state to "o" which is up and the host never goes to a hard state of down, the Duration time will not be correct. So by changing it to "d", Down and the first check it is in a UP state, the Duration time will start at that point.
Be sure to check out our Knowledgebase for helpful articles and solutions!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: no Host duration : N/A (no Host Uptime)

Post by abrist »

As Scott stated, change:

Code: Select all

log_initial_states=0
To:
log_initial_states=1
Apply config.
questrad wrote:I changed to have initial state in host = "d" instead of "o" and added new host - everything goes perfect and I get uptime duration right away.
The only issue with this is the initial state will be DOWN until the first check. This may skew your availability reports.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: no Host duration : N/A (no Host Uptime)

Post by questrad »

Thanks for getting back, I have already read all of that.

But how I understand - It can be some bug or we need to have documented it - how to add host

Please make clear now, what we need to use - changing global in nagios.cfg or on host/template for host level?
I like the host/template level

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: no Host duration : N/A (no Host Uptime)

Post by scottwilkerson »

This config option is only global, so in nagios.cfg
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: no Host duration : N/A (no Host Uptime)

Post by questrad »

Thanks Scott,
But question - why it did not happened until this last time?
We have about 270 hosts on that Nagios and I hit this issue first time.
I have host which is already 106 day in uptime (this is new setup of Nagios server) and they went never down from start day of adding in Nagios - it is our Production environment.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: no Host duration : N/A (no Host Uptime)

Post by scottwilkerson »

questrad wrote:But question - why it did not happened until this last time?
It could be because, as you said the initial state was down. You are comparing it to something that has always been up
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: no Host duration : N/A (no Host Uptime)

Post by questrad »

No, the initial state I have started to play when I saw issue.
I mostly dont change the default settings - they are matching my expectation for now.

It is bug I think and needs to be fixed.
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: no Host duration : N/A (no Host Uptime)

Post by cmerchant »

We'll look into it further. Thanks.
Locked