Mon::Client

Mon::Client is a Perl module with methods for interaction with Mon client.
Download

Mon::Client Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Mon::Client team
  • Publisher web site:
  • http://search.cpan.org/~trockij/Mon-0.11/Mon/Client.pm

Mon::Client Tags


Mon::Client Description

Mon::Client is a Perl module with methods for interaction with Mon client. Mon::Client is a Perl module with methods for interaction with Mon client.SYNOPSIS use Mon::Client;Mon::Client is used to interact with "mon" clients. It supports a protocol-independent API for retrieving the status of the mon server, and performing certain operations, such as disableing hosts and service checks.METHODSnewCreates a new object. A hash can be supplied which sets the default values. An example which contains all of the variables that you can initialize: $c = new Mon::Client ( host => "monhost", port => 2583, username => "foo", password => "bar", );password (pw)If pw is provided, sets the password. Otherwise, returns the currently set password.host (host)If host is provided, sets the mon host. Otherwise, returns the currently set mon host.port (portnum)If portnum is provided, sets the mon port number. Otherwise, returns the currently set port number.username (user)If user is provided, sets the user login. Otherwise, returns the currently set user login.protIf protocol is provided, sets the protocol, specified by a string which is of the form "1.2.3", where "1" is the major revision, "2" is the minor revision, and "3" is the sub-minor revision. If protocol is not provided, the currently set protocol is returned.protid ()Returns true if client and server protocol match, false otherwise. Implicitly called by connect. If protocol is specified as an integer, supplies that protocol version to the server for verification.versionReturns the protocol version of the remote server.errorReturns the error string from set by the last method, or undef if there was no error.connectedReturns 0 (not connected) or 1 (connected).connect (%args)Connects to the server. If host and port have not been set, uses the defaults. Returns undef on error. If $args{"skip_protid"} is true, skip protocol identification upon connect.disconnectDisconnects from the server. Return undef on error.login ( %hash )%hash is optional, but if specified, should contain two keys, username and password.Performs the "login" command to authenticate the user to the server. Uses username and password if specified, otherwise uses the username and password previously set by those methods, respectively.checkauth ( command )Checks to see if the specified command, as executed by the current user, is authorized by the server, without actually executing the command. Returns 1 (command is authorized) or 0 (command is not authorized).disable_watch ( watch )Disables watch.disable_service ( watch, service )Disables a service, as specified by watch and service.disable_host ( host )Disables host.enable_watch ( watch )Enables watch.enable_service ( watch, service )Enables a service as specified by watch and service.enable_host ( host )Enables host.set ( group, service, var, val )Sets var in group,service to val. Returns undef on error.get ( group, service, var )Gets variable var in group,service and returns it, or undef on error.quitLogs out of the server. This method should be followed by a call to the disconnect method.list_descriptionsReturns a hash of service descriptions, indexed by watch and service. Requirements: · Perl


Mon::Client Related Software