IM probe
1 INTRODUCTION
Infrastructure Manager (IM) is a tool that eases access and usability of IaaS clouds by automating virtual machine infrastructure selection, deployment, configuration, software installation, monitoring and update of virtual appliances. In order to offer relevant data to users about the health of its operations, the most relevant metrics are obtained by a python based monitor agent, using the IM REST API. Once obtained data from platform, this content is processed and sent to a Zabbix server which store and visualize monitorization data.
2 ARCHITECTURE
The monitorization agent is a client-side software, that connects with IM to capture monitorization data, and sends it to Zabbix server. Agent does not need any open ports, just send data on passive mode to Zabbix and gather data from IM via IM API REST by GET, POST, PUT and DELETE http requests. Agent is composed by scripts that use IM API and Zabbix API, and loads configurations from files that must be edited correctly by an administrator.
3 FILE STRUCTURE
The agent is composed by a principal python script named probeim.py, four support libraries named loadconfigs.py, tokenmng.py, IMinfrastructureOper.py and zabbix.py and a directory conf with two configuration files, imzabbix.conf and authorizationHeader.txt.
3.1 SCRIPTS
File probeim.py is the executable script that gathers all measured data and sends it to zabbix.
File zabbix.py contains functionalities related to interaction with zabbix API. Here we can authenticate against zabbix obtaining a valid token; get a list of all monitored items; create items; get template and item identifiers.
File IMinfrastructureOper.py contains functionalities related to interaction with IM environment through its API. Here we can throw actions like creating infrastructure, listing infrastructure, creating VM, deleting infrastructure, and get the status of each of these actions.
File tokenmng.py has functions that connect with IAM to request a token from a refresh token, so client remains authenticated to be able to launch operations over IM.
File loadconfigs.py contains classes that help to bring configuration data to the agent and are used to connect to Zabbix, IAM and IM.
3.2 CONFIGURATION
imzabbix.conf
Example from /conf here
Section | zabbix |
uri | the api url to make requests |
username | the zabbix username used for authentication in order to get a token |
password | the zabbix password used for authentication |
server_add | IP address where zabbix server is running |
agent_delay | Time in seconds for each loop that catches data |
template | the name of template used for IM measurements |
monitoredhost | the hostname of the monitored host |
Section | im |
urlbase | the IM api url to make requests |
radl | the radl configuration for IM to create a VM. |
Section | iam |
urlrefresh | the api url to request a new token from a refresh token |
Section | log |
loglevel | the severity of logs. This can take the following values: ERROR, WARNING, INFO, DEBUG |
Default values is WARNING. |
authorizationHeader.txt
Example from /conf here
4 DATA SOURCES
METHOD /URL | Items |
GET /infrastructures | List_inf |
POST /infrastructures | Create_inf |
PUT /infrastructures//start | Start_inf |
POST /infrastructures/ |
body: RADL document | Create_vm | | DELETE /infrastructures/<infId|Delete_inf |
To connect to IM an appropriated header must be set.
Where the authoriz field comes from authorizationHeader.txt file.
5 DOCKER CONTAINER
Create or download a Dockerfile Use your Docker user and a name you want for your image.
Download and execute the script used to request to IM an access token. You need your client credentials, IAM user and password.
Build an image from the directory where your Dockerfile is located.
After image was created, set up required parameters and run the docker container.
Last updated