Host Duration shows as N/A
-
nagwindmon
- Posts: 92
- Joined: Mon Dec 01, 2014 3:39 pm
Host Duration shows as N/A
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
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.
The duration is held in Nagios (memory and retention.dat), whereas the state hostory you are showing is pulled from the database.
-
nagwindmon
- Posts: 92
- Joined: Mon Dec 01, 2014 3:39 pm
Re: Host Duration shows as N/A
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?
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
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.
-
nagwindmon
- Posts: 92
- Joined: Mon Dec 01, 2014 3:39 pm
Re: Host Duration shows as N/A
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
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
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
-
nagwindmon
- Posts: 92
- Joined: Mon Dec 01, 2014 3:39 pm
Re: Host Duration shows as N/A
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?
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
yesnagwindmon wrote:So resolving N/A issue going forward would be to set log_initial_states to 1 in /usr/local/nagios/etc/nagios.cfg?