Suppervision : Différence entre versions

De Wiki-noulot
Sauter à la navigation Sauter à la recherche
(Page créée avec « =Sonde Nagios= ==Check_Http== What is check_http? check_http plugin is used to verify the status of HTTP server (or HTTPS) that is running on a remote host. If you’ve... »)
 
Ligne 115 : Ligne 115 :
  
 
-t –timeout Number of seconds to wait before connection times out. Default is 10 seconds
 
-t –timeout Number of seconds to wait before connection times out. Default is 10 seconds
 +
 +
 +
==Host Management== Object name
 +
The object name used to modify hosts is : HOST.
 +
List all hosts
 +
In order to list available hosts, just use "show" :
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show82;sri-dev1;dev1;192.168.2.183;sri-dev2;dev2;192.168.2.284;sri-dev3;dev3;192.168.2.385;sri-dev4;dev4;192.168.2.486;sri-dev5;dev5;192.168.2.587;sri-dev6;dev6;192.168.2.694;sri-dev7;dev7;192.168.2.795;sri-dev8;dev8;192.168.2.8Columns are the following : IDNameAliasIP/Address Your can also add a pattern in order to search a specific list of hosts:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v 794;sri-dev7;dev7;192.168.2.7 Add a host In order to add a host, just use "ADD" and pass argument "name;alias":
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a ADD -v "test;Test host;127.0.0.1;generic-host;central;Linux" Columns are the following : NameAliasIP/AddressHost templatePollerHostgroup Host template and hostgroup can be multiple. You can separate hostgroups and template by the delimiter "|".
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a ADD -v "test;Test host;127.0.0.1;generic-host;central;Linux|Production|Asia" It seems that everything is ok. We have to check this:
 +
[root@centreon ~]# echo $?0 OR
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Test host;127.0.0.1
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Remove a host In order to delete one host, just use "DEL". You have to list the available hosts in order to identify the one you want to delete:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Test host;127.0.0.1[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a DEL -v "test" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Set parameters of a host In order to change parameters on a host configuration, use the 'setparam' action.
 +
Example :
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Test host;127.0.0.1[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparam -v "test;alias;Development test " [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Development test;127.0.0.1[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparam -v "test;address;192.168.1.68" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Development test;192.168.1.68[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparam -v "test;check_period;24x7" You may edit the following parameters: Parameter                      Description                                                          2d_coords                        2D coordinates (used by statusmap)                                    3d_coords                        3D coordinates (used by statusmap)                                    action_url                      Action URL                                                            activate                        Whether or not host is enabled                                        active_checks_enabled            Whether or not active checks are enabled                              address                          Host IP Address                                                        alias                            Alias                                                                  check_command                    Check command                                                          check_command_arguments          Check command arguments                                                check_interval                  Normal check interval                                                  check_freshness                  Check freshness (in seconds)                                          check_period                    Check period                                                          checks_enabled                  Whether or not checks are enabled                                      event_handler                    Event handler command                                                  event_handler_arguments          Event handler command arguments                                        event_handler_enabled            Whether or not event handler is enabled                                first_notification_delay        First notification delay (in seconds)                                  flap_detection_enabled          Whether or not flap detection is enabled                              flap_detection_options          Flap detection options                                                icon_image                      Icon image                                                            icon_image_alt                  Icon image text                                                        name                            Host name                                                              notes                            Notes                                                                  notes_url                        Notes URL                                                              notifications_enabled            Whether or not notification is enabled                                notification_interval            Notification interval                                                  notification_options            Notification options                                                  notification_period              Notification period                                                    obsess_over_host                Whether or not obsess over host option is enabled                      passive_checks_enabled          Whether or not passive checks are enabled                              process_perf_data                Process performance data command                                      retain_status_information        Whether or not there is status retention                              retain_nonstatus_information    Whether or not there is non-status retention                          stalking_options                Comma separated options: 'o' for OK, 'd' for Down, 'u' for Unreachable retry_check_interval            Retry check interval                                                  statusmap_image                  Status map image (used by statusmap)                                  vrml_image                      VRML image                                                           
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Set instance (poller) In order to set the instance from which a host will be monitored use the 'setinstance' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setinstance -v "Centreon-Server;Poller 1" View macro list of a host In order to view the custom macro list of a host, use the 'getmacro' action.
 +
Example :
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getmacro -v "Centreon-Server" macro name;macro value$_HOSTMACADDRESS$;00:08:C7:1B:8C:02 Set a macro for a host In order to set a custom host macro, use the 'setmacro' action. If the macro exists, this action will only update information. If this macro is not already created, this action will add this macro.
 +
Example :
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setmacro -v "Centreon-Server;warning;80" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setmacro -v "Centreon-Server;critical;90" Delete a host macro In order to delete a macro host, use the 'delmacro' action.
 +
Example :
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delmacro -v "Centreon-Server;warning" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delmacro -v "Centreon-Server;critical" View template list of a host In order to view the template list of a host, use the 'gettemplate' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a gettemplate -v "Centreon-Server" id;name2;generic-host12;Linux-Servers Add a template to a host In order to add a host template to an existing host, use the 'addtemplate' or the 'settemplate' action, where 'add' will append and 'set' will overwrite.
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addtemplate -v "Centreon-Server;srv-Linux" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a settemplate -v "Centreon-Server;hardware-Dell"
 +
Note: all service templates linked to the new host template will be automatically deployed on the existing host. (no longer the case with version later than 1.3.0, use the 'applytpl' action manually)
 +
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Remove templates from a host In order to remove a host template to an existing host, use 'deltemplate' action.
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a deltemplate -v "test;srv-Linux|hardware-Dell"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Apply template changes on Hosts When a template host undergoes modified link-level service template, the change is not automatically reflected in hosts belonging to that template. For the change to take effect, it must then re-apply the template on this host. For this CLAP integrates control "APPLTPL".
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a applytpl -v "test" All new sercives are now created.
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
View parents of a host In order to view the parents of a host, use the 'getparent' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getparent -v "Centreon-Server" id;name43;server-parent144;server-parent2 Set a parent for Hosts In order to add a host parent to an host, use the 'addparent' or 'setparent' action where 'add' will append and 'set' will overwrite the parent definitions.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addparent -v "host;hostParent1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparent -v "host;hostParent1|hostParent2" You can also use a list of host (host name separated by '|').
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparent -v "host;hostParent1|hostParent2|hostParent3" Tips: setchild action doesn't exists. In order to set child, think to invert hosts.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparent -v "hostParent;host"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Remove parent relation from a host In order to remove a parent, use the 'delparent' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delparent -v "Centreon-Server;server-parent1|server-parent2" View notification contact groups of a host In order to view the notification contact groups of a host, use the 'getcontactgroup' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getcontactgroup -v "Centreon-Server" id;name17;Administrators Add notification contactgroups to a host If you want to add notification contactgroups to a host, use the 'addcontactgroup' or 'setcontactgroup' action where 'add' will append and 'set' will overwrite definitions.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addcontactgroup -v "Centreon-Server;Contactgroup1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setcontactgroup -v "Centreon-Server;Contactgroup1|Contactgroup2"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Remove notification contactgroups from a host If you want to remove notification contactgroups from a host, use the 'delcontactgroup' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delcontactgroup -v "Centreon-Server;Contactgroup2"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
View notification contacts of a host In order to view the notification contacts of a host, use the 'getcontact' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getcontact -v "Centreon-Server" id;name11;guest Add notification contacts to a host If you want to add notification contacts to a host, use the 'addcontact' or 'setcontact' action where 'add' will append and 'set' will overwrite definitions.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addcontact -v "Centreon-Server;Contact1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setcontact -v "Centreon-Server;Contact1|Contact2"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Remove notification contact from a host If you want to remove a notification contacts from a host, use the 'delcontact' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delcontact -v "Centreon-Server;Contact2"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
View hostgroups that are tied to a host In order to view the hostgroups that are tied to a host, use the 'gethostgroup' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a gethostgroup -v "Centreon-Server" id;name9;Linux-Servers Tie hostgroups to a host If you want to tie hostgroups to a host, use the 'addhostgroup' or 'sethostgroup' action where 'add' will append and 'set' will overwrite definitions.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addhostgroup -v "Centreon-Server;Hostgroup1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a sethostgroup -v "Centreon-Server;Hostgroup1|Hostgroup2"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Untie hostgroups from a host If you want to remove hostgroups from a host, use the 'delhostgroup' action.
 +
Example:
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delhostgroup -v "Centreon-Server;Hostgroup2"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Enable a host In order to enable an host, you can use "enable" action.
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a enable -v "test"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.
 +
Disable a host In order to disable a host, you can use "disable" action.
 +
[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a disable -v "test"
 +
You need to generate your configuration file and restart monitoring engine in order to apply changes.

Version du 21 février 2014 à 12:08

Sonde Nagios

Check_Http

What is check_http?

check_http plugin is used to verify the status of HTTP server (or HTTPS) that is running on a remote host. If you’ve installed Nagios from source, check_httpd command will be located in the /usr/local/nagios/libexec directory.


check_http Command Examples

1. Check HTTP

Check whether Apache HTTP is running on a remote server using check_http.

$ check_http -H 192.168.1.50
HTTP OK HTTP/1.1 200 OK - 332 bytes in 0.004 seconds |time=0.004144s;;;0.000000 size=332B;;;0


2. Check HTTPS

Check whether Apache HTTPS is running on a remote server using check_http.

$ check_http -H 192.168.1.50 -S
HTTP OK HTTP/1.1 200 OK - 332 bytes in 0.004 seconds |time=0.004144s;;;0.000000 size=332B;;;0
If the remote server runs only HTTP and not HTTPS, you’ll get “HTTP CRITICAL – Unable to open TCP socket” message as shown below.
$ check_http -H 192.168.1.50 -S
Connection refused
HTTP CRITICAL - Unable to open TCP socket

3. Check HTTP (or HTTPS) on different port

You can check tomcat server, or apache server, or glassfish, or any server that is running on a different port by speficying the port number as shown below.

$ check_http -H 192.168.1.50 -p 8080
HTTP OK HTTP/1.1 200 OK - 332 bytes in 0.004 seconds |time=0.004144s;;;0.000000 size=332B;;;0
For HTTPS running on a different port, do the following.
$ check_http -H 192.168.1.50 -S -p 8443
HTTP OK HTTP/1.1 200 OK - 332 bytes in 0.004 seconds |time=0.004144s;;;0.000000 size=332B;;;0

4. Check Specific URL

To check whether a specific webpage is available, use the -u option as shown below.

$ check_http -H 101hacks.com -u http://linux.101hacks.com/toc

5. Check SSL Certificate Expiry

You can check whether a SSL certificate of the website expires within the next X number of days as shown below. In the following example, we are checking whether the website certificate expires in the next 365 days. The output indicates that it expires in 300 days.

$ check_http -H 101hacks.com -C 365 
WARNING - Certificate expires in 300 day(s) (01/01/2011 10:10).

Syntax and Options

check_http -H hostname (or) -I ip-address {optional options}

Short Option Long Option Option Description

-H –hostname host name of the server where HTTP (or HTTPS) daemon is running

-I –IP-address ip address of the HTTP (or HTTPS) server

-p –port Port number where HTTP server runs. Default is 80

-4 –use-ipv4 This will use IPv4 connection

-6 –use-ipv6 This will use IPv6 connection

-S –ssl This will use HTTPS using default 443 port

-C –certificate Minimum number of days a SSL certiface must be valid.

-e –expect Expected response string. Default is HTTP/1

-s –string Expected content string.

-u –url URL to check

-P –post URL encoded http POST data

-N –no-body Do not wait for whole document body to download. Stop once the headers are downloaded.

-M –max-age Check whether a document is older than x seconds. Use 5 for 5 seconds, 5m for 5 minutes, 5h for 5 hours, 5d for 5 days.

-T –content-type Indicate content type in header for POST request

-l –linespan Regular expression can span to new line (Use this with -r or -R option)

-r –regex, –ereg Use this regular expression to search for string in the HTTP page

-R –eregi Same as above, but with ignore case.

-a –authorization If the site user basic authentication send uid, pwd in the format uid:pwd

-A –useragent Pass the specified string as “User Agent” in HTTP header.

-k –header Add additional tags that should be sent in the HTTP header.

-L –link The output is wrapped as HTML link

-f –onredirect When a URL is redirected, use this to either follow the URL, or send ok, warning, or critical notification

-m –pagesize Specify the minimum and maximum page size expected in bytes. Format is minimum:maximum

-w –warning Response time in seconds for warning state

-m –pagesize Specify the minimum and maximum page size expected in bytes. Format is minimum:maximum

-w –warning Response time in seconds for warning state

-c –critical Response time in seconds for critical state

-t –timeout Number of seconds to wait before connection times out. Default is 10 seconds


==Host Management== Object name The object name used to modify hosts is : HOST. List all hosts In order to list available hosts, just use "show" : [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show82;sri-dev1;dev1;192.168.2.183;sri-dev2;dev2;192.168.2.284;sri-dev3;dev3;192.168.2.385;sri-dev4;dev4;192.168.2.486;sri-dev5;dev5;192.168.2.587;sri-dev6;dev6;192.168.2.694;sri-dev7;dev7;192.168.2.795;sri-dev8;dev8;192.168.2.8Columns are the following : IDNameAliasIP/Address Your can also add a pattern in order to search a specific list of hosts: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v 794;sri-dev7;dev7;192.168.2.7 Add a host In order to add a host, just use "ADD" and pass argument "name;alias": [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a ADD -v "test;Test host;127.0.0.1;generic-host;central;Linux" Columns are the following : NameAliasIP/AddressHost templatePollerHostgroup Host template and hostgroup can be multiple. You can separate hostgroups and template by the delimiter "|". [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a ADD -v "test;Test host;127.0.0.1;generic-host;central;Linux|Production|Asia" It seems that everything is ok. We have to check this: [root@centreon ~]# echo $?0 OR [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Test host;127.0.0.1 You need to generate your configuration file and restart monitoring engine in order to apply changes. Remove a host In order to delete one host, just use "DEL". You have to list the available hosts in order to identify the one you want to delete: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Test host;127.0.0.1[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a DEL -v "test" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" You need to generate your configuration file and restart monitoring engine in order to apply changes. Set parameters of a host In order to change parameters on a host configuration, use the 'setparam' action. Example : [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Test host;127.0.0.1[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparam -v "test;alias;Development test " [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Development test;127.0.0.1[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparam -v "test;address;192.168.1.68" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a show -v "test" 297;test;Development test;192.168.1.68[root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparam -v "test;check_period;24x7" You may edit the following parameters: Parameter Description 2d_coords 2D coordinates (used by statusmap) 3d_coords 3D coordinates (used by statusmap) action_url Action URL activate Whether or not host is enabled active_checks_enabled Whether or not active checks are enabled address Host IP Address alias Alias check_command Check command check_command_arguments Check command arguments check_interval Normal check interval check_freshness Check freshness (in seconds) check_period Check period checks_enabled Whether or not checks are enabled event_handler Event handler command event_handler_arguments Event handler command arguments event_handler_enabled Whether or not event handler is enabled first_notification_delay First notification delay (in seconds) flap_detection_enabled Whether or not flap detection is enabled flap_detection_options Flap detection options icon_image Icon image icon_image_alt Icon image text name Host name notes Notes notes_url Notes URL notifications_enabled Whether or not notification is enabled notification_interval Notification interval notification_options Notification options notification_period Notification period obsess_over_host Whether or not obsess over host option is enabled passive_checks_enabled Whether or not passive checks are enabled process_perf_data Process performance data command retain_status_information Whether or not there is status retention retain_nonstatus_information Whether or not there is non-status retention stalking_options Comma separated options: 'o' for OK, 'd' for Down, 'u' for Unreachable retry_check_interval Retry check interval statusmap_image Status map image (used by statusmap) vrml_image VRML image You need to generate your configuration file and restart monitoring engine in order to apply changes. Set instance (poller) In order to set the instance from which a host will be monitored use the 'setinstance' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setinstance -v "Centreon-Server;Poller 1" View macro list of a host In order to view the custom macro list of a host, use the 'getmacro' action. Example : [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getmacro -v "Centreon-Server" macro name;macro value$_HOSTMACADDRESS$;00:08:C7:1B:8C:02 Set a macro for a host In order to set a custom host macro, use the 'setmacro' action. If the macro exists, this action will only update information. If this macro is not already created, this action will add this macro. Example : [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setmacro -v "Centreon-Server;warning;80" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setmacro -v "Centreon-Server;critical;90" Delete a host macro In order to delete a macro host, use the 'delmacro' action. Example : [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delmacro -v "Centreon-Server;warning" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delmacro -v "Centreon-Server;critical" View template list of a host In order to view the template list of a host, use the 'gettemplate' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a gettemplate -v "Centreon-Server" id;name2;generic-host12;Linux-Servers Add a template to a host In order to add a host template to an existing host, use the 'addtemplate' or the 'settemplate' action, where 'add' will append and 'set' will overwrite. [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addtemplate -v "Centreon-Server;srv-Linux" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a settemplate -v "Centreon-Server;hardware-Dell" Note: all service templates linked to the new host template will be automatically deployed on the existing host. (no longer the case with version later than 1.3.0, use the 'applytpl' action manually)

You need to generate your configuration file and restart monitoring engine in order to apply changes. Remove templates from a host In order to remove a host template to an existing host, use 'deltemplate' action. [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a deltemplate -v "test;srv-Linux|hardware-Dell" You need to generate your configuration file and restart monitoring engine in order to apply changes. Apply template changes on Hosts When a template host undergoes modified link-level service template, the change is not automatically reflected in hosts belonging to that template. For the change to take effect, it must then re-apply the template on this host. For this CLAP integrates control "APPLTPL". [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a applytpl -v "test" All new sercives are now created. You need to generate your configuration file and restart monitoring engine in order to apply changes. View parents of a host In order to view the parents of a host, use the 'getparent' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getparent -v "Centreon-Server" id;name43;server-parent144;server-parent2 Set a parent for Hosts In order to add a host parent to an host, use the 'addparent' or 'setparent' action where 'add' will append and 'set' will overwrite the parent definitions. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addparent -v "host;hostParent1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparent -v "host;hostParent1|hostParent2" You can also use a list of host (host name separated by '|'). Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparent -v "host;hostParent1|hostParent2|hostParent3" Tips: setchild action doesn't exists. In order to set child, think to invert hosts. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setparent -v "hostParent;host" You need to generate your configuration file and restart monitoring engine in order to apply changes. Remove parent relation from a host In order to remove a parent, use the 'delparent' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delparent -v "Centreon-Server;server-parent1|server-parent2" View notification contact groups of a host In order to view the notification contact groups of a host, use the 'getcontactgroup' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getcontactgroup -v "Centreon-Server" id;name17;Administrators Add notification contactgroups to a host If you want to add notification contactgroups to a host, use the 'addcontactgroup' or 'setcontactgroup' action where 'add' will append and 'set' will overwrite definitions. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addcontactgroup -v "Centreon-Server;Contactgroup1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setcontactgroup -v "Centreon-Server;Contactgroup1|Contactgroup2" You need to generate your configuration file and restart monitoring engine in order to apply changes. Remove notification contactgroups from a host If you want to remove notification contactgroups from a host, use the 'delcontactgroup' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delcontactgroup -v "Centreon-Server;Contactgroup2" You need to generate your configuration file and restart monitoring engine in order to apply changes. View notification contacts of a host In order to view the notification contacts of a host, use the 'getcontact' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a getcontact -v "Centreon-Server" id;name11;guest Add notification contacts to a host If you want to add notification contacts to a host, use the 'addcontact' or 'setcontact' action where 'add' will append and 'set' will overwrite definitions. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addcontact -v "Centreon-Server;Contact1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a setcontact -v "Centreon-Server;Contact1|Contact2" You need to generate your configuration file and restart monitoring engine in order to apply changes. Remove notification contact from a host If you want to remove a notification contacts from a host, use the 'delcontact' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delcontact -v "Centreon-Server;Contact2" You need to generate your configuration file and restart monitoring engine in order to apply changes. View hostgroups that are tied to a host In order to view the hostgroups that are tied to a host, use the 'gethostgroup' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a gethostgroup -v "Centreon-Server" id;name9;Linux-Servers Tie hostgroups to a host If you want to tie hostgroups to a host, use the 'addhostgroup' or 'sethostgroup' action where 'add' will append and 'set' will overwrite definitions. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a addhostgroup -v "Centreon-Server;Hostgroup1" [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a sethostgroup -v "Centreon-Server;Hostgroup1|Hostgroup2" You need to generate your configuration file and restart monitoring engine in order to apply changes. Untie hostgroups from a host If you want to remove hostgroups from a host, use the 'delhostgroup' action. Example: [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a delhostgroup -v "Centreon-Server;Hostgroup2" You need to generate your configuration file and restart monitoring engine in order to apply changes. Enable a host In order to enable an host, you can use "enable" action. [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a enable -v "test" You need to generate your configuration file and restart monitoring engine in order to apply changes. Disable a host In order to disable a host, you can use "disable" action. [root@centreon ~]# ./centreon -u admin -p centreon -o HOST -a disable -v "test" You need to generate your configuration file and restart monitoring engine in order to apply changes.