[ Index ]

PHP Cross Reference of Yamoon 0.9.0

title

Body

[close]

/Yamoon/ -> Probe.php (summary)

(no description)

File Size: 232 lines (8 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 4 files
 Yamoon/Service.php
 Yamoon/Company.php
 Yamoon/Config.php
 Yamoon/Host.php

Defines 1 class

Probe:: (10 methods):
  Probe()
  create()
  run()
  execute()
  updateStatus()
  update()
  delete()
  clearLogs()
  getStats()
  dump()


Class: Probe  - X-Ref

Probe.php - manage probe creation, update and deletes.

Probes are the heart of Yamoon, it manage also the execution
of all services on all hosts of all companies. An external script
(poller.php) will get all active probes and call it's method run().

It will execute the probe, backup the data from the last run and update
all new data to the probes. This class also get the probe's uptime status
for the last year, month and day for SLA purposes.

The backup log will be used for the MRTG generator to show graphics for
status, quality and delay for each probe.

obs: each probe must have a service and a host associated
Probe($config, $id="")   X-Ref
Probe Constructor
$probe = new Probe($config, $id);

param $config Configuration class
param $id When provided, grab all info for that probe

create($company_id, $service, $host, $active='Y')   X-Ref
Create a new probe. Construct object first.

$host->create($company->id, $service->id, $host->id, 'Y');

param $company_id The company this host is part
param $service The service ID that will run on the host
param $host The host ID
param $active An active probe will run every time poller.php is called
return $id Newly created host's ID

run()   X-Ref
Run the probe, this is the main execution entry point. This method will
call the execute() method, measuring the elapsed time and update the
status of the probe, logging the last result for MRTG graphics construction.

print $probe->run()

see execute()
see updateStatus()
return $results A log line for integration with other tools or just debug

execute()   X-Ref
Execute the probe. Set environment variables YM_HOST and YM_IP and
call for "command code". Than, use the regular expressions to get the
status (result, for up or down) and the current quality (quality).

No example (do not use this function directly, call method run() instead)

updateStatus()   X-Ref
Backup and update the current probe on the database using the current parameters.
This function is used to keep the logs for MRTG graphics used on $probe->run() method.

No example (do not use this function directly, call method run() instead)

update()   X-Ref
Update the current probe on the database using the current parameters.
$probe->active = "N";
$probe->update()


delete()   X-Ref
Delete the current probe.
$probe->delete();


clearLogs()   X-Ref
Clear all logs
$probe->clearLogs();


getStats()   X-Ref
Get uptime status for this probe: last year, last month and last day.
$data = $probe->getStatus();

return $data A hash with three fields: year, month and day status

dump()   X-Ref
Dumper.
$probe->dump();




Generated: Sat Feb 19 17:29:53 2005 Cross-referenced by PHPXref 0.6