Big Sister
List of all members
Statusmon::Statusmon Class Reference
Inheritance diagram for Statusmon::Statusmon:
Schedule Statusmon::BBLog Statusmon::bs_evgen Statusmon::DBStore Statusmon::Display Statusmon::DisplayCFG Statusmon::Grapher Statusmon::grouping Statusmon::history Statusmon::HTMLLog Statusmon::RRDi Statusmon::RRDs Statusmon::Rsync Statusmon::StatusTrap Statusmon::test Statusmon::TrackLast

Public Class Methods

 new ()

Public Object Methods

 setarg (scalar name, scalar val)
 getarg (scalar name)
 register (list masks)
 Register for a list of events.
 event (hashref cmd)
 Statusmon objects get their event() method invoked each time an event of one of the register() registered types is seen.
 post_event (hashref cmd, hashref org_event)
 Post an event and forward it to all interested parties.
 add_feature_provider (scalar feature)
 Register as a feature provider.
Statusmon::Statusmon get_feature_provider (scalar feature)
 Get a Statusmon::Statusmon object that registered as a feature provider for a specific feature.
scalar get_statustext (int code)
 Get the text associated with a status code.
int get_statuscode (scalar text)
 For a given status text return the corresponding status code.
int get_current_status (scalar check)
 Returns the status of a check.
scalar get_current_text (scalar check)
 Returns the current text of a check.
list get_checks (scalar group)
 Return a list of defined checks for a host or group.
list get_hosts ()
 Returns a list of known hosts/groups.
 abort ()
 Stop this status monitor.
 loopback (scalar cmd)
 Post a raw message and treat it like it was received from bbd.
int background ()
 Start a background process.

Public Functions

 init ()
 start ()

Additional Inherited Members

- Public Member Functions inherited from Schedule
retval new (scalar this, scalar frequency, scalar procedure)
retval sched_init (scalar frequency, scalar procedure)
retval sched_run (scalar minute, scalar currenttime, list args)
retval run (list args)
retval sched_frequency (scalar frequency)
retval sched_procedure (scalar procedure)
retval sched_gettime ()
retval schedule (scalar objs, scalar time, list args)
retval niceness ()

Member Function Documentation

Statusmon::Statusmon::abort ( )

Stop this status monitor.

This method is invoked by background() in order to signal the backgrounded process that it is not performing status monitoring any more.

Reimplemented in Statusmon::bs_evgen.

Statusmon::Statusmon::add_feature_provider ( scalar  feature)

Register as a feature provider.

Parameters
featureThe name of the feature.
int Statusmon::Statusmon::background ( )

Start a background process.

Actually, this is more or less a frontend for fork(). In the child process, abort() is called.

Returns
The pid of the child process, 0 in the child process, -1 if backgrounding failed
Statusmon::Statusmon::event ( hashref  cmd)

Statusmon objects get their event() method invoked each time an event of one of the register() registered types is seen.

param cmd The event.

list Statusmon::Statusmon::get_checks ( scalar  group)

Return a list of defined checks for a host or group.

Parameters
groupA host or group name
Returns
A list of check names defined for this host/group, an empty list if the host/group is not known

Reimplemented in Statusmon::grouping.

int Statusmon::Statusmon::get_current_status ( scalar  check)

Returns the status of a check.

Parameters
checkA string in the form "host.item" identifying a check.
Returns
The status code, undef if no status was found for this check.
scalar Statusmon::Statusmon::get_current_text ( scalar  check)

Returns the current text of a check.

Parameters
checkA string in the form "host.item" identifying a check.
Returns
The text, undef if no status was found for this check.
Statusmon::Statusmon Statusmon::Statusmon::get_feature_provider ( scalar  feature)

Get a Statusmon::Statusmon object that registered as a feature provider for a specific feature.

Parameters
featureThe name of the feature.
Returns
The registered object providing the feature, undef if none was found.
list Statusmon::Statusmon::get_hosts ( )

Returns a list of known hosts/groups.

Returns
List of hosts/groups
int Statusmon::Statusmon::get_statuscode ( scalar  text)

For a given status text return the corresponding status code.

Parameters
textStatus text.
Returns
The status code that is associated with the given text.
scalar Statusmon::Statusmon::get_statustext ( int  code)

Get the text associated with a status code.

Parameters
codeThe status code
Returns
The status text (such as "red", "green", ...)
Statusmon::Statusmon::getarg ( scalar  name)
Statusmon::Statusmon::init ( )

Reimplemented in Statusmon::bs_evgen.

Statusmon::Statusmon::loopback ( scalar  cmd)

Post a raw message and treat it like it was received from bbd.

Parameters
cmdThe message string
Statusmon::Statusmon::new ( )
Statusmon::Statusmon::post_event ( hashref  cmd,
hashref  org_event 
)

Post an event and forward it to all interested parties.

Parameters
cmdThe event to post
org_event(optional) If the event is posted as a reaction to another event the original event must be passed in this argument.
Statusmon::Statusmon::register ( list  masks)

Register for a list of events.

Parameters
masksA list of event types to register for. If an event type is prefixed with a '-' character, then the registration for this event type is removed.
Statusmon::Statusmon::setarg ( scalar  name,
scalar  val 
)
Statusmon::Statusmon::start ( )

The documentation for this class was generated from the following file: