Host Duration shows as N/A

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Host Duration shows as N/A

Post by nagwindmon »

team, just a qq: Everything seems to be working correctly except I noticed on the host that the state duration is showing N/A for some reason even though it was changed it least once a few months back:
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host Duration shows as N/A

Post by scottwilkerson »

Generally, the only way this would happen would be, since the state change you show on 7/4/2019 have you disabled and then re-enabled this host? OR, have you removed the retention.dat file and restarted NAgios at any point?

The duration is held in Nagios (memory and retention.dat), whereas the state hostory you are showing is pulled from the database.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Re: Host Duration shows as N/A

Post by nagwindmon »

Host was not disabled and then re-enabled and no one touched retention.dat file but not sure if Nagios was restarted between those dates. On other hand if it was then all hosts duration should have been "resettled" but as I looked further I see mix of both.
Any way what my options are for those hosts to begin display duration times again?
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host Duration shows as N/A

Post by scottwilkerson »

Probably the easiest way is to set the initial_state parameter on your templates for hosts to be Up and Services to be Ok on the Check Settings Tab in the CCM for each template used.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Re: Host Duration shows as N/A

Post by nagwindmon »

we don't use templates any longer, all hosts/services being added/updated by APIs now, I could passed it in as a parameter &initial_state=up& but host is up now so that would not change anything?
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host Duration shows as N/A

Post by scottwilkerson »

You can also set these on the services/hosts directly.

To do them all at once you can go to
CCM -> Tools -> Bulk Modifications Tool
Click Change a Single Config Option
Select Initial State from drop down
select "u" next to hosts and services

Select all your hosts/services
Click Save Changes
Apply Configuration
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Re: Host Duration shows as N/A

Post by nagwindmon »

it appears what you've suggested makes no difference...
This is not affecting previously created hosts where they were up to start with. With that said, let me try to follow the logic: by default Nagios will assume that all hosts are in UP states when it starts so if its staying UP then Duration remains as N/A till state is change (host went down and come back up)?
So resolving N/A issue going forward would be to set log_initial_states to 1 in /usr/local/nagios/etc/nagios.cfg?
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host Duration shows as N/A

Post by scottwilkerson »

nagwindmon wrote:So resolving N/A issue going forward would be to set log_initial_states to 1 in /usr/local/nagios/etc/nagios.cfg?
yes
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked