pandora fms: sql enterprise piugin

19
Pandora FMS Administrator Manual Monitoring in SQL Server

Upload: artica-st

Post on 19-Jan-2015

132 views

Category:

Technology


2 download

DESCRIPTION

This plugin help you to monitor SQL Servers environments extracting information with the help of: Powershell 2.0 Console, an open interface to specify free SQL queries, the system integrated with the windows agent, and SQLPS.exe. For more information visit the following webpage: http://pandorafms.com/index.php?sec=Library&sec2=repository&lng=es&action=view_PUI&id_PUI=315

TRANSCRIPT

Page 1: Pandora FMS: SQL Enterprise PIugin

Pandora FMSAdministrator ManualMonitoring in SQL Server

Page 2: Pandora FMS: SQL Enterprise PIugin

Administrator Manual Monitoring in SQL Server 

© Artica Soluciones Tecnológicas 20052012

Index1Changelog...........................................................................................................................................32Introduction........................................................................................................................................43Requirements .....................................................................................................................................54Compatibility Matrix..........................................................................................................................65Software Agent Modules generates classification .............................................................................7

5.1.Status verification in SQL Server..............................................................................................75.2.Verification of Performance Counters.......................................................................................8

6Installing ..........................................................................................................................................147Monitoring........................................................................................................................................15

7.1.Monitoring Via Powershell.....................................................................................................157.2.SQL Instances Monitoring.......................................................................................................18

Page 3: Pandora FMS: SQL Enterprise PIugin

1 CHANGELOG

Date Author Change Version

02/08/12 Tomas First Version v1r1

Page 3

Page 4: Pandora FMS: SQL Enterprise PIugin

2 INTRODUCTION

This document has as main objective the description of the massive monitoring of performance 

counters in Windows environments with an integrated SQL service.

To extract the information, it uses:

• Powershell 2.0 Console (installed by default in Windows Server 2008 R2,  and Windows 7. 

Available from Windows XP SP2 forward)

• An “open” interface (Pandora's as extension of the administration section) to specify free 

SQL queries.

• The system, that is integrated with the Windows agent and has the capacity to distribute file 

collections, so it is possible to distribute the plugin by one hand  and the file collections in  

an individual way by agentand/or by policy.

• SQLPS.exe, this is, the SQL Server administration console for Powershell.

It is important to say that the plugin of Performance Counters monitoring could be used to collect  

information of numerical kind (to do performance management)

Page 4

Page 5: Pandora FMS: SQL Enterprise PIugin

3 REQUIREMENTS The requirements in order this monitoring could work properly are the following:

• To install the Pandora FMS agent in the 3.2.1 version or higher.

• A Powershell 2.0 console to execute the plugin. By default is comes installed in  Windows 

Server 2008 R2 and Windows 7 systems, but it should be downloaded for Windows previous 

versions. Powershell is not compatible with  Windows XP SP1 or lower system versions.

• It is necessary that the user with which the Pandora FMS agent is executed, that is the user 

that will execute the plugin, has available the follwing system permissions:

◦ Local administrator.

• The Powershell scripts execution policy should be fixed as RemoteSigned or lower.

Set-ExecutionPolicy RemoteSigned

• The different plugins will get atomatically the information about all the counters that we 

have specified to it in a list in the  counters.txt file and it will generate one module for each 

one in Pandora (Plugin PerfCounter). They also will get information about the status of the 

critical elements regarding to the SQL (Plugin SQL) server.

• Adecuate configuration of the connections and permissions to allow the software agent from 

which the plugin is executed, to establish connection and to log against the instances to 

monitor and extract information from their database:

◦ Public server Role with permissions to log in the instances.

◦ Databse  db_datareader role in all the instance Databases.

Page 5

Page 6: Pandora FMS: SQL Enterprise PIugin

4 COMPATIBILITY MATRIX

The agent compatibility matrix is the following:

Systems where it has been tested• Windows Server 2008 with SQL Server 

2008

Systems where it should work • Same system of higher with requirements installed.

Depending on the language of the system, the format of the counters to monitor could change, so it 

would be necessary to adapt the counters.txt file according to those circumstances.

Page 6

Page 7: Pandora FMS: SQL Enterprise PIugin

5 SOFTWARE AGENT MODULES GENERATES CLASSIFICATION 

5.1. Status verification in SQL Server

The   verification   of   the   status   of   the   SQL   servers   is   done   through   the   plugin 

Pandora_Plugin_SQL.ps1 and could be applied in the SQL specific technology, in a generic 

way (in the case of local instances) or adding different instance lists.

Generated modules:

– SQL Monitoring

– CPU_Busy – InstanceName, CPU_Timetick – InstanceName

– Idle Time – InstanceName, IO_Busy – InstanceName

– Input Packets Read – InstanceName, Input Packets Sent – InstanceName

– Instance Status – InstanceName, DatabaseName Status – InstanceName

– Packet Errors – InstanceName, Total Disk R/W Errors – InstanceName

– Total Disk Reads – InstanceName, Total Disk Writes – InstanceName

– Total Login Attempts – InstanceName

Page 7

Page 8: Pandora FMS: SQL Enterprise PIugin

5.2. Verification of Performance Counters

The   verification   of   performance   counters   is   done   through   the 

Pandora_Plugin_PerfCounter.ps1   plugin   and   could   be   applied   in   different   policies   for 

different technologies, each of them with different counter lists depending on which we 

want to monitor in each of those thechnologies.

Next we are going to show the list of counters to monitor in the case of SQL Server:

– SQL Server Monitoring

– \SQLServer:Access Methods\Full Scans/sec – \SQLServer:Access Methods\Range Scans/sec – \SQLServer:Access Methods\Probe Scans/sec – \SQLServer:Access Methods\Scan Point Revalidations/sec – \SQLServer:Access Methods\Workfiles Created/sec – \SQLServer:Access Methods\Worktables Created/sec – \SQLServer:Access Methods\Worktables From Cache Ratio – \SQLServer:Access Methods\Forwarded Records/sec – \SQLServer:Access Methods\Skipped Ghosted Records/sec – \SQLServer:Access Methods\Index Searches/sec – \SQLServer:Access Methods\FreeSpace Scans/sec – \SQLServer:Access Methods\FreeSpace Page Fetches/sec – \SQLServer:Access Methods\Pages Allocated/sec – \SQLServer:Access Methods\Extents Allocated/sec – \SQLServer:Access Methods\Mixed page allocations/sec – \SQLServer:Access Methods\Extent Deallocations/sec – \SQLServer:Access Methods\Page Deallocations/sec – \SQLServer:Access Methods\Page Splits/sec – \SQLServer:Access Methods\Table Lock Escalations/sec – \SQLServer:Access Methods\Deferred Dropped rowsets – \SQLServer:Access Methods\Dropped rowset cleanups/sec – \SQLServer:Access Methods\Dropped rowsets skipped/sec – \SQLServer:Access Methods\Deferred dropped AUs – \SQLServer:Access Methods\AU cleanups/sec – \SQLServer:Access Methods\AU cleanup batches/sec – \SQLServer:Access Methods\Failed AU cleanup batches/sec – \SQLServer:Access Methods\Used tree page cookie – \SQLServer:Access Methods\Failed tree page cookie – \SQLServer:Access Methods\Used leaf page cookie – \SQLServer:Access Methods\Failed leaf page cookie – \SQLServer:Access Methods\LobSS Provider Create Count – \SQLServer:Access Methods\LobSS Provider Destroy Count 

Page 8

Page 9: Pandora FMS: SQL Enterprise PIugin

– \SQLServer:Access Methods\LobSS Provider Truncation Count – \SQLServer:Access Methods\LobHandle Create Count – \SQLServer:Access Methods\LobHandle Destroy Count – \SQLServer:Access Methods\Byreference Lob Create Count – \SQLServer:Access Methods\Byreference Lob Use Count – \SQLServer:Access Methods\Count Push Off Row – \SQLServer:Access Methods\Count Pull In Row – \SQLServer:Access Methods\Count Lob Readahead – \SQLServer:Access Methods\Page compression attempts/sec – \SQLServer:Access Methods\Pages compressed/sec – \SQLServer:Backup Device(*)\Device Throughput Bytes/sec – \SQLServer:Buffer Manager\Buffer cache hit ratio – \SQLServer:Buffer Manager\Page lookups/sec – \SQLServer:Buffer Manager\Free list stalls/sec – \SQLServer:Buffer Manager\Free pages – \SQLServer:Buffer Manager\Total pages – \SQLServer:Buffer Manager\Target pages – \SQLServer:Buffer Manager\Database pages – \SQLServer:Buffer Manager\Reserved pages – \SQLServer:Buffer Manager\Stolen pages – \SQLServer:Buffer Manager\Lazy writes/sec – \SQLServer:Buffer Manager\Readahead pages/sec – \SQLServer:Buffer Manager\Page reads/sec – \SQLServer:Buffer Manager\Page writes/sec – \SQLServer:Buffer Manager\Checkpoint pages/sec – \SQLServer:Buffer Manager\AWE lookup maps/sec – \SQLServer:Buffer Manager\AWE stolen maps/sec – \SQLServer:Buffer Manager\AWE write maps/sec – \SQLServer:Buffer Manager\AWE unmap calls/sec – \SQLServer:Buffer Manager\AWE unmap pages/sec – \SQLServer:Buffer Manager\Page life expectancy – \SQLServer:Buffer Partition(*)\Free pages – \SQLServer:Buffer Partition(*)\Free list requests/sec – \SQLServer:Buffer Partition(*)\Free list empty/sec – \SQLServer:CLR\CLR Execution – \SQLServer:Cursor Manager by Type(*)\Cache Hit Ratio – \SQLServer:Cursor Manager by Type(*)\Cached Cursor Counts – \SQLServer:Cursor Manager by Type(*)\Cursor Cache Use Counts/sec – \SQLServer:Cursor Manager by Type(*)\Cursor Requests/sec – \SQLServer:Cursor Manager by Type(*)\Active cursors – \SQLServer:Cursor Manager by Type(*)\Cursor memory usage – \SQLServer:Cursor Manager by Type(*)\Cursor worktable usage – \SQLServer:Cursor Manager by Type(*)\Number of active cursor plans – \SQLServer:Cursor Manager Total\Cursor conversion rate – \SQLServer:Cursor Manager Total\Async population count – \SQLServer:Cursor Manager Total\Cursor flushes 

Page 9

Page 10: Pandora FMS: SQL Enterprise PIugin

– \SQLServer:Database Mirroring(*)\Bytes Sent/sec – \SQLServer:Database Mirroring(*)\Pages Sent/sec – \SQLServer:Database Mirroring(*)\Sends/sec – \SQLServer:Database Mirroring(*)\Transaction Delay – \SQLServer:Database Mirroring(*)\Redo Queue KB – \SQLServer:Database Mirroring(*)\Redo Bytes/sec – \SQLServer:Database Mirroring(*)\Log Send Queue KB – \SQLServer:Database Mirroring(*)\Bytes Received/sec – \SQLServer:Database Mirroring(*)\Receives/sec – \SQLServer:Database Mirroring(*)\Log Bytes Received/sec – \SQLServer:Database Mirroring(*)\Log Bytes Sent/sec – \SQLServer:Database Mirroring(*)\Send/Receive Ack Time – \SQLServer:Database Mirroring(*)\Log Compressed Bytes Rcvd/sec – \SQLServer:Database Mirroring(*)\Log Compressed Bytes Sent/sec – \SQLServer:Database Mirroring(*)\Mirrored Write Transactions/sec – \SQLServer:Database Mirroring(*)\Log Scanned for Undo KB – \SQLServer:Database Mirroring(*)\Log Remaining for Undo KB – \SQLServer:Database Mirroring(*)\Log Bytes Sent from Cache/sec – \SQLServer:Database Mirroring(*)\Log Bytes Redone from Cache/sec – \SQLServer:Database Mirroring(*)\Log Send Flow Control Time (ms) – \SQLServer:Database Mirroring(*)\Log Harden Time (ms) – \SQLServer:Databases(*)\Data File(s) Size (KB) – \SQLServer:Databases(*)\Log File(s) Size (KB) – \SQLServer:Databases(*)\Log File(s) Used Size (KB) – \SQLServer:Databases(*)\Percent Log Used – \SQLServer:Databases(*)\Active Transactions – \SQLServer:Databases(*)\Transactions/sec – \SQLServer:Databases(*)\Repl. Pending Xacts – \SQLServer:Databases(*)\Repl. Trans. Rate – \SQLServer:Databases(*)\Log Cache Reads/sec – \SQLServer:Databases(*)\Log Cache Hit Ratio – \SQLServer:Databases(*)\Bulk Copy Rows/sec – \SQLServer:Databases(*)\Bulk Copy Throughput/sec – \SQLServer:Databases(*)\Backup/Restore Throughput/sec – \SQLServer:Databases(*)\DBCC Logical Scan Bytes/sec – \SQLServer:Databases(*)\Shrink Data Movement Bytes/sec – \SQLServer:Databases(*)\Log Flushes/sec – \SQLServer:Databases(*)\Log Bytes Flushed/sec – \SQLServer:Databases(*)\Log Flush Waits/sec – \SQLServer:Databases(*)\Log Flush Wait Time – \SQLServer:Databases(*)\Log Truncations – \SQLServer:Databases(*)\Log Growths – \SQLServer:Databases(*)\Log Shrinks – \SQLServer:Databases(*)\Tracked transactions/sec – \SQLServer:Databases(*)\Write Transactions/sec – \SQLServer:Databases(*)\Commit table entries 

Page 10

Page 11: Pandora FMS: SQL Enterprise PIugin

– \SQLServer:Exec Statistics(*)\Extended Procedures – \SQLServer:Exec Statistics(*)\DTC calls – \SQLServer:Exec Statistics(*)\OLEDB calls – \SQLServer:Exec Statistics(*)\Distributed Query – \SQLServer:General Statistics\Active Temp Tables – \SQLServer:General Statistics\Temp Tables Creation Rate – \SQLServer:General Statistics\Logins/sec – \SQLServer:General Statistics\Connection Reset/sec – \SQLServer:General Statistics\Logouts/sec – \SQLServer:General Statistics\User Connections – \SQLServer:General Statistics\Logical Connections – \SQLServer:General Statistics\Transactions – \SQLServer:General Statistics\Nonatomic yield rate – \SQLServer:General Statistics\Mars Deadlocks – \SQLServer:General Statistics\HTTP Authenticated Requests – \SQLServer:General Statistics\SOAP Empty Requests – \SQLServer:General Statistics\SOAP SQL Requests – \SQLServer:General Statistics\SOAP Method Invocations – \SQLServer:General Statistics\SOAP WSDL Requests – \SQLServer:General Statistics\SOAP Session Initiate Requests – \SQLServer:General Statistics\SOAP Session Terminate Requests – \SQLServer:General Statistics\Processes blocked – \SQLServer:General Statistics\Temp Tables For Destruction – \SQLServer:General Statistics\Event Notifications Delayed Drop – \SQLServer:General Statistics\Trace Event Notification Queue – \SQLServer:General Statistics\SQL Trace IO Provider Lock Waits – \SQLServer:General Statistics\Tempdb recovery unit id – \SQLServer:General Statistics\Tempdb rowset id – \SQLServer:Latches\Latch Waits/sec – \SQLServer:Latches\Average Latch Wait Time (ms) – \SQLServer:Latches\Total Latch Wait Time (ms) – \SQLServer:Latches\Number of SuperLatches – \SQLServer:Latches\SuperLatch Promotions/sec – \SQLServer:Latches\SuperLatch Demotions/sec – \SQLServer:Locks(*)\Lock Requests/sec – \SQLServer:Locks(*)\Lock Timeouts/sec – \SQLServer:Locks(*)\Number of Deadlocks/sec – \SQLServer:Locks(*)\Lock Waits/sec – \SQLServer:Locks(*)\Lock Wait Time (ms) – \SQLServer:Locks(*)\Average Wait Time (ms) – \SQLServer:Locks(*)\Lock Timeouts (timeout > 0)/sec – \SQLServer:Memory Manager\Connection Memory (KB) – \SQLServer:Memory Manager\Granted Workspace Memory (KB) – \SQLServer:Memory Manager\Lock Memory (KB) – \SQLServer:Memory Manager\Lock Blocks Allocated – \SQLServer:Memory Manager\Lock Owner Blocks Allocated 

Page 11

Page 12: Pandora FMS: SQL Enterprise PIugin

– \SQLServer:Memory Manager\Lock Blocks – \SQLServer:Memory Manager\Lock Owner Blocks – \SQLServer:Memory Manager\Maximum Workspace Memory (KB) – \SQLServer:Memory Manager\Memory Grants Outstanding – \SQLServer:Memory Manager\Memory Grants Pending – \SQLServer:Memory Manager\Optimizer Memory (KB) – \SQLServer:Memory Manager\SQL Cache Memory (KB) – \SQLServer:Memory Manager\Target Server Memory (KB) – \SQLServer:Memory Manager\Total Server Memory (KB) – \SQLServer:Plan Cache(*)\Cache Hit Ratio – \SQLServer:Plan Cache(*)\Cache Pages – \SQLServer:Plan Cache(*)\Cache Object Counts – \SQLServer:Plan Cache(*)\Cache Objects in use – \SQLServer:Replication Agents(*)\Running – \SQLServer:Replication Dist.(*)\Dist:Delivery Latency – \SQLServer:Replication Dist.(*)\Dist:Delivered Cmds/sec – \SQLServer:Replication Dist.(*)\Dist:Delivered Trans/sec – \SQLServer:Replication Logreader(*)\Logreader:Delivery Latency – \SQLServer:Replication Logreader(*)\Logreader:Delivered Cmds/sec – \SQLServer:Replication Logreader(*)\Logreader:Delivered Trans/sec – \SQLServer:Replication Merge(*)\Uploaded Changes/sec – \SQLServer:Replication Merge(*)\Downloaded Changes/sec – \SQLServer:Replication Merge(*)\Conflicts/sec – \SQLServer:Replication Snapshot(*)\Snapshot:Delivered Cmds/sec – \SQLServer:Replication Snapshot(*)\Snapshot:Delivered Trans/sec – \SQLServer:SQL Errors(*)\Errors/sec – \SQLServer:SQL Statistics\Batch Requests/sec – \SQLServer:SQL Statistics\Forced Parameterizations/sec – \SQLServer:SQL Statistics\AutoParam Attempts/sec – \SQLServer:SQL Statistics\Failed AutoParams/sec – \SQLServer:SQL Statistics\Safe AutoParams/sec – \SQLServer:SQL Statistics\Unsafe AutoParams/sec – \SQLServer:SQL Statistics\SQL Compilations/sec – \SQLServer:SQL Statistics\SQL ReCompilations/sec – \SQLServer:SQL Statistics\SQL Attention rate – \SQLServer:SQL Statistics\Guided plan executions/sec – \SQLServer:SQL Statistics\Misguided plan executions/sec – \SQLServer:Transactions\Transactions – \SQLServer:Transactions\Snapshot Transactions – \SQLServer:Transactions\Update Snapshot Transactions – \SQLServer:Transactions\NonSnapshot Version Transactions – \SQLServer:Transactions\Longest Transaction Running Time – \SQLServer:Transactions\Update conflict ratio – \SQLServer:Transactions\Free Space in tempdb (KB) – \SQLServer:Transactions\Version Generation rate (KB/s) – \SQLServer:Transactions\Version Cleanup rate (KB/s) 

Page 12

Page 13: Pandora FMS: SQL Enterprise PIugin

– \SQLServer:Transactions\Version Store Size (KB) – \SQLServer:Transactions\Version Store unit count – \SQLServer:Transactions\Version Store unit creation – \SQLServer:Transactions\Version Store unit truncation – \SQLServer:User Settable(*)\Query – \SQLServer:Wait Statistics(*)\Lock waits – \SQLServer:Wait Statistics(*)\Memory grant queue waits – \SQLServer:Wait Statistics(*)\Threadsafe memory objects waits – \SQLServer:Wait Statistics(*)\Log write waits – \SQLServer:Wait Statistics(*)\Log buffer waits – \SQLServer:Wait Statistics(*)\Network IO waits – \SQLServer:Wait Statistics(*)\Page IO latch waits – \SQLServer:Wait Statistics(*)\Page latch waits – \SQLServer:Wait Statistics(*)\NonPage latch waits – \SQLServer:Wait Statistics(*)\Wait for the worker – \SQLServer:Wait Statistics(*)\Workspace synchronization waits – \SQLServer:Wait Statistics(*)\Transaction ownership waits

Page 13

Page 14: Pandora FMS: SQL Enterprise PIugin

6 INSTALLING Copy the plugins to the agent plugin directory, distribute it through file collections or copying it in 

the pandora agent folder. Do the same with the additional files that they need. The call from the 

agent will be similar to this, but using the paths where the plugin and the list would be installed. 

For example:

module_plugin "<ruta-powershell>\powershell.exe" -command C:\'<ruta-plugin>\Pandora_Plugin_PerfCounter_vx.y.ps1' -list C:\'<ruta-listado>\counters.txt' 2> counter_plugin.error

Page 14

Page 15: Pandora FMS: SQL Enterprise PIugin

7 MONITORING

7.1. Monitoring  Via Powershell

Considering that we have already installed and configured both Pandora and the system to monitor, 

we are going to explain how to get information about the SQL server status in general, from the  

activity of the different services to specific Powershell counters that through diffeent cmdlets will be 

in charge of checking critical elements of our systems

In   this   case,  we    will   install   both  a  Pandora   software  agent   and   the  different  plugins  of   the Powershell agent in that machine.

To do that the Pandora software agent that we have installed in our server to monitor execute that  script,  we   should  edit   the  agent   configuration   file   and  do   the   call   to   the  plugin   through   the module_plugin configuration token

We are going to edit the Pandora agent configuration file from the Pandora FMS administration console   or   writing   directly   pandora_agent.conf.   To   do   this,   we   have   first   to   activate   the remote_config option in the same file to 1. 

We should introduce the following at the end of the configuration file, for example:

# Agent Plugins for SQL Monitoring

module_plugin "<ruta-sqlps>\sqlps.exe" -command C:\'<ruta-plugin>\Pandora_Plugin_SQL_v1.0.ps1' -select list -list C:\'<ruta-listado>\instances.txt' 2> plugin_sql.error

module_plugin "<ruta-powershell>\powershell.exe" -command C:\'<ruta-plugin>\Pandora_Plugin_PerfCounter_vx.y.ps1' -list C:\'<ruta-listado>\counters.txt' 2> counter_plugin.error

** Pandora_Plugin_PerfCounter  not   included   in  .zip.  Plugin PerfCounter  are  available   in  the  server  with  its  appropriate .zip 

Save the file and restart the Pandora agent.

Please, consider the error readressing of the plugin to one error log, specially due to the cmdlets 

execution timeout when you have to process lot of information in little time.

If for example, we want to generate one module for each one of the machine counters, the cmdlet 

will have to process an average of 20000 counters by once and so until it hasn't process all the 

counter  list   it  wont't  show the  information,  all   the time from which it  process the  info until   it 

presents it,  the Powershell cmdlet will  get an error message after another warning that the list 

counter hasn't been found.

This  is  because the Powershell  cmdlet  understands that   if  x   time has passed since  the counter 

Page 15

Page 16: Pandora FMS: SQL Enterprise PIugin

information request and this information has been shoen in the output, then, the information that 

you were looking for couldn't been find, but what really happen is that this information was found, 

but it hasn't been shown.

To avoid incrementing the log without control and even whit this receive all the errors made when 

executing the plugin in the last interval (just in case there is a real error), do the readressing using 

the symbol  “2>” as it comes specified in the line that you should introduce in the configuration file.

Once we have configured it,  we should distribute the necessary files through file collections or 

copying in the appropriate agent folder.

One of the most powerful characteristics of the plugin in Powershell, is the possibility of specifying  

instead of create one by one modules for each performance counter, select all the counters that are 

specified in one list, as the plugin will do a single check and generate automatically one module for  

all these counters, optimizing at maximum the time to extract the information. Those list should be 

located in the same folder where the plugin is, with the name counters.txt. Lets see an example of 

its content:

\SQLServer:Access Methods\Full Scans/sec\SQLServer:Access Methods\Range Scans/sec\SQLServer:Access Methods\Probe Scans/sec\SQLServer:Access Methods\Scan Point Revalidations/sec

As these counters have   counters.txt, the plugin will do one module for each one of them. If one  

counter has several instances, as in the case of (*), the plugin will do one module for each one of 

the  instaces  of  the counter.  For the development  of  any other plugin that gets  information via 

Powershell it is important to consider the cmdlet use:

select-object -property *

In base to this cmdlet, we could add it after any other cmdlet that give us statistics, preceded by 

(|), and it will  give us information about all  the properties that  thsi  cmdlet has,  though when 

executing the first cmdlet in a general way without using parameters, it will only return a default 

info list.

This way, our monitoring posibilities using Powershell are considerably extended.

In case that we want to add new modules to our plugin, before doing anything, try to execute the  

cmdlet from which we want to get information together with the previousy mentioned to could get 

all the information posible.

Page 16

Page 17: Pandora FMS: SQL Enterprise PIugin

An example of the use of this command would be this:

Get-Service | Select-Object -Property *

Usually, the result of the GetService cmdlet would  be a list in table format of all the serveices with 

their description and status. Though, whn applying this second cmdlet, we will get, for each service, 

information of all the properties that this service has:

Name : serviceRequiredServices : {service1, service2}CanPauseAndContinue : FalseCanShutdown : TrueCanStop : TrueDisplayName : This is a Windows ServiceDependentServices : {service3}MachineName : .ServiceName : serviceServicesDependedOn : {service1, service2}ServiceHandle : SafeServiceHandleStatus : StoppedServiceType : Win32ShareProcessSite :Container :

Page 17

Page 18: Pandora FMS: SQL Enterprise PIugin

7.2. SQL Instances Monitoring

In an active/pasive cluster architecture with remote instances, accesibles form all the SQL Server 

nodes, it is possible using the SQL Server Powershell administration console, to do checks of the 

availability   of   these   instances   from   these   nodes,   and   also   to   extract   information   about   the 

performance and the status of  the databases stored in those started instances,  from the cluster 

active nodes.

In the case of the passive nodes, the monitoring is limited to the instance availability checks, in  

order to show if this node remains passive or changes to active status and meanwhile  it won't try to 

connect with the instances or returns any information about its status.

Additionaly,   from  the  Pandora   server   it   is   possible   to  define   ICMP checks  against   the   remote 

instances service Ips in order to guarantee their connectivity.

With this aim, we have developped a Powershell plugin that, showing in a list of instances to 

monitor, will search in the node list of services, for each instance, if the SQL Server service of that 

instance is up (in cse of the active node) and in that case it will try to connect with the 

Ip\instancename when collecting information about the DDBB status that are located in that 

instance. If it is specified, it will get also the status of all the service of tha node linked with SQL.

The parameters of this plugin are the following:

-select all All local instances and services are checked (not to be used in clusters)

-select list Instances from the list are checked

-select services All local services are checked

-list Provides a path for a list with instances to check

Usage example: .\Pandora_Plugin_SQL_v1.0.ps1 -select all -list instances.txt 2> plugin_error.log

In order the plugin works right we should inform that:

– The  “select all” mode will only be used in SQL servers whose instances are all locals.

– In the case of instances located in remote servers, it isn't possible to resolve the hostname of 

the  machine  where   the  SQL server   remote   instance   is   located,   so,   to   connect  with   the 

instance you will have to do it with the combo IP\instancename.

Page 18

Page 19: Pandora FMS: SQL Enterprise PIugin

Example to instances.txt:

10.93.6.81\MSSQLSERVER 10.93.6.85\ESTGCDBP008 10.93.6.86\ESTGCDBP008 10.93.6.89\ESTGCDBP008

In the following image we can see how in the case of the active node, the plugin collects the status  

of each one of the instances that are defined in our list, but it only starts connection and collect  

additional data from the ones that are working and we have enough credentials to have accesss to  

the content of their DDBB:

Modules generated by the SQL monitoring plugin

Page 19