Object name: HC
In order to list available host categories, use the SHOW action:
[root@centreon ~]# ./centreon -u admin -p centreon -o HC -a show
id;name;alias;members
1;Linux;Linux Servers;host1
2;Windows;Windows Server;host2
3;AS400;AS400 systems;host3,host4
Columns are the following:
| Column | Description |
|---|---|
| Name | Name of host category |
| Alias | Alias of host category |
In order to add a host category, use the ADD:
[root@centreon ~]# ./centreon -u admin -p centreon -o HC -a add -v "Databases;Databases servers"
Required parameters are the following:
| Order | Description |
|---|---|
| 1 | Name of host category |
| 2 | Alias of host category |
In order to delete a host category, use the DEL action. The name is used for identifying the host category you want to delete:
[root@centreon ~]# ./centreon -u admin -p centreon -o HC -a DEL -v "Databases"
In order to view the list hosts in a host category, use the GETMEMBER action:
[root@centreon ~]# ./centreon -u admin -p centreon -o HC -a getmember -v "Linux"
id;name
14;Centreon-Server
15;srv-test
In order to add a host or a host template into a host category, use the ADDMEMBER or SETMEMBER action where add will append and set will overwrite previous definitions:
[root@centreon ~]# ./centreon -u admin -p centreon -o HC -a addmember -v "Linux;host7"
[root@centreon ~]# ./centreon -u admin -p centreon -o HC -a setmember -v "Windows;host7|host8|host9"
The needed parameters are the following:
| Order | Description |
|---|---|
| 1 | Host category name |
| 2 | Host names to add/set. For multiple definitions, use the | delimiter |
The needed parameters are the following:
| Order | Description |
|---|---|
| 1 | Host category name |
| 2 | Host names to remove from host category |