Downtime Class Reference

Class Downtime. More...

Inheritance diagram for Downtime:
RecurringDowntime

Public Member Functions

 __construct ($model)
 Provides helpers for working with scheduled downtime.
 get_month_occurrence ($number)
 Returns the ordinal (or occurrence) for the given number.
 get_window ($target_date)
 Create downtime window using the given $target_date, with the scheduled start and end time.
 get_command_mappings ($obj_name, $downtime_window, $comment_prefix= '')
 Returns a formatted downtime command.
 get_command ($obj_name, $downtime_window, $comment_prefix= 'AUTO: ')
 Converts command mappings to a Nagios-interpretable string format.
 dow_to_string ($day_number)
 Converts day of week number to string, starting with sunday.
 get_scheduled_start ()
 Returns NinjaDateTime given start date and time strings.
 get_scheduled_end ()
 Returns NinjaDateTime given end date and time strings.

Data Fields

 $model
 object RecurringDowntimePool_Model
 $start
 NinjaDateTime schedule start.
 $end
 NinjaDateTime schedule end.
 $cmd_mappings
 array

Detailed Description

Class Downtime.


Constructor & Destructor Documentation

Downtime::__construct ( model  ) 

Provides helpers for working with scheduled downtime.

Downtime constructor.

Parameters:
$model object (RecurringDowntimePool_Model)
Exceptions:
Exception 

Reimplemented in RecurringDowntime.


Member Function Documentation

Downtime::dow_to_string ( day_number  ) 

Converts day of week number to string, starting with sunday.

Parameters:
$day_number int
Returns:
string day of week name
Exceptions:
Exception UnexpectedValueException
Downtime::get_command ( obj_name,
downtime_window,
comment_prefix = 'AUTO: ' 
)

Converts command mappings to a Nagios-interpretable string format.

Parameters:
$obj_name string
$downtime_window array
$comment_prefix string comment prefix
Returns:
string Nagios external command
Downtime::get_command_mappings ( obj_name,
downtime_window,
comment_prefix = '' 
)

Returns a formatted downtime command.

Parameters:
$obj_name string
$downtime_window array
$comment_prefix string comment prefix
Returns:
array command map
Downtime::get_month_occurrence ( number  ) 

Returns the ordinal (or occurrence) for the given number.

Parameters:
$number int|mixed
Returns:
string monthly occurrence (e.g. third)
Exceptions:
Exception UnexpectedValueException
Downtime::get_scheduled_end (  ) 

Returns NinjaDateTime given end date and time strings.

Returns:
NinjaDateTime
Exceptions:
Exception UnexpectedValueException
Downtime::get_scheduled_start (  ) 

Returns NinjaDateTime given start date and time strings.

Returns:
NinjaDateTime
Exceptions:
Exception UnexpectedValueException
Downtime::get_window ( target_date  ) 

Create downtime window using the given $target_date, with the scheduled start and end time.

Parameters:
$target_date NinjaDateTime
Returns:
array

Field Documentation

Downtime::$cmd_mappings
Initial value:
 array(
                'hosts' => 'SCHEDULE_HOST_DOWNTIME',
                'services' => 'SCHEDULE_SVC_DOWNTIME',
                'hostgroups' => 'SCHEDULE_HOSTGROUP_HOST_DOWNTIME',
                'servicegroups' => 'SCHEDULE_SERVICEGROUP_SVC_DOWNTIME'
        )

array


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 18 May 2020 for ninja by  doxygen 1.6.1