Net_Monitor
[ class tree: Net_Monitor ] [ index: Net_Monitor ] [ all elements ]

Class: Net_Monitor

Source Location: /Net_Monitor-0.0.7/Monitor.php

Class Overview


class Net_Monitor


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 46]
class Net_Monitor
  • Access: public


[ Top ]


Method Detail

Net_Monitor (Constructor)   [line 112]

void Net_Monitor( [array $services = array()], [array $alerts = array()], [ $options = array()])

function Net_Monitor
  • Access: public

Parameters:

array   $services   — 
array   $alerts   — 
   $options   — 

[ Top ]

check   [line 256]

mixed check( mixed $server, string $service)

function check

Check a single service ($service) on a single server ($server)

  • Access: public

Parameters:

mixed   $server   — 
string   $service   — 

[ Top ]

checkAll   [line 189]

void checkAll( )

function checkAll

Checks all services and sends all alerts.

  • Access: public

[ Top ]

getState   [line 418]

array getState( )

function getState

Retrieves previous state information from the directory specified in $_options['state_directory'] via a file named $_options['state_file']

  • Access: public

[ Top ]

loadAlerters   [line 300]

void loadAlerters( )

function loadAlerters

Load alert objects into Net_Monitor so that each type of alert is only used once.

  • Access: public

[ Top ]

loadClients   [line 275]

void loadClients( )

function loadClients

Load all clients into the Net_Monitor object so that each type of service client is only instantiated once.

  • Access: public

[ Top ]

printAlert   [line 592]

void printAlert( array $array)

function printAlert

Prints the alert specified in the associative array ($array) to STDOUT. Formats the alert according to $_options['alert_line'].

  • Access: public

Parameters:

array   $array   —  array

[ Top ]

resetHostState   [line 563]

void resetHostState( string $host, [string $service = null])

function resetHostState

Resets the state for a single host ($host). Optionally takes in a second parameter, $service, whereby the function only resets the results for that particular host/service test.

  • Access: public

Parameters:

string   $host   — 
string   $service   — 

[ Top ]

resetState   [line 534]

boolean resetState( )

function resetState

Resets the results and results differential arrays and deletes the state file.

Returns true if the file has been deleted or never existed in the first place; false otherwise.

  • Access: public

[ Top ]

saveState   [line 386]

void saveState( [array $results = null])

function saveState

Saves the current $_results array to the directory specified in $_options['state_directory'] as a file named $_options['state_file'].

If an array ($results) is passed to the function, that array is saved as state, otherwise this function acts upon $_results.

  • Access: public

Parameters:

array   $results   — 

[ Top ]

setAlerts   [line 176]

void setAlerts( array $alerts)

function setAlerts

Sets the alerts for the class

Overwrites $_alerts with input array ($alerts)

Net_Monitor_Alerts are of the form:

 $alerts = array('User1' => array('SMTP'=>'user1@example.com'),
                 'User2' => array('SMTP'=>'user2@example.com'));


Parameters:

array   $alerts   — 

[ Top ]

setOptions   [line 135]

void setOptions( array $options)

function setOptions

Sets additional options for the class

Merges input array ($options) with $this->_options

  • Access: public

Parameters:

array   $options   — 

[ Top ]

setServices   [line 157]

void setServices( array $services)

function setServices

Sets the services to monitor for the class

Overwrites $_services with input array ($services)

Net_Monitor_Services are of the form:

 $services = array('foo.example.com'=>array('SMTP','DNS'),
                   'bar.example.com'=>array('HTTP','FTP','DNS'));

  • Access: public

Parameters:

array   $services   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:12:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.