# Pandora Azure SQL

# Introduction

Ver. 11-05-2022

With this plugin you can monitor an azureSQL database and extract data from it.  
Type: Server plug-in

# Compatibility matrix

<table border="1" id="bkmrk-sistemas-donde-se-ha" style="height: 70px; width: 476px;"><tbody><tr style="height: 35px;"><td style="height: 35px; width: 233px;">Systems where tested</td><td style="height: 35px; width: 243px;">CentOS 7, Fedora, rocky linux

</td></tr><tr style="height: 35px;"><td style="height: 35px; width: 233px;">Systems where it should work</td><td style="height: 35px; width: 243px;">Cualquier sistema linux

</td></tr></tbody></table>

# Pre requisites

\- Pandora FMS Data Server enabled  
\- Have the Pandora FMS Plugin Server enabled.  
\- Know some credentials of your account, such as your tenant id, secret, client id and the resource\_Id of the database.

# Previous configuration

The plugin makes use of a file in which two types of data can be entered.

```
#credentials
tenant_id:<tenant-id>
client_id:<client-id>
secret:<secret>
#id resources
database_id:<database_resource_id>
```

**Obtaining credentials necessary for the use of the plugin.**

1\. Credentials to authenticate:

-Tenant id

-Client id

-Secret

2\. Resource id

The resource id of each resource monitored by the plugin is required these are :

\- Database resource id

**Obtaining tenant id and client id.**

1\. To obtain the tenant id and the client id, we will go to the application registry menu inside active directory:

[![menu.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/menu.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/menu.png)

2\. We will enter inside the application.

[![menu2.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/menu2.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/menu2.png)

3\. The tenant id and client id will appear in the application menu.

[![menu3.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/menu3.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/menu3.png)

4\. To find the secret we will go to certificates and secrets inside the active directory menu.

[![menu4.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/menu4.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/menu4.png)

5\. Within this menu we will be able to see the secret keys or generate them (it has to be the key value, not the id).

[![menu5.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/menu5.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/menu5.png)

**Obtaining the resource id of the database.**

In the database, in general information, we can see the resource id of the database by clicking on json view.

[![image-1652285449723.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652285449723.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652285449723.png)

# Parameters

<table border="1" id="bkmrk-par%C3%A1metro-descripci%C3%B3" style="border-collapse: collapse; width: 100%; height: 401px;"><tbody><tr style="height: 29px;"><td style="width: 50%; height: 29px;">**Parámetro**</td><td style="width: 50%; height: 29px;">**Descripción**</td></tr><tr><td style="width: 50%;">--tentacle\_port</td><td style="width: 50%;">Tentacle port (default 41121)(optional)</td></tr><tr><td style="width: 50%;">--tentacle\_address</td><td style="width: 50%;">Ip of the tentacle server to send the data (optional)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--agent\_name</td><td style="width: 50%; height: 29px;">To name the agent that will contain the modules, by default: "Azure SQL" (optional).</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--prefix\_module</td><td style="width: 50%; height: 29px;">To prefix the modules in case you want to differentiate them from other executions (optional).</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">--conf</td><td style="width: 50%; height: 29px;">Path of the conf file with the queries (required)</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">-g,--group</td><td style="width: 50%; height: 29px;">Pandora FMS target group (optional)</td></tr><tr style="height: 46px;"><td style="width: 50%; height: 46px;">--data\_dir</td><td style="width: 50%; height: 46px;">Pandora FMS data directory. By default it is /var/spool/pandora/data\_in/ (optional)</td></tr><tr style="height: 63px;"><td style="width: 50%; height: 63px;">--as\_agent\_plugin</td><td style="width: 50%; height: 63px;">It is optional, if you want the plugin to be an agent plugin and put the modules in the pandora agent, execute this with a 1 (optional)</td></tr></tbody></table>

# Manual execution

Example of manual execution:

```
./pandora_azuresql -c <path_conf>
```

[![image-1652284119687.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652284119687.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652284119687.png)

```
./pandora_azure -c <path_conf> --as_agent_plugin 1 [--data_dir <path> --agent_name <agent name>]
```

[![image-1652283880334.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652283880334.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652283880334.png)

# Configuration in pandora

As a server plugin

Installation from console

To register the plugin, from the console, go to the "register plugin" section.

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/368imagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/368imagen.png)

Click on select file.

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/r72imagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/r72imagen.png)

Select the pspz2 file that contains the plugin

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/pe4imagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/pe4imagen.png)

Nos saldrá un mensaje que indicará si se ha registrado correctamente

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/woQimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/woQimagen.png)

Once the plugin is registered, we will see it in the plugins section.

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/vAkimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/vAkimagen.png)

Click on the title to access the plugin menu.

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/R7Timagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/R7Timagen.png)

In parameters, we will see all the parameters of the plugin, remember that not all of them are mandatory, only in the ones that are specified

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/U01imagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/U01imagen.png)

Below, in the parameter macros we can add the required value.

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/1tOimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/1tOimagen.png)

**Manual installation**

Go to servers &gt; plugins:

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/CIYimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/CIYimagen.png)

Click on add:

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/DDmimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/DDmimagen.png)

We put the name and description of your choice:

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/4rNimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/4rNimagen.png)

We enter as command the execution with the path of the plugin:

```
/path_pandora_azuresql
```

And in plugin parameters we will introduce these followed by the macro "\_field\_", the mandatory ones for the plugin to work are -c and --as\_agent\_plugin (in case we want to run it as a server plugin, otherwise the latter is not essential.

We will define these with the macros below.

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/1Iiimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/1Iiimagen.png)

Once this is done, click on "create".

You can check that you have entered the values correctly by executing the terminal preview command

If it does not give errors, it means that it has been introduced well.

Once this is done, the only thing left to do is to call it, so we will go to some agent's view and create an add-in module:

[![imagen.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/scaled-1680-/PINimagen.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-08/PINimagen.png)

We will give it a name and in the section "plugin" we will put the one we have just configured.

Once this is done, click on create.

If the module is shown with 1, it means that it is running correctly.

# Modules generated by the plugin

The plugin will create an agent with the name we have set with the --agent\_name parameter.

[![image-1652281792427.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652281792427.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652281792427.png)

And it will create the following modules:

<table border="1" id="bkmrk-allocated_data_stora" style="border-collapse: collapse; width: 100%; height: 290px;"><tbody><tr style="height: 29px;"><td style="width: 100%; height: 29px;">allocated\_data\_storage</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">app\_cpu\_billed</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">app\_cpu\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">app\_memory\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">blocked\_by\_firewall</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">connection\_failed</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">connection\_successful</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">cpu\_limit</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">cpu\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">cpu\_used</td></tr></tbody></table>

<table border="1" id="bkmrk-deadlock-log_write_p" style="border-collapse: collapse; width: 100%; height: 290px;"><tbody><tr style="height: 29px;"><td style="width: 100%; height: 29px;">deadlock</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">log\_write\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">physical\_data\_read\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">sessions\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">sql\_server\_process\_core\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">sql\_server\_process\_memory\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">storage</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">storage\_percent</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">tempdb\_size</td></tr><tr style="height: 29px;"><td style="width: 100%; height: 29px;">tempdb\_log\_size</td></tr></tbody></table>

<table border="1" id="bkmrk-tempdb_log_used_perc" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="width: 100%;">tempdb\_log\_used\_Percent</td></tr><tr><td style="width: 100%;">workers percent</td></tr><tr><td style="width: 100%;">xtp\_storage\_percent</td></tr></tbody></table>

[![Captura desde 2025-07-17 14-56-39.png](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/scaled-1680-/BHdcaptura-desde-2025-07-17-14-56-39.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2025-07/BHdcaptura-desde-2025-07-17-14-56-39.png)