Azure Microsoft Compute

This document describes the Azure Microsoft Compute functionality of PandoraFMS discovery.

Introduction

The purpose of this plugin is to monitor instances and regions of Azure Microsoft Compute, using key metrics related to the CPU, networks, IOPS and disks that are essential to control and monitor these machines and to guarantee optimal performance, solve problems, plan the scaling, meeting SLAs and improving security.

The plugin connects to the Azure API and monitors zones and instances using the aforementioned metrics, generating an agent for each zone and instance via XML that is sent to the Pandora server.

Compatibility matrix

Systems where it has been tested Rocky linux, Fedora 34
Systems where it works Any linux system

Prerrequisites

SUBSCRIPTION_ID 

Go to your subscription, you can find the subscription ID, in the top menu.

image.png

TENANT_ID

To get the tenant ID. Go to the azure Portal and search for "Entra Id". On the Overview overview page.The Directory (tenant) ID is displayed. Copy this ID. That's your tenant ID.

image.png

.

CLIENT_ID AND SECRET

For the Client ID and secret, you will need to create these as a app registration.

To create a new App registration you will need to follow the steps here:
https://learn.microsoft.com/en-us/azure/healthcare-apis/register-application

On there you will get the Application ID (Client ID) and create also the Client Secret. You can then copy the values and use.

Permission Assignment 
You must assign a role to the account with which you are going to operate the app. To do this, go to Home and enter Subscription:

image.png

Within the subscription, select Access control (IAM):

image.png

A new role assignment will be added in which you must select Reader for the created app:

The created app can be searched in members (main service)

image.png

Save your changes by clicking Save.

From that moment on you will be able to connect with the service and make requests through this plugin.

Parameters and configuration

Parameters

--conf Path to configuration file

Configuration file (--conf)

agents_group_name = < Name of the target group for the created agents >
threads = < Number of execution threads, each zone/instance will be equally distributed in the number of threads >
interval = < Interval in seconds for agents and for metric analysis >
transfer_mode = < Transfer mode, tentacle or local >
tentacle_ip = < IP of the target machine for the created agents >
tentacle_port = <tentacle port, default: 41121>
tentacle_opts = < Tentacle client additional options >
data_dir = < (Only activated if the transfer_mode is local) Destination path for the XML of each agent, by default "/var/spool/pandora/data_in/" >

advance_monitoring = < Activate with 1 to enable generalized monitoring (these modules will only be created in the agents of the instances that are running) >
cpu_summary = < Enable with 1 to enable CPU monitoring >
iops_summary = < Enable with 1 to enable IOPS monitoring >
disk_summary = < Enable with 1 to enable disk monitoring >
network_summary = < Enable with 1 to enable network monitoring >

stats_agent = < Activate with 1 to enable a global agent that will monitor based on the task created and the parameters used >
stats_agent_name = < Name for the agent that is activated with the "stats_agent" parameter. If you do not use and "stats_agent" is enabled, the agent will be called "azure" by default > >

azure_zones = < List with the zones to monitor (when a zone is marked to monitor, it automatically monitors all the instances found within that zone) >
azure_instances = = < List with the instances to monitor >

creds_b64 = < Base64 credentials in the JSON file to authenticate >

Example:

agents_group_name  = azure
interval           = 3600
threads            = 5
transfer_mode      = tentacle
tentacle_client    = tentacle_client
tentacle_ip        = 172.42.42.101
tentacle_port      = 41121
data_dir           = /var/spool/pandora/data_in/

advance_monitoring = 1
cpu_summary        = 1
iops_summary       = 1
disk_summary       = 1
network_summary    = 1

stats_agent        = 1
stats_agent_name   = azureCloud

azure_zones = ["uksouth","ukwest"]
azure_instances = ["instance-1","instance-2","instance-3",instance-4"]


creds_b64 = oiZJDNNJKCDJndkdKDNJDKDKNDhjdkdmdNHFJFKfFMFNFJFKk5IinDJFJKFKfmnfDHHDKDKDldjjDfmFJFNFFMNFNFMFNFmFNFFJJFmf==

 

 

Manual execution

The plugin execution format is as follows:

./pandora_azure_mc --conf < path to configuration file >

For example:

./pandora_azure_mc --conf /usr/share/pandora_server/util/plugin/azure.conf

The execution will return an output in JSON format with information about the execution, and will generate an XML file for each monitored agent that will be sent to the Pandora FMS server by the transfer method indicated in the configuration.

For example:

{"summary": {"Total agents": 35, "Zones agents": 5, "Instances agents": 29}}

 

Discovery

This plugin can be integrated with Pandora FMS Discovery.

To do this, you must load the ".disco" package that you can download from the Pandora FMS library:

https://pandorafms.com/library/

image-1687944710118.png

Once loaded, Azure Microsoft Compute environments can be monitored by creating Discovery tasks from the Management > Discovery > Cloud section.

image-1687944813607.png

For each task, the following minimum data will be requested:

image-1687441745735.png

If the credentials provided are correct and the Pandora FMS server is able to connect to the Microsfot Azure API, you will be able to see a tree with Azure Microsoft Compute zones and instances, which can be marked for monitoring.

If a zone is selected, in addition to the zone itself, all the instances it contains will be monitored (both at the time of configuring the task and later if new instances are included).

If specific instances are selected, they will be monitored regardless of whether their zones have not been selected.

image-1687441086213.png

Finally, you can adjust the monitoring you want to obtain for each agent:

image-1687441126549.png

Tasks that are successfully completed will have an execution summary with the following information:

image-1687441167730.png

The tasks that are not completed successfully will have an execution summary recording the errors produced.

Agents and modules generated by the plugin

Running the plugin will create the following agents and modules:

< Name used with the parameter "stats_agent_name" or failing that "azure" >

Modules

Azure MC Instances count
Number of total instances monitored by the plugin
<Zone name>

Modules

summary.azure.compute.CPUUtilization Average CPU percentage used for instances in this zone
summary.azure.compute.DiskReadBytes Summary of the number of bytes read from disk for each instance of this zone
summary.azure.compute.DiskReadOps Summary of the number of read operations performed on the disk of each instance of this zone
summary.azure.compute.diskWriteBytes Summary of the number of bytes written to disk for each instance of this zone
summary.azure.compute.DiskWriteOps Summary of the number of write operations performed on the disk for each instance in this zone
summary.azure.compute.instances Number of instances monitored in this zone
summary.azure.compute.NetworkPacketsIn Summary of the number of incoming network packets for each instance of this zone
summary.azure.compute.NetworkPacketsOut Summary of the number of outgoing network packets for each instance in this zone

 

< Resource group name >/< Instance name >

Modules

State Machine status, in string format
Instance State (bool) Machine status, 1 if it is running, 0 if this is not the case
CPUUtilization CPU usage percentage used
DiskReadBytes Number of bytes read from disk
DiskReadOps The number of read operations performed on the disk
DiskWriteBytes Number of bytes written to disk
DiskWriteOps Number of write operations performed on the disk
NetworkPacketsIn The number of incoming network packets
NetworkPacketsOut The number of outgoing network packets