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

Class: Net_Monitor

Source Location: /Net_Monitor-0.0.6/Net_Monitor-0.0.6/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 75]

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

function Net_Monitor
  • Access: public

Parameters:

array   $services   —  services
array   $alerts   —  alerts
   $options   — 

[ Top ]

check   [line 214]

mixed check( mixed $server, string $service)

function check

Check a single service on a single server

  • Access: public

Parameters:

mixed   $server   —  server
string   $service   —  service

[ Top ]

checkAll   [line 148]

void checkAll( )

function checkAll

Checks all services and sends all alerts.

  • Access: public

[ Top ]

getState   [line 366]

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 255]

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 232]

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 531]

void printAlert( array $array)

function printAlert

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

  • Access: public

Parameters:

array   $array   —  array

[ Top ]

resetHostState   [line 504]

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

function resetHostState

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

  • Access: public

Parameters:

string   $host   —  host
   $service   — 

[ Top ]

resetState   [line 478]

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 336]

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 is passed to the function, that array is saved as state, otherwise this function acts upon $_results.

  • Access: public

Parameters:

array   $results   —  results

[ Top ]

setAlerts   [line 136]

void setAlerts( array $alerts)

function setAlerts

Sets the alerts for the class

Overwrites $_alerts with input array

Net_Monitor_Alerts are of the form:

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


Parameters:

array   $alerts   —  alerts

[ Top ]

setOptions   [line 97]

void setOptions( array $options)

function setOptions

Sets additional options for the class

Merges input array with $_options

  • Access: public

Parameters:

array   $options   —  options

[ Top ]

setServices   [line 118]

void setServices( array $services)

function setServices

Sets the services to monitor for the class

Overwrites $_services with input array

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   —  services

[ Top ]


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