Nagios - Custom Report Generation - nagios

I want to generate a custom report in "Nagios-3.2.0". I have defined the work-hours in "timeperiods.cfg" as follows:
'workhours' timeperiod definition
define timeperiod {
timeperiod_name 0800-2000
alias full time
monday 08:00-20:00
tuesday 08:00-20:00
wednesday 08:00-20:00
thursday 08:00-20:00
friday 08:00-20:00
saturday 08:00-20:00
}
Now, if I replace "saturday" with "2010-03-27" or "march 27" as shown below:
'workhours' timeperiod definition
define timeperiod {
timeperiod_name 0800-2000
alias full time
monday 08:00-20:00
tuesday 08:00-20:00
wednesday 08:00-20:00
thursday 08:00-20:00
friday 08:00-20:00
2010-03-27 08:00-20:00
}
Nagios is not generating report for the given date (2010-03-27).
How can I modify "timeperiods.cfg" so that I can generate reports for the given dates ?

have you reviewed this?
http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#timeperiod
I think you might have some luck trying other naming conventions.

Try changing the timeperiod_name to a non numneric name.
eg "eightoeight"

Related

How to call ICU APIs to give ISO date time format instead of default locale based values

Like to get ISO date-time value for option day of week.
https://unicode-org.github.io/icu/userguide/format_parse/datetime/
e local day of week
example: if Monday is 1st day, Tuesday is 2nd ) e or ee
eee
eeee
eeeee
eeeeee 2
Tue
Tuesday
T
Tu
ISO 8601, Monday is the first day of the week. If default locale is en_US, then Sunday become 1st day.
Eg. 2020-10-05, Monday with option 'e' give 2 because my locale is US. I don't see option to force ISO and ignore default locale in https://unicode-org.github.io/icu/userguide/format_parse/datetime/

Get week number based on ISO8601

Is there any way in SQL Server to get week number based on specific date which would reflect
according to ISO8601 where Monday is the first day of week?
Just use the aptly named ISO_WEEK Datepart:
iso_week datepart
ISO 8601 includes the ISO week-date system, a numbering system for weeks. Each week is associated with the year in which Thursday occurs. For example, week 1 of 2004 (2004W01) covered Monday, 29 December 2003 to Sunday, 4 January 2004. European countries / regions typically use this style of numbering. Non-European countries / regions typically do not use it.
SELECT DATEPART(ISO_WEEK,YourDate)
FROM dbo.YourTable;

Extended calendar which runs on 1st business day of 3rd of every month in autosys

I need to create extended calendar which will run on 1st business day of 3rd week of every month.
Mon to Fri are considered as working day and no holiday calendar included.
Sample dates for year 2018 :
16th Jan, 13th Feb, 13th Mar, 17th Apr, 15th May, 12th Jun, 17th Jul, 14th Aug, 11th Sep, 16th Oct, 13th Nov, 11th Dec
Currently I am using standard calendar for this but wants to change it to extended calendar to avoid manual inserts for every year.
#Manvi
not very confident of the exact condition and this would be a partial answer.
as for now i can think of
WEEK#03|WEEK#07|WEEK#11|WEEK#15|WEEK#20|WEEK#24|WEEK#28|WEEK#33|WEEK#37|WEEK#42|WEEK#46|WEEK#50
This would give you all the 3rd week of the the months and then hereon need to exclude the rest of the days.
You can refer this link for condition keywords.
Also, you can use below to include multiple keywords for desired output.
OR condition as "|"
NOT as "NOT"
Hope this helps. Good luck.
Will update incase i do find the solution.
Edits:
The first working day would definitely be a Monday and the previous day has to be 2nd Sunday.
Consider a calender as below
extended_calendar: Cal_name
description: 1st day of the 3rd week
workday: mo,tu,we,th,fr
non_workday:
holiday:
holcal:
cyccal:
adjust: +1
condition: sun#2
Sun#2 would consider the 2nd sunday of all months and the next day would mark the start of the 3rd week.
To consider the next day of the 2nd sunday adjust: +1 defined.
If you are looking for the 2nd day of the 3rd week. Defined adjust to +2.

QML Calendar: change first day of week

Is there any way to change the first day of the week on QML Calendar?
Not only Monday/Sunday, but also for any day of the week.
I found a workaround for Monday/Sunday; force Qt.locale() for a country which has Monday or Sunday specified as first day of the week, but it is not extended to the rest of the days. Thanks in advance!

gae cron job for last day of every month

I want the schedule of a cron job to be the las day of every month. I've used this:
<schedule>last day of month 23:59</schedule>
Is it correct?
The easiest way to launch the job at first of month 00:00. You may tweak it to run few hours before setting the <timezone> to the timezone with more positive value than the desired one. If desired timezone is GMT than you may set the timezone of the cron job to Europe/Berlin and the job will be executed last day of the month at 23:00 GMT.
As per the documentation, the format for the Cron Expression for the kind that you are trying to create is:
("every"|ordinal) (days) ["of" (monthspec)] (time)
Where:
ordinal specifies a comma separated list of "1st", "first" and so forth (both forms are ok)
days specifies a comma separated list of days of the week (for example, "mon", "tuesday", with both short and long forms being accepted); "every day" is equivalent to "every mon,tue,wed,thu,fri,sat,sun"
monthspec specifies a comma separated list of month names (for example, "jan", "march", "sep"). If omitted, implies every month. You can also say "month" to mean every month, as in "1,8,15,22 of month 09:00".
time specifies the time of day, as HH:MM in 24 hour time.
I don't think there is a direct expression for what you are trying to do.
You might need to create multiple cron expressions. For e.g. 31 of month 09:00 would address 31st day of all months at 9:00 AM and it should address all months that have 31 days and so on.

Resources