![]() |
![]() |
|
Newsletter | Forum | Contact Us | News | Products | Downloads | Support | Partners |
|
|
Week planning with LUA scriptIntroductionWhen maintenance period is required or time period conditonnal checking is necessary, the use of the following LUA script program will be useful. LUA scripting extends the power of LoriotPro by allowing you to manage and monitor your information system in unrevalled ways. The InPlannedPeriods(DateTime,WeekPlanning,IsDebug) function provided in the following script checks (return 1) if the provided time is located in one of the period declared in a week planner. Example of Week Planning
This one will allow you for example to disable the host polling on multiple ranges of time per day (period) and depending of the day in the week. Here under an example of execution of the LUA function InPlannedPeriods
DownloadDownload LUA script exemple. Structure of the LUA exampleThe LUA code below contains two functions:
The first one check that the planning defined later in the script conatins autorized values. The second one is the main function that check that a provided time (DateTime) is within a time period define in the Week planner table (WeekPlanning) Beware that the WeekPlanning table should follow a strict structure that cannot be modified. The contain of the Planning could be modified with multiple time ranges. Here is an exemple of WeekPlanning table:
Each time range must be define in a table with the following syntax {starting={H=hours,M=minutes,S=seconds},ending{H=hours,M=minutes,S=seconds}} hours, minutes and seconds must be replaced by integer values in the range of 0-23,0-59,0-59 Multiple time ranges can be defined, if ranges overlapes then the first matched range is selected by the InPlannedPeriods function. Disabling Host polling on Week PlanningThe upper code can be extended to trigger actions when we are in a time range or out of a time range. The following script disable the polling of a Host at the specied time range in the week planning. Download the example code Return of execution example:
In LoriotPro the Polling is disable
|
| Newsletter | Forum | Contact Us | News | Products | Downloads | Support | Partners | |||||
|
|||||