https://github.com/ravening/cloudstack-api-monitoring
Web application to get all api's happening on cloudstack platforms
https://github.com/ravening/cloudstack-api-monitoring
Last synced: 2 months ago
JSON representation
Web application to get all api's happening on cloudstack platforms
- Host: GitHub
- URL: https://github.com/ravening/cloudstack-api-monitoring
- Owner: ravening
- Created: 2020-04-16T16:34:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-05T21:59:27.000Z (almost 2 years ago)
- Last Synced: 2025-02-11T11:56:32.648Z (4 months ago)
- Language: Java
- Size: 125 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CloudStack API monitoring
A Java application to monitor all the API's happening in the CloudStack platform\
and to export the stats for external system## Getting Started
Steps mentioned below will tell you how to get started withe the project.
### Prerequisites
What things you need to install the software and how to install them
```
MandatoryJava 8+
Apache Maven
Any IDE to import the project
MysqlOptional
Docker for running containers
Prometheus and grafana to receive stats and draw graphs
Kafka cluster to receive cloudstack events
```### Installing
A step by step series of instructions that tell you how to start the project
Download the project
```
git clone
```Import the project into any IDE as a Maven project.
To talk to CloudStack, you need the URL endpoint, ApiKey and SecretKey.
You need to enter these values in "application.properties" file.It can connect to multiple CLoudStack endpoints simultaneously.
If you have 5 data centers with CloudStack installed
in different regions then you need to enter the above
mentioned three parameters corresponding to the location
name.For ex: If you have CloudStack instance running in USA,
EUROPE and ASIA location, below is the configuration
you need to enter```
cloudstack.private.platforms=asia,europe
cloudstack.public.platforms=americausa.url=
usa.apiKey=
usa.secretKey=europe.url=
europe.apiKey=
europe.secretKey=asia.url=
asia.apiKey=
asia.secretKey=
```Once these changes are done, you are all good to go.
Only steps left is to build the packages and start the projectBuild the project from the top directory using the command
```bash
mvn package -DskipTests
```This will generate the jar file in the target directory
Now run the project using```bash
java -jar target/cloudstack-stats.jar
```This app stores all the logs in /var/log/cloudstack_stats.log
## Getting stats
Login to mysql database to display the tables and to get all stats
```
mysql cloudstack_stats -u -p
```## Exporting data to prometheus and Grafana
1. Create a prometheus docker container using
```
docker run -d --name=prometheus -p 9090:9090 -v ./prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml
```This will run prometheus on port 9090
2. Now start the grafana container
```
docker run -d --network=host --name=grafana -p 3000:3000 grafana/grafana
```3. Login to grafana and add both mysql and prometheus datasources
4. Now load the dashboard present in `config/grafana/dashboards/`
```
Stats.json
Active Customers.json
API Count.json
```