Page 1 of 1

timeperiod & availability raport problem

Posted: Tue May 07, 2013 4:33 am
by babz
Hi guys,
I found problem with timeperiods. I made something like this:

Code: Select all

define timeperiod{
#	name			ex
	timeperiod_name		ex
	alias			ex
	january 1                  00:00-24:00
	december 25             00:00-24:00
	may 1			01:00-23:00
	may 3			00:00-24:00
		}
define timeperiod{
#	name 		917
	timeperiod_name		917
        alias           	917  
        sunday          	00:00-00:00
        monday          	09:05-16:50
        tuesday         	09:05-16:50
        wednesday       	09:05-16:50
        thursday        	09:05-16:50
        friday          	09:05-16:50
        saturday        	00:00-00:00
}	
	
define timeperiod{
#	name		report
	timeperiod_name	report	
#        alias           R
	use		917
	exclude		ex
        }
After Nagios reload I received an error

Code: Select all

Error: Template '917' specified in timeperiod definition could not be not found (config file '/usr/local/nagios/etc/objects/timeperiods.cfg', starting on line 85) 
line 85 starts at “define timeperiod” named “report”.
After that I deleted comment at line “# name 917”, leaving definition like this:

Code: Select all

define timeperiod{
	name 				917
timeperiod_name		917
        alias           	917  
        sunday          	00:00-00:00
        monday          	09:05-16:50
        tuesday         	09:05-16:50
        wednesday       	09:05-16:50
        thursday        	09:05-16:50
        friday          	09:05-16:50
        saturday        	00:00-00:00
}
Then Nagios reloads fine, but doesn't proper count % in report, doesn't exclude timeperiod "ex", and shows 33% instead 100% (report generated for 1-3 may).
Also I didn’t find any information about “name” point in timeperiod definition in documentation, and in definition of timeperiod "ex" the "name" is commented.
I use Nagios 3.4.3.

Any ideas what's wrong ?

Re: timeperiod & availability raport problem

Posted: Tue May 07, 2013 11:10 am
by sreinhardt
This is not actually a problem with reporting or timeperiods. We do not presently include the functionality to define a timeperiod and use it to include or exclude data within a report. The reporting functionality only works with the timeperiods defined via the drop down boxes on the reporting page.

Re: timeperiod & availability raport problem

Posted: Wed May 08, 2013 2:39 am
by babz
Hi if you mean "Report time Period:" in "Step 3: Select Report Options", it's obvious to choose a proper value in drop down menu. Problem exist when I choose time period which, doesn't cover (exclude) 1st and 3rd of may. When I changed in time period 917 wednesday (1st of may) form value 9:05-16:50 to 00:00-00:00, then in report I see 50% instead 33%, so Nagios calculated report base on 2 days instead of 3. This mean that Nagios properly take into consideration value in "Report time Period:" field, but doesn't take into consideration "exclude" values in this time period which I use to calculate the report (still shouldn't include 3rd of may and should show 100% for 2 days, because 3rd is on "exclude" time period).

Re: timeperiod & availability raport problem

Posted: Wed May 08, 2013 12:07 pm
by abrist
Have any of your reports worked with exclusions? I test on my core instance and they do not seem to be pulling the exclusions either. Have you tried creating a new time period config that just has explicit, inclusive declarations? (no exclusions)

Re: timeperiod & availability raport problem

Posted: Mon May 13, 2013 2:55 am
by babz
I never before used time periods exclusion with reports. As I see it doesn't works. Maybe you should think to implement this feature in future release.

I did ths definition:

Code: Select all

may 1				00:00-00:00
may 3				00:00-00:00
      sunday          	00:00-00:00
        monday          	09:05-16:50
        tuesday         	09:05-16:50
        wednesday       	09:05-16:50
        thursday        	09:05-16:50
        friday          	09:05-16:50
        saturday        	00:00-00:00
but no success, Nagios still takes may 1st and 3rd into considerations.

Re: timeperiod & availability raport problem

Posted: Tue May 14, 2013 2:39 pm
by slansing
Can you show us a copy of the entire timeperiod configuration that you are setting up here? It would look similar to this:

Code: Select all

define timeperiod{

	timeperiod_name		nonworkhours

	alias			Non-Work Hours

	sunday			00:00-24:00			; Every Sunday of every week

	monday			00:00-09:00,17:00-24:00		; Every Monday of every week

	tuesday			00:00-09:00,17:00-24:00		; Every Tuesday of every week

	wednesday			00:00-09:00,17:00-24:00		; Every Wednesday of every week

	thursday			00:00-09:00,17:00-24:00		; Every Thursday of every week

	friday			00:00-09:00,17:00-24:00		; Every Friday of every week

	saturday			00:00-24:00			; Every Saturday of every week

	}