Yaya Mohamed: ymo-centreon & ymo-web
I installed CentOs 8 and Windows server 2019

### 1. Create and configure both virtual machines.
Ip address Configuration:
- ymo-web

- ymo-centreon
I configured the ip address 10.1.1.101/24 on centreon as shown below

Then i restart the service

To ease the installation and deployment steps some configurations such as adding the necessary ports in the firewall and disabling SELINUX are done
`sed -i s/^SELINUX=.*$/SELINUX=disabled/ /etc/selinux/config`

### 2. Install and configure Centreon on the Linux virtual machine.
The steps below are followed inorder to install centreon 23.0.4.5 on centos8
1. Update centos cached repository information

2. install the remi and CodeReady Builder repositories.
```!bash
dnf install -y dnf-plugins-core
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
dnf config-manager --set-enabled codeready-builder-for-rhel-8-rhui-rpms
```
3. Install MariaDB repository
`curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --os-type=rhel --os-version=8 --mariadb-server-version="mariadb-10.5"`

4. Install php module
```!bash
Enable PHP 8.1
dnf module install php:remi-8.1
```
5. Install centreon repository and update
```!bash
dnf install -y https://yum.centreon.com/standard/22.10/el8/stable/noarch/RPMS/centreon-release-22.10-1.el8.noarch.rpm
dnf update
```

6. Installation of centreon with local database
```!bash
dnf install -y centreon
systemctl daemon-reload
systemctl restart mariadb
```


7. Set the Timezone
`echo "date.timezone = Europe/Brussels" >> /etc/php.d/50-centreon.ini`
`systemctl restart php-fpm`
8. Configure the services to start at boot time
```!bash
systemctl enable php-fpm httpd centreon cbd centengine gorgoned snmptrapd centreontrapd snmpd
systemctl enable crond
systemctl start crond
```
9. Secure the DB
`mysql_secure_installation`


10. Web installation
`systemctl start httpd`






### 3. Configuration of the Poller
For proper configuration of the poller with need to export its parameters to centreon central engine

Select the move export Files option as shown below and Export

After exporting and restarting the service we have the figure below

### 4. Create 2 host groups (trigram-linux / trigram-windows)
This is done from the menu: Configuration > Hosts > HostGroup

After adding we have the host groups below:

### 5. Create 2 contact templates (trigram-administrator / trigram-engineer)
This is done from the menu: Configuration > Hosts > Templates

After adding we have contact templates below:

### 6. Create 4 users (trigram-linux-adm / trigram-linux-eng / trigram-windows-adm/ trigram-windows-eng)
This is done from the menu: Configuration > Users > Contacts / Users

After adding we have the users below:

### 7. Create 8 ACLs:
a. Create 4 access groups:
This is done from the menu:
Administration > ACL > Access Groups

After adding we have the Access groups below:

b. Create 2 ACL Menu Access
This is done from the menu:
Administration > ACL > Menus Access


After adding we have the Menus below:

c. Create 2 ACL Resources Access
This is done from the menu: Administration > ACL > Resources Access


After configuring we have the result shown below

9. Monitor linux virtual machine (Plugin Custom Centreon Central/Database/Poller)
I installed the necessary plugins for the next tasks as shown below

Unfortunately the NSCLIENT plugin is not free so i wont be able to use it for windows server host.

You can say it is graysed
- configuration of linux host (Centreon)
It is necessary to properly configure the snmp client on centreon
1. installation of snmp client

2. Configuration of the Community name
I changed the default community name in the file `/etc/snmp/snmpd.conf ` as shown below

then i restart the service

3. The last step is adding the host in centreon webui

Then i restart the poller configuration

We can see the services starting



10. Monitor Windows virtual machine
I did same for windows server (using snmp)


Results:


11. Use the custom script on Windows host to monitor the size of the folder “drivers” (C:\Windows\System32\drivers) [Warning: 100 Mo / Critical: 150 Mo]
Scripts are found in the directory `/usr/lib/centreon/plugins`
This is where we are going to add our custom script

I added a new script called `Centreon_windows_drivers_size.pl` and changed the permissions

---

