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.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.
no Host duration : N/A (no Host Uptime)
Re: no Host duration : N/A (no Host Uptime)
Here is the definition of the Initial State setting.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: no Host duration : N/A (no Host Uptime)
As Scott stated, change:
To:
log_initial_states=1
Apply config.
Code: Select all
log_initial_states=0log_initial_states=1
Apply config.
The only issue with this is the initial state will be DOWN until the first check. This may skew your availability reports.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.
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.
"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.
Re: no Host duration : N/A (no Host Uptime)
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
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)
This config option is only global, so in nagios.cfg
Re: no Host duration : N/A (no Host Uptime)
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.
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)
It could be because, as you said the initial state was down. You are comparing it to something that has always been upquestrad wrote:But question - why it did not happened until this last time?
Re: no Host duration : N/A (no Host Uptime)
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.
I mostly dont change the default settings - they are matching my expectation for now.
It is bug I think and needs to be fixed.
Re: no Host duration : N/A (no Host Uptime)
We'll look into it further. Thanks.