dassmonarch Class Reference

Access monarch. More...

List of all members.

Public Class Methods

object new (void)
void DESTROY (void)

Public Object Methods

boolean set_debuglevel (string newlevel)
int get_debuglevel (void)
void debug (string msglevel, string message)
string get_debugmessages (void)
string get_errormessages (void)
string dassmonarch_version (void)
vstring dassmonarch_vstring (void)
string monarch_version (void)
vstring monarch_vstring (void)
string nagios_version (void)
boolean update_or_insert_obj (string table, string searchcolumn, string searchvalue, hashref valref)
boolean host_exists (string hostname)
boolean hostgroup_exists (string hostgroupname)
boolean service_exists (string servicename)
boolean host_extinfo_template_exists (string templatename)
boolean service_extinfo_template_exists (string templatename)
boolean monarch_group_exists (string monarch_group)
int get_hostprofileid (string hostprofilename)
int get_serviceprofileid (string serviceprofilename)
int get_serviceid (string servicename)
int get_hostid (string hostname)
int get_host_serviceid (string hostname, string servicename)
int get_hostgroupid (string hostgroupname)
int get_escalation_tree_id (string escalationname, string type)
int get_extended_host_information_template_id (param extended_host_information_template)
string get_hostprofilename (int hostprofile_id)
string get_serviceprofilename (int serviceprofile_id)
string get_genericservicename (int servicename_id)
string get_hostname (int host_id)
string get_servicename (int service_id)
arrayref get_hosts_with_address (string address)
array get_hostlist (void)
array get_hostgroups_for_host (string hostname)
array get_hosts_in_hostgroup (string hostgroup)
array get_hostservice_list (string hostname)
array get_all_service_dependencies (void)
hashref search_service_by_prefix (string prefix)
boolean import_host (string hostname, string alias, string address, string profile_name, boolean update)
boolean import_host_api (string hostname, string alias, string address, string profile_name, boolean update)
boolean clone_host (string src_host, string dest_host, string dest_alias, string dest_address)
boolean clone_service (string src_service, string dest_service)
DEPRECATED boolean assign_host_profile (string hostname, string hostprofilename, boolean replace)
boolean assign_and_apply_hostprofile_to_host (string hostname, string hostprofilename, boolean replace)
DEPRECATED boolean apply_hostprofile_service_profiles (string hostname, string hostprofilename, boolean replace)
boolean assign_and_apply_hostprofile_serviceprofiles (string hostname, string hostprofilename, boolean replace)
boolean assign_and_apply_serviceprofile_to_host (string hostname, string serviceprofilename, boolean replace)
boolean remove_serviceprofile_from_host (string hostname, string serviceprofilename)
boolean create_hostgroup (string hostgroupname, string alias)
boolean assign_hostgroup (string hostname, string hostgroup)
boolean assign_servicegroup (string host, string service, string servicegroup)
boolean set_host_overrides_properties (string hostname, hashref propref)
boolean set_service_overrides_properties (string hostname, string servicename, hashref propref)
boolean add_service (string hostname, string service)
boolean remove_service (string hostname, string servicename)
boolean create_extended_host_info_template (string template_name, string notes, string notes_url, string action_url, string icon_image, string icon_image_alt, string statusmap_image, string vrml_image)
boolean apply_extended_host_information_template (string hostname, string extended_host_information_template)
boolean apply_hostescalation_tree (string hostname, string escalation_tree)
boolean apply_service_escalation_tree_to_host (string hostname, string escalation_tree)
boolean apply_serviceescalation_tree_to_hostservice (string hostname, string servicename, string escalation_tree)
boolean apply_serviceescalation_tree_to_all_hostservices (string hostname, string escalation_tree)
boolean delete_host (string hostname)
boolean delete_hosts (string searchstring)
boolean delete_hostgroup_members (string hostgroupname)
boolean delete_hostgroup (string hostgroupname)
boolean delete_service (string servicename)
boolean delete_services (string searchstring)
boolean delete_host_ext_info_template (string templatename)
boolean delete_host_ext_info_template_list (string templatename_starts)
boolean set_parents (string hostname, arrayref parents)
array get_host_parent (string hostname)
boolean enable_active_host_checks (string hostname)
boolean enable_active_service_checks (string hostname, string servicename)
boolean enable_obsess_host_checks (string hostname)
boolean enable_obsess_service_checks (string hostname, string servicename)
boolean enable_all_active_service_checks_on_host (string hostname)
boolean enable_all_obsess_service_checks_on_host (string hostname)
boolean enable_active_service_check_on_hostgroup (string hostgroup, string servicename)
boolean enable_obsess_service_check_on_hostgroup (string hostgroup, string servicename)
boolean enable_all_active_service_checks_on_hostgroup (string hostgroup)
boolean enable_all_obsess_service_checks_on_hostgroup (string hostgroup)
boolean disable_active_host_checks (string hostname)
boolean disable_active_service_checks (string hostname, string servicename)
boolean disable_obsess_host_checks (string hostname)
boolean disable_obsess_service_checks (string hostname, string servicename)
boolean disable_all_active_service_checks_on_host (string hostname)
boolean disable_all_obsess_service_checks_on_host (string hostname)
boolean disable_active_service_check_on_hostgroup (string hostgroup, string servicename)
boolean disable_obsess_service_check_on_hostgroup (string hostgroup, string servicename)
boolean disable_all_active_service_checks_on_hostgroup (string hostgroup)
boolean disable_all_obsess_service_checks_on_hostgroup (string hostgroup)
DEPRECATED boolean assign_monarch_group_host (string monarch_group, string hostname)
boolean assign_monarch_group_hosts (string monarch_group, arrayref hosts)
boolean assign_monarch_group_hostgroups (string monarch_group, arrayref hostgroups)
boolean assign_monarch_group_subgroups (string monarch_group, arrayref subgroups)
arrayref get_monarch_group_hosts (string monarch_group)
arrayref get_monarch_group_hostgroups (string monarch_group)
hashref get_monarch_group_orphans (void)
arrayref get_monarch_group_subgroups (string monarch_group)
string get_monarchgroup_location (string monarch_group)
boolean remove_monarch_group_hosts (string monarch_group, arrayref hosts)
boolean remove_monarch_group_hostgroups (string monarch_group, arrayref hostgroups)
boolean remove_monarch_group_subgroups (string monarch_group, arrayref subgroups)
int create_external (string external_name, string description, string type, string content)
boolean rename_external (string old_external_name, string new_external_name)
boolean delete_external (string external_name)
boolean assign_external_to_hostprofile (string hostprofile_name, string external_name)
boolean assign_external_to_service (string service_name, string external_name)
boolean apply_external_to_host (string host_name, string external_name, boolean modified)
boolean apply_external_to_hostservice (string host_name, string service_name, string external_name, boolean modified)
boolean modify_external (string external_name, string description, string content)
boolean modify_host_external (string host_name, string external_name, string content, boolean modified)
boolean modify_hostservice_external (string host_name, string service_name, string external_name, string content, boolean modified)
boolean remove_external_from_hostprofile (string hostprofile_name, string external_name)
boolean remove_external_from_service (string service_name, string external_name)
boolean remove_external_from_host (string host_name, string external_name)
boolean remove_external_from_hostservice (string host_name, string service_name, string external_name)
hashref get_external (string external_name)
int get_externalid (string external_name)
string get_externalname (int external_id)
hashref get_host_external (string host_name, string external_name)
hashref get_hostservice_external (string host_name, string service_name, string external_name)
arrayref list_externals (string type)
arrayref list_hostprofile_externals (string hostprofile_name)
arrayref list_service_externals (string service_name)
arrayref list_host_externals (string host_name)
arrayref list_hostservice_externals (string host_name, string service_name)
arrayref list_hostprofiles_with_external (string external_name)
arrayref list_services_with_external (string external_name)
arrayref list_hosts_with_external (string external_name)
arrayref list_hostservices_with_external (string external_name)
boolean propagate_external (string external_name, boolean replace)
boolean buildAllExternals (boolean force)
boolean buildSomeExternals (arrayref hostsref, boolean force)
boolean pre_flight_check (string monarchgroup)
boolean generateAndCommit (void)
boolean build_instance (string monarch_group)


Detailed Description

Access monarch.

This class provides relevant methods to access the monarch DB in order to automatically import configuration data.


Member Function Documentation

boolean dassmonarch::add_service ( string  hostname,
string  service 
)

Add a service to a host.

Parameters:
hostname Hostname
service Service to add.
Returns:
success true if successful, false otherwise

boolean dassmonarch::apply_extended_host_information_template ( string  hostname,
string  extended_host_information_template 
)

Apply an extended host information template to a host.

Parameters:
hostname Host to apply the template to
extended_host_information_template name of template to apply
Returns:
success true if successful, else false

boolean dassmonarch::apply_external_to_host ( string  host_name,
string  external_name,
boolean  modified 
)

Applies a host external to a host. Overwrites existing external content and metadata if this host external was already applied.

Parameters:
host_name Name of host to which the external is to be applied.
external_name Name of the host external to be applied.
modified True, if the external is to be marked as a custom copy. False, if the external is to be marked as an unmodified copy.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::apply_external_to_hostservice ( string  host_name,
string  service_name,
string  external_name,
boolean  modified 
)

Applies a service external to a host service. Overwrites existing external content and metadata if this service external was already applied.

Parameters:
host_name Name of host on which the service resides.
service_name Name of the host service to which the external is to be applied.
external_name Name of the host external to be applied.
modified True, if the external is to be marked as a custom copy. False, if the external is to be marked as an unmodified copy.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::apply_hostescalation_tree ( string  hostname,
string  escalation_tree 
)

Apply a host escalation tree to a host.

Parameters:
hostname Host to apply the escalation tree
escalation_tree Tree name to apply
Returns:
success true if successful, else false

DEPRECATED boolean dassmonarch::apply_hostprofile_service_profiles ( string  hostname,
string  hostprofilename,
boolean  replace 
)

Apply all service profiles which are assigned to a host profile to a host. This function is deprecated, due to a misleading name; use assign_and_apply_hostprofile_serviceprofiles instead.

Parameters:
hostname Host, to which the service profiles should be applied
hostprofilename Hostprofile, whose serviceprofiles will be assigned to the host
replace True, if existing services should be replaced by services in the host profile's service profiles. False, if services should be merged.
Returns:
success true if successful, false otherwise

boolean dassmonarch::apply_service_escalation_tree_to_host ( string  hostname,
string  escalation_tree 
)

Apply a service escalation tree to a host. This overwrites eventually existing service escalations for a particular service of that host. This means you can only use this option, if really ALL services are to be escalated following the same tree.

Parameters:
hostname Host to apply the escalation tree
escalation_tree Tree name to apply
Returns:
success true if successful

boolean dassmonarch::apply_serviceescalation_tree_to_all_hostservices ( string  hostname,
string  escalation_tree 
)

Apply a service escalation tree to all already-defined services on a host. Use this, if you want to have different escalation trees for later defined services. If you want to have the same tree on definitely all services on a host, use apply_service_escalation_tree_to_host instead.

Parameters:
hostname Host to apply the escalation tree
escalation_tree Tree name to apply
Returns:
success true if successful, else false

boolean dassmonarch::apply_serviceescalation_tree_to_hostservice ( string  hostname,
string  servicename,
string  escalation_tree 
)

Apply a service escalation tree to a particular service on a host.

Parameters:
hostname Host to apply the escalation tree
servicename Service
escalation_tree Tree name to apply
Returns:
success true if successful, else false

boolean dassmonarch::assign_and_apply_hostprofile_serviceprofiles ( string  hostname,
string  hostprofilename,
boolean  replace 
)

Apply all service profiles which are assigned to a host profile to a host.

Parameters:
hostname Host, to which the service profiles should be applied
hostprofilename Hostprofile, whose serviceprofiles will be assigned to the host
replace True, if existing services should be replaced by services in the host profile's service profiles. False, if services should be merged.
Returns:
success true if successful, false otherwise

boolean dassmonarch::assign_and_apply_hostprofile_to_host ( string  hostname,
string  hostprofilename,
boolean  replace 
)

Assign a host profile and associated service profiles to a host.

Parameters:
hostname Host, who should be applied to hostprofile
hostprofilename Profile to attach to host
replace True, if existing services should be replaced by services in associated service profiles. False, if services should be merged.
Returns:
success true if successful, false otherwise

boolean dassmonarch::assign_and_apply_serviceprofile_to_host ( string  hostname,
string  serviceprofilename,
boolean  replace 
)

Assign a service profile to a host, and apply the corresponding services to that host.

Parameters:
hostname Host to which the service profile is to be assigned and applied.
serviceprofilename Profile to attach to host
replace True, if existing services should be replaced by services in the service profile. False, if services should be merged.
Returns:
success true if successful, false otherwise

boolean dassmonarch::assign_external_to_hostprofile ( string  hostprofile_name,
string  external_name 
)

Assigns a host external to a host profile.

Parameters:
hostprofile_name Host profile name.
external_name Name of the host external.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::assign_external_to_service ( string  service_name,
string  external_name 
)

Assigns a service external to a generic service.

Parameters:
service_name Service name.
external_name Name of the service external.
Returns:
boolean outcome; true if successful, false otherwise

DEPRECATED boolean dassmonarch::assign_host_profile ( string  hostname,
string  hostprofilename,
boolean  replace 
)

Assign a host profile and associated service profiles to a host. This function is deprecated, due to a misleading name; use assign_and_apply_hostprofile_to_host instead.

Parameters:
hostname Host, who should be applied to hostprofile
hostprofilename Profile to attach to host
replace True, if existing services should be replaced by services in associated service profiles. False, if services should be merged.
Returns:
success true if successful, false otherwise

boolean dassmonarch::assign_hostgroup ( string  hostname,
string  hostgroup 
)

Assign a host to a hostgroup.

Parameters:
hostname The host to be assigned
hostgroup Hostgroup name the host shall join
Returns:
success true if operation successful, else false

DEPRECATED boolean dassmonarch::assign_monarch_group_host ( string  monarch_group,
string  hostname 
)

Assign a single host to a monarch group. This function is deprecated; use assign_monarch_group_hosts instead.

Parameters:
monarch_group Monarch group name
hostname name of a particular single host
Returns:
success true if assign_monarch_group_host succeeds, false otherwise.

boolean dassmonarch::assign_monarch_group_hostgroups ( string  monarch_group,
arrayref  hostgroups 
)

Assign specified hostgroups to a monarch group.

Parameters:
monarch_group Monarch group name
hostgroups reference to an array of hostgroup names
Returns:
success true if assign_monarch_group_hostgroups completely succeeds, false otherwise.

boolean dassmonarch::assign_monarch_group_hosts ( string  monarch_group,
arrayref  hosts 
)

Assign specified hosts to a monarch group.

Parameters:
monarch_group Monarch group name
hosts reference to an array of hostnames
Returns:
success true if assign_monarch_group_hosts completely succeeds, false otherwise.

boolean dassmonarch::assign_monarch_group_subgroups ( string  monarch_group,
arrayref  subgroups 
)

Assign specified subgroups to a monarch group.

Parameters:
monarch_group Monarch group name
subgroups reference to an array of monarch group names
Returns:
success true if assign_monarch_group_subgroups completely succeeds, false otherwise.

boolean dassmonarch::assign_servicegroup ( string  host,
string  service,
string  servicegroup 
)

Assign a specific host's service to a servicegroup.

Parameters:
host Host, which service should be included in servicegroup
service The Host's service
servicegroup Name of the servicegroup
Returns:
success true if successful (if service is already a group member, too). False otherwise

boolean dassmonarch::build_instance ( string  monarch_group  ) 

Builds the configuration for a given Monarch Group, in the directory configured in group details, and calls the Monarch Deploy code.

Parameters:
monarch_group monarch group to build
Returns:
success true if build and deploy succeed, false otherwise.

boolean dassmonarch::buildAllExternals ( boolean  force  ) 

Perform a build_all_externals operation.

Parameters:
force true means force regeneration even if there is no significant change in content
Returns:
success true if build_all_externals succeeds, false otherwise.

boolean dassmonarch::buildSomeExternals ( arrayref  hostsref,
boolean  force 
)

Perform a build_some_externals operation.

Parameters:
hostsref undefined, for all hosts; ref to an array of hostnames, for particular hosts
force true means force regeneration even if there is no significant change in content
Returns:
success true if build_some_externals succeeds, false otherwise.

boolean dassmonarch::clone_host ( string  src_host,
string  dest_host,
string  dest_alias,
string  dest_address 
)

Clone a host.

Parameters:
src_host Name of host to be cloned
dest_host Name of resulting host
dest_alias Alias of resulting host
dest_address Address of resulting host
Returns:
success true if successful, false otherwise

boolean dassmonarch::clone_service ( string  src_service,
string  dest_service 
)

Clone a service.

Parameters:
src_service Name of service to be cloned
dest_service Name of resulting service
Returns:
success true if successful, false otherwise

boolean dassmonarch::create_extended_host_info_template ( string  template_name,
string  notes,
string  notes_url,
string  action_url,
string  icon_image,
string  icon_image_alt,
string  statusmap_image,
string  vrml_image 
)

Create a extended host info template. Use empty strings, if an information should not be defined.

Parameters:
template_name Name for the new template
notes Additinal notes
notes_url URL for additional notes
action_url URL for action to display
icon_image Icon filename for this extended host template
icon_image_alt Alternative text for icon
statusmap_image Icon filename to be displayed on status map
vrml_image Icon filename for 3D vrml map
Returns:
success true if successful, false otherwise

int dassmonarch::create_external ( string  external_name,
string  description,
string  type,
string  content 
)

Create a new free external.

Parameters:
external_name Name of the external.
description Brief comment about the external.
type Type of the external ("host" or "service").
content Content of the external.
Returns:
int id > 0, if definition was successful; 0 otherwise

boolean dassmonarch::create_hostgroup ( string  hostgroupname,
string  alias 
)

Create a new hostgroup.

Parameters:
hostgroupname Name for the new hostgroup
alias Alias for the new hostgroup
Returns:
success true if successful, false otherwise

string dassmonarch::dassmonarch_version ( void   ) 

Returns the dassmonarch version found by the constructor.

Returns:
dassmonarchversion dassmonarch full version string

vstring dassmonarch::dassmonarch_vstring ( void   ) 

Returns the dassmonarch version Perl vstring manufactured by the constructor.

Returns:
dassmonarchvstring dassmonarch version Perl vstring

void dassmonarch::debug ( string  msglevel,
string  message 
)

Prints out a debug message to stderr, if it reaches current debuglevel.

Parameters:
msglevel One of error, warning, info, verbose
message The debug message, will be print out if msglevel is above general debuglevel

boolean dassmonarch::delete_external ( string  external_name  ) 

Delete a free external and all associated applied externals.

Parameters:
external_name Name of the external to delete.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::delete_host ( string  hostname  ) 

Deletes a host from monarch database, calls Monarch function, which deletes entry from database table hosts.

Parameters:
hostname Host to be deleted
Returns:
success true or false if the specified host does not exist or if a database operation has failed.

boolean dassmonarch::delete_host_ext_info_template ( string  templatename  ) 

Deletes a host_ext_info_template from the monarch database.

Parameters:
templatename to be deleted
Returns:
success true if successful, false otherwise

boolean dassmonarch::delete_host_ext_info_template_list ( string  templatename_starts  ) 

Deletes a all host_ext_info_templates starting with a given name from the monarch database.

Parameters:
templatename_starts to be deleted
Returns:
success true if successful, false otherwise

boolean dassmonarch::delete_hostgroup ( string  hostgroupname  ) 

Deletes a hostgroup from monarch database, calls Monarch function, which deletes entry from database table hostgroups.

Parameters:
hostgroupname Hostgroup to be deleted
Returns:
success true or false if the specified hostgroup does not exist or if a database operation has failed.

boolean dassmonarch::delete_hostgroup_members ( string  hostgroupname  ) 

Deletes all the members (hosts) from a hostgroup. Use of this routine is strongly recommended instead of deleting and re-creating the hostgroup itself if you just need to change its membership.

Parameters:
hostgroupname Hostgroup from which all member hosts are to be deleted
Returns:
success true or false if the specified hostgroup does not exist or if a database operation has failed.

boolean dassmonarch::delete_hosts ( string  searchstring  ) 

Delete a bunch of hosts.

Parameters:
searchstring All hosts starting with searchstring will be deleted
Returns:
success false if no hosts with searchstring are found or if one delete action fails

boolean dassmonarch::delete_service ( string  servicename  ) 

Deletes a service from the monarch database.

Parameters:
servicename Name of service to be deleted
Returns:
success true if successful, false otherwise

boolean dassmonarch::delete_services ( string  searchstring  ) 

Delete a bunch of services.

Parameters:
searchstring All services starting with searchstring will be deleted
Returns:
success false if no services with searchstring are found or if delete action fails

void dassmonarch::DESTROY ( void   ) 

Destructor, closes database connection to monarch. Will be called automatically by interpreter, when object goes out of scope or program ends.

boolean dassmonarch::disable_active_host_checks ( string  hostname  ) 

Disables active hostchecks for a particular host.

Parameters:
hostname Hostname to have hostchecks deactivated
Returns:
success true if successful, false otherwise

boolean dassmonarch::disable_active_service_check_on_hostgroup ( string  hostgroup,
string  servicename 
)

Disables active checks for a particular service check on all hosts of a given hostgroup.

Parameters:
hostgroup Hostgroup
servicename Servicename
Returns:
success true if successful, false if one of the operations fails. Will be also false if the service does not exist for one of the hosts in hostgroup.

boolean dassmonarch::disable_active_service_checks ( string  hostname,
string  servicename 
)

Disable Checks for a particular service on a dedicated host.

Parameters:
hostname Hostname
servicename Servicename
Returns:
success true if successful, false otherwise

boolean dassmonarch::disable_all_active_service_checks_on_host ( string  hostname  ) 

Disables all active service checks on a host.

Parameters:
hostname Hostname
Returns:
success true if operation successful for all services on host

boolean dassmonarch::disable_all_active_service_checks_on_hostgroup ( string  hostgroup  ) 

Disables active checks for all service check on all hosts of a given hostgroup.

Parameters:
hostgroup Hostgroup
Returns:
success true if successful, false if one of the operations fails. Will be also false if the service does not exist for one of the hosts in hostgroup.

boolean dassmonarch::disable_all_obsess_service_checks_on_host ( string  hostname  ) 

Disables obsessing for all service checks on a host.

Parameters:
hostname Hostname
Returns:
success true if successful, false otherwise

boolean dassmonarch::disable_all_obsess_service_checks_on_hostgroup ( string  hostgroup  ) 

Disables obsessing for all service checks on all hosts in a hostgroup.

Parameters:
hostgroup Hostgroup
Returns:
success true if successful, false otherwise

boolean dassmonarch::disable_obsess_host_checks ( string  hostname  ) 

Disables obsessing of host checks for a particular host.

Parameters:
hostname The host for which obsessing should be deactivated
Returns:
success true if successful, false otherwise

boolean dassmonarch::disable_obsess_service_check_on_hostgroup ( string  hostgroup,
string  servicename 
)

Disables obsessing for a particular service check on all hosts of a given hostgroup.

Parameters:
hostgroup Hostgroup
servicename Servicename
Returns:
success true if successful, false if one of the operations fails. Will be also false if the service does not exist for one of the hosts in hostgroup.

boolean dassmonarch::disable_obsess_service_checks ( string  hostname,
string  servicename 
)

Disables obsessing for a particular service check.

Parameters:
hostname Hostname
servicename Service, which should be not obsessed
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_active_host_checks ( string  hostname  ) 

Activates host checks.

Parameters:
hostname Host to activate hostchecks for
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_active_service_check_on_hostgroup ( string  hostgroup,
string  servicename 
)

Enables active checks for a particular service check on all hosts of a given hostgroup.

Parameters:
hostgroup Hostgroup
servicename Servicename
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_active_service_checks ( string  hostname,
string  servicename 
)

Activates checks for a dedicated service on a particular host.

Parameters:
hostname Hostname
servicename Servicename
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_all_active_service_checks_on_host ( string  hostname  ) 

Enables all active service checks on a given host.

Parameters:
hostname Hostname
Returns:
success true if all operations are successful, false otherwise

boolean dassmonarch::enable_all_active_service_checks_on_hostgroup ( string  hostgroup  ) 

Enables active checks for all service check on all hosts of a given hostgroup.

Parameters:
hostgroup Hostgroup
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_all_obsess_service_checks_on_host ( string  hostname  ) 

Enables obsessing for all service checks on a host.

Parameters:
hostname Hostname
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_all_obsess_service_checks_on_hostgroup ( string  hostgroup  ) 

Enables obsessing for all service checks on all hosts in a hostgroup.

Parameters:
hostgroup Hostgroup
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_obsess_host_checks ( string  hostname  ) 

Enables obsessing of host checks for a particular host.

Parameters:
hostname The host for which obsessing should be activated
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_obsess_service_check_on_hostgroup ( string  hostgroup,
string  servicename 
)

Enables obsessing for a particular service check on all hosts of a given hostgroup.

Parameters:
hostgroup Hostgroup
servicename Servicename
Returns:
success true if successful, false otherwise

boolean dassmonarch::enable_obsess_service_checks ( string  hostname,
string  servicename 
)

Enables obsessing for a particular service check.

Parameters:
hostname Hostname
servicename Service, which should be obsessed
Returns:
success true if successful, false otherwise

boolean dassmonarch::generateAndCommit ( void   ) 

Perform a pre-flight check and do a commit.

Returns:
success true if commit succeeds, false otherwise.

array dassmonarch::get_all_service_dependencies ( void   ) 

Get all service dependencies as a hash.

Returns:
service_depencies An array of quadruples. Each quadruple consists of hostname, servicename, depending host, depending service

int dassmonarch::get_debuglevel ( void   ) 

Returns debuglevel as integer.

Returns:
debuglevel

string dassmonarch::get_debugmessages ( void   ) 

Returns all debugmessages generated since instantiation.

Returns:
debugmsg containing all debugmessages

string dassmonarch::get_errormessages ( void   ) 

Returns all errormessages generated since instantiation.

Returns:
errormsg containing all errormessages

int dassmonarch::get_escalation_tree_id ( string  escalationname,
string  type 
)

Get the MySQL ID of a given escalation_tree name.

Parameters:
escalationname The escalation's name to query
type Escalation type to query, one of 'host' or 'service'
Returns:
escalation_id Escalation's ID, false if not existent

int dassmonarch::get_extended_host_information_template_id ( param  extended_host_information_template  ) 

Get the MySQL ID of a given host extended information template.

Parameters:
extended_host_information_template The host extended template name to query
Returns:
escalation_id Escalation's ID, false if not existent

hashref dassmonarch::get_external ( string  external_name  ) 

Find details of a free external, given an external name.

Parameters:
external_name Name of external to search for.
Returns:
hashref pointing to details if external exists; false otherwise (reference to empty hash if external does not exist, undefined if search failed)

int dassmonarch::get_externalid ( string  external_name  ) 

Find external ID, given an external name.

Parameters:
external_name Name of external to search for.
Returns:
int id > 0 if external exists; false otherwise (0 if external does not exist, undefined if search failed)

string dassmonarch::get_externalname ( int  external_id  ) 

Find external name, given an external ID.

Parameters:
external_id ID of external to search for.
Returns:
string name of external if external exists; otherwise, undefined

string dassmonarch::get_genericservicename ( int  servicename_id  ) 

Get service name for a given generic service name ID.

Parameters:
servicename_id ID to search for.
Returns:
service_name The found servicename; otherwise, undefined (false).

hashref dassmonarch::get_host_external ( string  host_name,
string  external_name 
)

Find details of an applied host external.

Parameters:
host_name Name of host to which the external was applied.
external_name Name of external to search for.
Returns:
hashref pointing to details, if external exists; reference to empty hash, if the applied host external does not exist; undefined, if search failed

array dassmonarch::get_host_parent ( string  hostname  ) 

Get parents for a certain host.

Parameters:
hostname Hostname which parents to deliver
Returns:
parent_names false otherwise

int dassmonarch::get_host_serviceid ( string  hostname,
string  servicename 
)

Get the MySQL ID of a host / service entry in table services.

Parameters:
hostname hostname to query
servicename servicename to query
Returns:
int service_id from table services, > 0 if the host service exists; otherwise, 0 if the search succeeded, undef if the search failed (e.g., due to database error)

int dassmonarch::get_hostgroupid ( string  hostgroupname  ) 

Searches for a hostID in monarch tables hosts.

Parameters:
hostgroupname of to query for
Returns:
id the id > 0 if existent, false (0) otherwise

array dassmonarch::get_hostgroups_for_host ( string  hostname  ) 

Retrieves a list of all hostgroups containing a given host.

Parameters:
hostname name of host for which hostgroup membership is desired
Returns:
hostgroups list of hostgroups containing this host

int dassmonarch::get_hostid ( string  hostname  ) 

Searches for a hostID in monarch tables hosts.

Parameters:
hostname of to query for
Returns:
int id > 0 if the host exists; otherwise, 0 if the search succeeded, undef if the search failed (e.g., due to database error)

array dassmonarch::get_hostlist ( void   ) 

Returns a list of all hostnames.

Returns:
hostnames Array of hostnames, false otherwise

string dassmonarch::get_hostname ( int  host_id  ) 

Gets Hostname for a given ID.

Parameters:
host_id ID to search for
Returns:
hostname The found hostname; otherwise, undefined (either host not found, or database error)

int dassmonarch::get_hostprofileid ( string  hostprofilename  ) 

Searches for a hostprofileID in monarch tables profiles_host.

Parameters:
hostprofilename of to query for
Returns:
int id > 0 if the host profile exists; otherwise, 0 if the search succeeded, undef if the search failed (e.g., due to database error)

string dassmonarch::get_hostprofilename ( int  hostprofile_id  ) 

Find hostprofile name for a given hostprofile ID.

Parameters:
hostprofile_id ID of host profile to search for.
Returns:
string name of hostprofile if hostprofile exists; otherwise, undefined

array dassmonarch::get_hosts_in_hostgroup ( string  hostgroup  ) 

Retrieves a list of all hostnames in a given hostgroup.

Parameters:
hostgroup name of the hostgroup to query for
Returns:
hostnames false if group does not exist or has no host members

arrayref dassmonarch::get_hosts_with_address ( string  address  ) 

Gets the names of hosts that have a given IP address.

Parameters:
address IP address to search for
Returns:
hostnames arrayref pointing to a list of matching hostnames

hashref dassmonarch::get_hostservice_external ( string  host_name,
string  service_name,
string  external_name 
)

Find details of an applied service external.

Parameters:
host_name Name of host on which the service resides.
service_name Name of service to which the external was applied.
external_name Name of external to search for.
Returns:
hashref pointing to details, if external exists; reference to empty hash, if the applied service external does not exist; undefined, if search failed

array dassmonarch::get_hostservice_list ( string  hostname  ) 

Retrieves a list of all services on a host.

Parameters:
hostname hostname to get the services from
Returns:
servicenames as text, false otherwise

arrayref dassmonarch::get_monarch_group_hostgroups ( string  monarch_group  ) 

Tell which hostgroups are assigned to a monarch group.

Parameters:
monarch_group Monarch group name
Returns:
success arrayref (names of assigned hostgroups) if get_monarch_group_hostgroups succeeds, undef otherwise.

arrayref dassmonarch::get_monarch_group_hosts ( string  monarch_group  ) 

Tell which hosts are directly assigned to a monarch group.

Parameters:
monarch_group Monarch group name
Returns:
success arrayref (names of assigned hosts) if get_monarch_group_hosts succeeds, undef otherwise.

hashref dassmonarch::get_monarch_group_orphans ( void   ) 

Find all hosts not assigned directly or indirectly to any monarch group.

Returns:
success hashref with keys being the names of hosts not belonging to any monarch group, and values being true

arrayref dassmonarch::get_monarch_group_subgroups ( string  monarch_group  ) 

Tell which subgroups are assigned to a monarch group.

Parameters:
monarch_group Monarch group name
Returns:
success arrayref (names of assigned subgroups) if get_monarch_group_subgroups succeeds, undef otherwise.

string dassmonarch::get_monarchgroup_location ( string  monarch_group  ) 

Get the buildpath for a monarchgroup.

Parameters:
monarch_group name of the Monarch group to get the path for
Returns:
location The path where the config files should be built, false, if not set

int dassmonarch::get_serviceid ( string  servicename  ) 

Searches for a serviceID in monarch tables service_names.

Parameters:
servicename of to query for
Returns:
int id > 0 if the service exists; otherwise, 0 if the search succeeded, undef if the search failed (e.g., due to database error)

string dassmonarch::get_servicename ( int  service_id  ) 

Gets Service name for a given hostservice ID.

Parameters:
service_id ID to search for
Returns:
servicename The found service name; otherwise, undefined

int dassmonarch::get_serviceprofileid ( string  serviceprofilename  ) 

Searches for a serviceprofile_id in the monarch profiles_service table.

Parameters:
serviceprofilename Name of the service profile to look for.
Returns:
id the id > 0 if existent, false (0) otherwise

string dassmonarch::get_serviceprofilename ( int  serviceprofile_id  ) 

Find serviceprofile name for a given serviceprofile ID.

Parameters:
serviceprofile_id ID of service profile to search for.
Returns:
string profile name, false (0) otherwise

boolean dassmonarch::host_exists ( string  hostname  ) 

Queries, if a hostname exists.

Parameters:
hostname hostname to query
Returns:
success true if hosts exists, false (nothing) otherwise

boolean dassmonarch::host_extinfo_template_exists ( string  templatename  ) 

Returns true if a given host extended info template already exists.

Parameters:
templatename Name to query
Returns:
success true if templates exists, false otherwise

boolean dassmonarch::hostgroup_exists ( string  hostgroupname  ) 

Queries, if a hostgroup exists.

Parameters:
hostgroupname hostname to query
Returns:
success true if hostgroup exists, false (nothing) otherwise

boolean dassmonarch::import_host ( string  hostname,
string  alias,
string  address,
string  profile_name,
boolean  update 
)

Import or update a host and apply profiles. This routine performs only a shallow application of the host profile; likely, you want import_host_api() instead. If updates are disabled and you try to import an already-existing host, nothing will be changed and an error is returned. If update is allowed, all settings of an existing host will be overwritten by this import. If the host does not exist yet, it will be created with these settings, regardless of the update flag.

Parameters:
hostname Hostname to be imported
alias Host's alias
address Host's IP Address
profile_name Name of hostprofile to assign
update (optional) Set to 1 (true), if updates are allowed
Returns:
success true if successful, false otherwise

boolean dassmonarch::import_host_api ( string  hostname,
string  alias,
string  address,
string  profile_name,
boolean  update 
)

Import or update a host and apply profiles using the MonarchAPI version of import_host. This routine performs a deep application of the host profile. If updates are disabled and you try to import an already-existing host, nothing will be changed and an error is returned. If update is allowed, all settings of an existing host will be overwritten by this import. If the host does not exist yet, it will be created with these settings, regardless of the update flag.

Parameters:
hostname Hostname to be imported
alias Host's alias
address Host's IP Address
profile_name Name of hostprofile to assign
update (optional) Set to 1 (true), if updates are allowed
Returns:
success true if successful, false otherwise

arrayref dassmonarch::list_externals ( string  type  ) 

List all free externals of a given type (host or service).

Parameters:
type Type of external to search for.
Returns:
arrayref external_names pointing to list of names, if search was successful; undefined, if search failed

arrayref dassmonarch::list_host_externals ( string  host_name  ) 

List all externals assigned to a specified host.

Parameters:
host_name Host name.
Returns:
arrayref external_names pointing to list of names, if search was successful; undefined, if search failed

arrayref dassmonarch::list_hostprofile_externals ( string  hostprofile_name  ) 

List all externals assigned to a specified host profile.

Parameters:
hostprofile_name Host profile name.
Returns:
arrayref external_names pointing to list of names, if search was successful; undefined, if search failed

arrayref dassmonarch::list_hostprofiles_with_external ( string  external_name  ) 

List all host profiles with a specified external assigned.

Parameters:
external_name Name of external to search for.
Returns:
arrayref hostprofile_names pointing to list of names, if search was successful; undefined, if search failed

arrayref dassmonarch::list_hosts_with_external ( string  external_name  ) 

List all hosts with a specified external assigned.

Parameters:
external_name Name of host external to search for.
Returns:
arrayref host_names pointing to list of names, if search was successful; undefined, if search failed

arrayref dassmonarch::list_hostservice_externals ( string  host_name,
string  service_name 
)

List all externals assigned to a specified host service.

Parameters:
host_name Host name.
service_name Service name.
Returns:
arrayref external_names pointing to list of names, if search was successful; undefined, if search failed

arrayref dassmonarch::list_hostservices_with_external ( string  external_name  ) 

List all host services with a specified external assigned.

Parameters:
external_name Name of external to search for.
Returns:
hashref hostservices pointing to hash of arrayrefs (host name keys with service name arrayref values), if search was successful; undefined, if search failed

arrayref dassmonarch::list_service_externals ( string  service_name  ) 

List all externals assigned to a specified generic service.

Parameters:
service_name Service name.
Returns:
arrayref external_names pointing to list of names, if search was successful; undefined, if search failed

arrayref dassmonarch::list_services_with_external ( string  external_name  ) 

List all generic services with a specified external assigned.

Parameters:
external_name Name of external to search for.
Returns:
arrayref service_names pointing to list of names, if search was successful; undefined, if search failed

boolean dassmonarch::modify_external ( string  external_name,
string  description,
string  content 
)

Modify a free external.

Parameters:
external_name Name of the external to modify.
description Replacement comment for the external. Undefined means leave this field as-is.
content Replacement content of the external. Undefined means leave this field as-is.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::modify_host_external ( string  host_name,
string  external_name,
string  content,
boolean  modified 
)

Modify a host external on a host. Overwrites existing external content and metadata.

Parameters:
host_name Name of host on which the external is to be modified.
external_name Name of the host external to be modified.
content Replacement content of the external. Undefined means leave this field as-is.
modified True, if the updated external is to be marked as a custom copy. False, if the updated external is to be marked as an unmodified copy. Undefined means leave this field as-is.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::modify_hostservice_external ( string  host_name,
string  service_name,
string  external_name,
string  content,
boolean  modified 
)

Modify a service external on a host service. Overwrites existing external content and metadata.

Parameters:
host_name Name of host on which the service resides.
service_name Name of the host service on which the external is to be modified.
external_name Name of the host external to be modified.
content Replacement content of the external. Undefined means leave this field as-is.
modified True, if the updated external is to be marked as a custom copy. False, if the updated external is to be marked as an unmodified copy. Undefined means leave this field as-is.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::monarch_group_exists ( string  monarch_group  ) 

Parameters:
monarch_group Monarch groupname to query
Returns:
success true if monarch_group exists, false otherwise

string dassmonarch::monarch_version ( void   ) 

Returns the Monarch version found by the constructor.

Returns:
monarchversion Monarch full version string

vstring dassmonarch::monarch_vstring ( void   ) 

Returns the Monarch version Perl vstring manufactured by the constructor.

Returns:
monarchvstring Monarch version Perl vstring

string dassmonarch::nagios_version ( void   ) 

Returns the nagios version used in constructor.

Returns:
nagiosversion nagios major version

object dassmonarch::new ( void   ) 

Returns:
the new object, or dies trying (meaning, you'd better encapsulate your call inside eval{};)

boolean dassmonarch::pre_flight_check ( string  monarchgroup  ) 

Perform a pre-flight check.

Parameters:
monarchgroup optional, monarch group to build
Returns:
success true if pre_flight succeeds, false otherwise.

boolean dassmonarch::propagate_external ( string  external_name,
boolean  replace 
)

Propagate a free external to associated applied externals.

Parameters:
external_name Name of the external to propagate.
replace Whether to update (true) or ignore (false) applied externals with their "modified" flag set.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::remove_external_from_host ( string  host_name,
string  external_name 
)

Removes a host external from a host.

Parameters:
host_name Host name.
external_name Name of the host external.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::remove_external_from_hostprofile ( string  hostprofile_name,
string  external_name 
)

Removes a host external from a host profile.

Parameters:
hostprofile_name Host profile name.
external_name Name of the host external.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::remove_external_from_hostservice ( string  host_name,
string  service_name,
string  external_name 
)

Removes a service external from a host service.

Parameters:
host_name Host name.
service_name Name of the host service from which the external is to be removed.
external_name Name of the service external.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::remove_external_from_service ( string  service_name,
string  external_name 
)

Removes a service external from a generic service.

Parameters:
service_name Service name.
external_name Name of the service external.
Returns:
boolean outcome; true if successful, false otherwise

boolean dassmonarch::remove_monarch_group_hostgroups ( string  monarch_group,
arrayref  hostgroups 
)

Remove specified hostgroups from a monarch group.

Parameters:
monarch_group Monarch group name
hostgroups reference to an array of hostgroup names, or undef to remove all individual hostgroups
Returns:
success true if remove_monarch_group_hostgroups completely succeeds, false otherwise.

boolean dassmonarch::remove_monarch_group_hosts ( string  monarch_group,
arrayref  hosts 
)

Remove specified hosts from a monarch group.

Parameters:
monarch_group Monarch group name
hosts reference to an array of hostnames, or undef to remove all individual hosts
Returns:
success true if remove_monarch_group_hosts completely succeeds, false otherwise.

boolean dassmonarch::remove_monarch_group_subgroups ( string  monarch_group,
arrayref  subgroups 
)

Remove specified subgroups from a monarch group.

Parameters:
monarch_group Monarch group name
subgroups reference to an array of subgroup names, or undef to remove all individual subgroups
Returns:
success true if remove_monarch_group_subgroups completely succeeds, false otherwise.

boolean dassmonarch::remove_service ( string  hostname,
string  servicename 
)

Remove a service from a host.

Parameters:
hostname Host name.
servicename Name of the service to remove from the host.
Returns:
success true if successful, false otherwise

boolean dassmonarch::remove_serviceprofile_from_host ( string  hostname,
string  serviceprofilename 
)

Removes a directly-assigned service profile from a host. Will not affect services previously applied using that service profile.

Parameters:
hostname Hostname
serviceprofilename Name of the service profile to remove from the host.
Returns:
success true if successful, false otherwise

boolean dassmonarch::rename_external ( string  old_external_name,
string  new_external_name 
)

Rename a free external.

Parameters:
old_external_name Old name of the external.
new_external_name New name of the external.
Returns:
boolean outcome; true if successful, false otherwise

hashref dassmonarch::search_service_by_prefix ( string  prefix  ) 

search service by prefix, because with GroundWork > 5.2 substrings match instead of prefixes and a limit has been appended to the mysql search statement

Parameters:
prefix All services starting with searchstring will be returned
Returns:
services a hash of matching service names

boolean dassmonarch::service_exists ( string  servicename  ) 

Queries, if a servicename exists.

Parameters:
servicename servicename to query
Returns:
success true if service exists

boolean dassmonarch::service_extinfo_template_exists ( string  templatename  ) 

Returns true if a given service extended info template already exists.

Parameters:
templatename Name to query
Returns:
success true if templates exists, false otherwise

boolean dassmonarch::set_debuglevel ( string  newlevel  ) 

Sets a new debuglevel.

Parameters:
newlevel The new debuglevel, one of error, warning, info, verbose
Returns:
success

boolean dassmonarch::set_host_overrides_properties ( string  hostname,
hashref  propref 
)

Overrides host properties for a particular host.

Parameters:
hostname Hostname
propref contains key-value pairs of properties to override against inherited host template settings.
Returns:
success true if setting works, false otherwise

boolean dassmonarch::set_parents ( string  hostname,
arrayref  parents 
)

Set parents of a host.

Parameters:
hostname Hostname, whose parents should be set
parents reference to a array of parentnames
Returns:
success true if all parents could be assigned, false otherwise.

boolean dassmonarch::set_service_overrides_properties ( string  hostname,
string  servicename,
hashref  propref 
)

Overrides service properties for a particular service definition on a particular host.

Parameters:
hostname Hostname
servicename Servicename
propref contains key-value pairs of properties to override against inherited service template settings.
Returns:
success true if successful, false otherwise

boolean dassmonarch::update_or_insert_obj ( string  table,
string  searchcolumn,
string  searchvalue,
hashref  valref 
)

Updates a database object or creates it, if not existant, yet. This method shouldn't be used directly.

Parameters:
table Table to operate on
searchcolumn Column to use for searching
searchvalue Value to search for in searchcolumn
valref hashreference for key value pairs.
Returns:
success true if successful, false otherwise


The documentation for this class was generated from the following file:
Generated on Fri Oct 5 16:07:54 2012 for dassmonarch by  doxygen 1.4.7