# 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
Systems where testedCentOS 7, Fedora, rocky linux
Systems where it should workCualquier sistema linux
# 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: client_id: secret: #id resources database_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
**Parámetro****Descripción**
--tentacle\_portTentacle port (default 41121)(optional)
--tentacle\_addressIp of the tentacle server to send the data (optional)
--agent\_nameTo name the agent that will contain the modules, by default: "Azure SQL" (optional).
--prefix\_moduleTo prefix the modules in case you want to differentiate them from other executions (optional).
--confPath of the conf file with the queries (required)
-g,--groupPandora FMS target group (optional)
--data\_dirPandora FMS data directory. By default it is /var/spool/pandora/data\_in/ (optional)
--as\_agent\_pluginIt 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)
# Manual execution Example of manual execution: ``` ./pandora_azuresql -c ``` [![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 --as_agent_plugin 1 [--data_dir --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. **[![register_plugin.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/scaled-1680-/register-plugin.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/register-plugin.png)** Click on select file. **[![register_plugin2.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/scaled-1680-/register-plugin2.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/register-plugin2.png)** Select the pspz2 file that contains the plugin [![image-1652351401344.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652351401344.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652351401344.png) Nos saldrá un mensaje que indicará si se ha registrado correctamente [![image-1652351503518.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652351503518.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652351503518.png) Once the plugin is registered, we will see it in the plugins section. [![serversingles.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/scaled-1680-/serversingles.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/serversingles.png) Click on the title to access the plugin menu. [![image-1652351575064.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652351575064.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652351575064.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 [![image-1652351615625.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652351615625.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652351615625.png) Below, in the parameter macros we can add the required value. [![register5_azure.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/scaled-1680-/register5-azure.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/register5-azure.png) Manual installation Go to servers > plugins: [![image-1629974405286.png](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/scaled-1680-/image-1629974405286.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/image-1629974405286.png) Click on add: [![image-1629974430627.png](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/scaled-1680-/image-1629974430627.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2021-08/image-1629974430627.png) We put the name and description of your choice: [![image-1652351720175.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652351720175.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652351720175.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. [![image-1650289265687.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/scaled-1680-/image-1650289265687.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-04/image-1650289265687.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: [![image-1646741530197.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-03/scaled-1680-/image-1646741530197.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-03/image-1646741530197.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:
allocated\_data\_storage
app\_cpu\_billed
app\_cpu\_percent
app\_memory\_percent
blocked\_by\_firewall
connection\_failed
connection\_successful
cpu\_limit
cpu\_percent
cpu\_used
deadlock
log\_write\_percent
physical\_data\_read\_percent
sessions\_percent
sql\_server\_process\_core\_percent
sql\_server\_process\_memory\_percent
storage
storage\_percent
tempdb\_size
tempdb\_log\_size
tempdb\_log\_used\_Percent
workers percent
xtp\_storage\_percent
[![image-1652281877184.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652281877184.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652281877184.png) [![image-1652281933512.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652281933512.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652281933512.png) [![image-1652281976572.png](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/scaled-1680-/image-1652281976572.png)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-05/image-1652281976572.png)