Docker, Postgres and python projets for centreon needs
- Centreon platform installed up and running
- Configure user for SQL MariaDB Connection (autocentreon.conf)
- Add Manually Host Template and Pollers (Collector) in Centreon web Plaform like in the "inventory.csv file"
- Add User un centreon web Platforms who can reach Centreon API
- Install Docker, Docker-compose and Make on your VM
- Configure "autocentreon.conf" in "autocentreon/src/" with your credentials
- Configure your inventory list ("inventory/date.csv")
- Follow this columns order for : hostname, alias, IP, etat_sup, model, templates, pollers, groups, categories
- Setup a .env file in root project directory with :
POSTGRES_PASSWORD="YOUR_PASSWORD"
Exemple autocentreon.conf :
{
"inventory-path" : "inventory",
"centreon-database" : {
"host" : "192.168.1.5",
"username":"centreon-db-user",
"password":""
},
"centreon-api" : {
"host" : "192.168.1.5",
"username":"centreon-api-user",
"password":""
},
"postgres": {
"host" : "172.17.0.2",
"username" : "postgres",
"password" : "",
"database" : "postgres",
"port" : "5432"
}
}
Follow these steps for run the project.
- Clone the repo
git clone git@github.com:phoenix78/autocentreon.git
- Navigate to autocentreon folder
cd autocentreon
- Build and Run containers
make
Result Output :
Make: Starting environment containers.
Recreating autoCentreon ... done
Recreating database ... done
- Check Autocentreon logs
docker logs autoCentreon
Result Output :
root@shark:/home/shark/autocentreon# docker logs autoCentreon
Hosts list: 27
Groups list: 28
Templates list: 1
Categories list: 28
Collectors list: 1
AUTOCENTREON - SUCCESS CONNECT - Token Centreon : <token>
AUTOCENTREON - EQUIPEMENTS A AJOUTER: 0
AUTOCENTREON - EQUIPEMENTS A SUPPRIMER: 0
AUTOCENTREON - Pas besoin de redemarrer les Pollers - Aucun equipements ajouté ou supprimé dans centreon