Class: gkrellm_client

Source Location: /gkrellm_client.class.php

Class Overview [line 38]


Author(s):

Version:

Copyright:

Variables

Constants

Methods


Inherited Variables

Inherited Constants

Inherited Methods



Class Details

[ Top ]


Class Variables


Class Methods

static format_bytes

static string format_bytes( int $i_bytes)

[line 283]

Returns a string representing the specified number of bytes, formatted according to the amount of data.

e.g. format_bytes(1024) will return "1 KB"

Tags:

  • return - The formatted string
  • access - public

Parameters:

  • int $i_bytes -

[ Top ]

__construct

gkrellm_client __construct( [string $s_host = ''], [int $i_port = 0], [float $f_timeout = 5])

[line 65]

Returns a new gkrellm_client object (but doesn't connect to the specified host)

Tags:

  • access - public

Parameters:

  • string $s_host - The hostname of the server to connect to
  • int $i_port - The port on which gkrellmd is running (defaults to 19150)
  • float $f_timeout - Time after which a connection attempt should timeout

[ Top ]

connect

bool connect( [bool $b_remain_connected = false])

[line 643]

Establish a connection to the server. This connection is automatically terminated once the initial update has been retrieved from the server, unless $b_remain_connected is true.

Tags:

  • return - false on connection/data error, true otherwise
  • access - public

Parameters:

  • bool $b_remain_connected - Specifies whether or not to disconnect once the initial update has been retrieved

[ Top ]

connected

bool connected( )

[line 574]

Tags:

  • return - true if connected to the server
  • access - public

Parameters:

[ Top ]

disconnect

void disconnect( )

[line 628]

Disconnect from the server.

Tags:

  • access - public

Parameters:

[ Top ]

get_cpu_info

gkrellm_update_cpu get_cpu_info( )

[line 116]

Tags:

  • return - The latest data relating to the server's CPU(s)
  • access - public

Parameters:

[ Top ]

get_decimal_point

string get_decimal_point( )

[line 92]

Tags:

  • return - gkrellmd's decimal point string
  • access - public

Parameters:

[ Top ]

get_disk_activity

int get_disk_activity( string $s_disk, float $f_sample_time)

[line 208]

Tags:

  • return - The average number of bytes written to/read from disk per second over a specified period of time
  • access - public

Parameters:

  • string $s_disk - Specifies the device to query. If empty, the total for all disks will be returned.
  • float $f_sample_time - The period of time (in seconds) over which to take the sample

[ Top ]

get_disk_info

gkrellm_update_disk get_disk_info( )

[line 303]

Tags:

  • return - The latest data relating to the server's disks
  • access - public

Parameters:

[ Top ]

get_fsmounts_info

gkrellm_update_fsfsmount get_fsmounts_info( )

[line 319]

Tags:

  • return - The latest data relating to the server's mounted filesystems
  • access - public

Parameters:

[ Top ]

get_fstab_info

gkrellm_update_fsfstab get_fstab_info( )

[line 311]

Tags:

  • return - The latest data relating to the server's filesystems
  • access - public

Parameters:

[ Top ]

get_hostname

string get_hostname( )

[line 391]

Tags:

  • return - The server's hostname as reported by gkrellmd
  • access - public

Parameters:

[ Top ]

get_inet_info

gkrellm_update_inet get_inet_info( )

[line 327]

Tags:

  • return - The latest data relating to the server's network connections
  • access - public

Parameters:

[ Top ]

get_interface_bandwidth_use

int get_interface_bandwidth_use( string $s_interface, float $f_sample_time)

[line 245]

Tags:

  • return - The average number of bytes per second transferred/received by a particular network interface
  • access - public

Parameters:

  • string $s_interface - Specifies the network interface to query
  • float $f_sample_time - The period of time (in seconds) over which to take the sample

[ Top ]

get_io_timeout

int get_io_timeout( )

[line 84]

Tags:

  • return - gkrellmd's IO Timeout value
  • access - public

Parameters:

[ Top ]

get_last_error

string get_last_error( )

[line 681]

Tags:

  • return - A textual description of the last error that occurred
  • access - public

Parameters:

[ Top ]

get_mem_info

gkrellm_update_mem get_mem_info( )

[line 335]

Tags:

  • return - The latest data relating to the server's memory
  • access - public

Parameters:

[ Top ]

get_net_info

gkrellm_update_net get_net_info( )

[line 343]

Tags:

  • return - The latest data relating to the server's network interfaces
  • access - public

Parameters:

[ Top ]

get_next_update

gkrellm_update get_next_update( )

[line 582]

Tags:

  • access - public

Parameters:

[ Top ]

get_next_update_of_type

gkrellm_update get_next_update_of_type( int $i_type, [int $i_timeout = 5])

[line 128]

Keeps on fetching updates until one of the desired type is found, or until the timeout value is reached

Tags:

Parameters:

  • int $i_type - The type of update required
  • int $i_timeout -

[ Top ]

get_proc_info

gkrellm_update_proc get_proc_info( )

[line 351]

Tags:

  • return - The latest data relating to the server's processes and users
  • access - public

Parameters:

[ Top ]

get_reconnect_timeout

int get_reconnect_timeout( )

[line 108]

Tags:

  • return - gkrellmd's reconnect timeout value
  • access - public

Parameters:

[ Top ]

get_sensors_info

gkrellm_update_sensor get_sensors_info( )

[line 359]

Tags:

  • return - The latest data relating to the server's sensors
  • access - public

Parameters:

[ Top ]

get_server_version

string get_server_version( )

[line 100]

Tags:

  • access - public

Parameters:

[ Top ]

get_swap_info

gkrellm_update_swap get_swap_info( )

[line 367]

Tags:

  • return - The latest data relating to the server's swap
  • access - public

Parameters:

[ Top ]

get_sysname

string get_sysname( )

[line 399]

Tags:

  • return - The server's sysname as reported by gkrellmd
  • access - public

Parameters:

[ Top ]

get_time_info

gkrellm_update_cpu get_time_info( )

[line 375]

Tags:

  • return - The latest data relating to the server's clock
  • access - public

Parameters:

[ Top ]

get_update

gkrellm_update get_update( int $i_type)

[line 409]

Tags:

  • return - The latest update of the type specified by $i_type (see gkrellm update classes for appropriate constants).
  • access - public
  • see - gkrellm_update

Parameters:

  • int $i_type - The type of update to get

[ Top ]

get_update_sample

array get_update_sample( int $i_update_type, float $f_sample_time)

[line 158]

Fetches two updates spanning a period of time specified by $f_sample_time. Can be used for example to calculate the average bandwidth used by a network interface over a period of seconds.

Tags:

  • return - Indexes 'start_time' and 'finish_time' contain timestamps marking the beginning and end of the sample respectively. Indexes 'update1' and 'update2' contain the first and second updates in the sample. Returns false if unsuccessful (if, for example, the operation times out).
  • access - public

Parameters:

  • int $i_update_type - The type of update required
  • float $f_sample_time - The period of time (in seconds) over which to take the sample

[ Top ]

get_uptime_info

gkrellm_update_cpu get_uptime_info( )

[line 383]

Tags:

  • return - The latest data relating to the server's uptime
  • access - public

Parameters:

[ Top ]

set_host

void set_host( string $s_host)

[line 425]

Tags:

  • access - public

Parameters:

  • string $s_host -

[ Top ]

set_port

void set_port( int $i_port)

[line 433]

Tags:

  • access - public

Parameters:

  • int $i_port -

[ Top ]

set_version_string

void set_version_string( string $s_string)

[line 442]

Tags:

Parameters:

  • string $s_string - The version string to send to gkrellmd (default set in php-gkrellm config file)

[ Top ]


Class Constants


Documentation generated on Sun, 29 Oct 2006 21:26:06 +0000 by phpDocumentor 1.3.0