timeperiod & availability raport problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
babz
Posts: 4
Joined: Fri Jan 04, 2013 4:20 am

timeperiod & availability raport problem

Post 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 ?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: timeperiod & availability raport problem

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
babz
Posts: 4
Joined: Fri Jan 04, 2013 4:20 am

Re: timeperiod & availability raport problem

Post 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).
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: timeperiod & availability raport problem

Post 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)
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.
babz
Posts: 4
Joined: Fri Jan 04, 2013 4:20 am

Re: timeperiod & availability raport problem

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: timeperiod & availability raport problem

Post 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

	}
Locked