# Pandora sybase

# Introduction

Plugin for monitoring a Sybase ASE database.

# Compatibility matrix

<table border="1" id="bkmrk-systems-where-it-has"><tbody><tr><td>**Systems where it has been tested**</td><td>Windows 10

</td></tr><tr><td>**Systems where it should work**</td><td>Windows 10 and later versions

Any Linux system

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

# Prerequisites

- Have the Endpoint installed on the machine where Sybase is running.
- isql - Located in `$SYBASE/$SYBASE_OCS/bin`.

# Plugin configuration

To connect to the database to be monitored, the following fields must be completed in the `pandora_sybase.conf` file:

- isql = Path to the interactive `isql` terminal
- mode=Tentacle by default
- tentacle\_ip = IP address of the Pandora server
- tentacle\_port = Tentacle port of the Pandora server, `41121` by default.

- numberdatabases = Number of databases to be monitored. For each database, the corresponding `user`, `password`, `server`, and `name_agent` must be configured. For example, if two databases need to be monitored, the configuration parameters would be `user1`, `password1`, `server1` for the first database, and `user2`, `password2`, and `server2` for the second.

**Example:**

user1=sa  
password1=p4assword  
server1=desktop12  
name\_agent1=sybase\_desktop12

user2=sa  
password2=Fr4gile  
server2=desktop7  
name\_agent2=sybase\_desktop7

\* If the database can only be accessed via `isql` by specifying the port, it must be included in the configuration file, for example: `desktop12:2083`

- numberqueries = Number of custom queries to be executed (each one will create a module). For each query, in addition to the query itself, a module name and a module type must be defined. The parameters for configuring each query are: `query`, `namemodule`, and `typemodule`. For example, if two modules are to be created, `query1`, `namemodule1`, and `typemodule1` will define the first, while `query2`, `namemodule2`, and `typemodule2` will define the second.

**Example:**

query1=select sum^(case when u.segmap != 4 then size - curunreservedpgs^(u.dbid, u.lstart, u.unreservedpgs^^^) end^^^)/1048576.\*4096 as data\_used from master..sysdatabases d, master..sysusages u where u.dbid = d.dbid and d.status != 256 and db\_name^(u.dbid^^^) = 'test'  
namemodule1=data used database test  
typemodule1=generic\_data

query2=select sum^(case when u.segmap != 4 then size - curunreservedpgs^(u.dbid, u.lstart, u.unreservedpgs^^^) end^^^)/1048576.\*4096 as data\_used from master..sysdatabases d, master..sysusages u where u.dbid = d.dbid and d.status != 256 and db\_name^(u.dbid^^^) = 'master'  
namemodule2=data used database master  
typemodule2=generic\_data

Example of `.conf` file

```
isql=C:\SAP\OCS-16_0\bin\isql

# number of databases
numberdatabases=1

# database user
user1=sa
password1=pandorapass
server1=DESKTOPDQN7L842
name_agent1=sybase_DESKTOPDQN7L842

mode=tentacle
tentacle_ip=192.168.0.29
tentacle_port=41121

# number of queries
numberqueries=2

# queries and modules

query1=select sum^(case when u.segmap != 4 then size - curunreservedpgs^(u.dbid, u.lstart, u.unreservedpgs^^^) end^^^)/1048576.*4096 as data_used from master..sysdatabases d, master..sysusages u where u.dbid = d.dbid and d.status != 256 and db_name^(u.dbid^^^) = 'test'
namemodule1=data used database test
typemodule1=generic_data

query2=select sum^(case when u.segmap != 4 then size - curunreservedpgs^(u.dbid, u.lstart, u.unreservedpgs^^^) end^^^)/1048576.*4096 as data_used from master..sysdatabases d, master..sysusages u where u.dbid = d.dbid and d.status != 256 and db_name^(u.dbid^^^) = 'master'
namemodule2=data used database master
typemodule2=generic_data

```

# Manual execution

**Manual execution**

```
<path to pandora_sybase.64.exe> <path to pandora_sybase.conf>
```

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

# Configuration in Pandora FMS

To monitor with the plugin from Pandora FMS, it must be called from the Endpoint configuration file located at the following path:

```
/etc/pandora/pandora_agent.conf
```

It should be added on the last line of the configuration file using the `module_plugin` command, followed by the path to the plugin and the path to the `pandora_sybase.conf` file.

```
module_plugin <path to pandora_sybase.64.exe> <path to pandora_sybase.conf>
```

This can also be done from the console if remote configuration is enabled.

Example using the sample execution described in the manual execution section:

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

# Modules generated by the plugin

The plugin will create the following modules, in addition to any custom modules defined in the configuration file with the corresponding queries.

<table border="1" id="bkmrk-module-description" style="border-collapse: collapse; width: 100%; height: 348px;"><tbody><tr style="height: 29px;"><td style="width: 50%; height: 29px;">**Module**</td><td style="width: 50%; height: 29px;">**Description**</td></tr><tr class="datos2" id="bkmrk-sybase-ase-status-el"><td class="datos2" id="bkmrk-sybase-ase-status" style="width: 50%;">Sybase ASE status</td><td style="width: 50%; height: 29px;">Server status</td></tr><tr class="datos" id="bkmrk-sybase-ase-backup-se"><td class="datos" id="bkmrk-sybase-ase-backup-se-0" style="width: 50%;">Sybase ASE Backup server status</td><td style="width: 50%; height: 29px;">Backup server status</td></tr><tr class="datos" id="bkmrk-sybase-cpu-busy-tiem"><td class="datos" id="bkmrk-sybase-cpu-busy" style="width: 50%;">Sybase CPU Busy</td><td style="width: 50%; height: 29px;">Time the server was busy during the previous polling cycle</td></tr><tr class="datos2" id="bkmrk-sybase-locks-remaini"><td class="datos2" id="bkmrk-sybase-locks-remaini-0" style="width: 50%;">Sybase Locks Remaining</td><td style="width: 50%; height: 29px;">Number of locks available for use</td></tr><tr class="datos" id="bkmrk-sybase-memory-use-me"><td class="datos" id="bkmrk-sybase-memory-use" style="width: 50%;">Sybase Memory Use</td><td style="width: 50%; height: 29px;">Memory used in MB</td></tr><tr class="datos2" id="bkmrk-sybase-mirror-device"><td class="datos2" id="bkmrk-sybase-mirror-device-0" style="width: 50%;">Sybase Mirror Devices</td><td style="width: 50%; height: 29px;">Number of devices configured for mirroring but not currently being mirrored</td></tr><tr class="datos" id="bkmrk-sybase-suspect-datab"><td class="datos" id="bkmrk-sybase-suspect-datab-0" style="width: 50%;">Sybase Suspect Databases</td><td style="width: 50%; height: 29px;">Number of databases marked as suspect or unusable by the Adaptive Server</td></tr><tr class="datos2" id="bkmrk-sybase_active_locks-"><td class="datos2" id="bkmrk-sybase_active_locks" style="width: 50%;">Sybase\_active\_locks</td><td style="width: 50%; height: 29px;">Number of active locks</td></tr><tr style="height: 29px;"><td style="width: 50%; height: 29px;">Sybase\_total\_locks</td><td style="width: 50%; height: 29px;">Total number of locks</td></tr><tr class="datos2" id="bkmrk-sybase_users_conecte"><td class="datos2" id="bkmrk-sybase_users_conecte-0" style="width: 50%;">Sybase\_users\_conected</td><td style="width: 50%; height: 29px;">Number of connected users</td></tr><tr class="datos" id="bkmrk-sybase_version-n%C3%BAmer"><td class="datos" id="bkmrk-sybase_version" style="width: 50%;">Sybase\_version</td><td style="width: 50%; height: 29px;">Version number</td></tr><tr><td style="width: 50%;">Sybase all databases used size</td><td style="width: 50%;">Used size of all databases</td></tr></tbody></table>

[![image-1661434319960.PNG](https://pandorafms.com/guides/public/uploads/images/gallery/2022-08/scaled-1680-/image-1661434319960.PNG)](https://pandorafms.com/guides/public/uploads/images/gallery/2022-08/image-1661434319960.PNG)