DESCRIPTION:

Sometimes you need to know when a certain quantity of old files are sitting in a folder and shouldn’t be. For example, a daily process normally moves/transfers files to a different server but somehow it missed one.

INSTRUCTIONS:

  1. Download the datasource file (XML) and import it into your account (Settings > datasource > add from XML file)
  2. Set these properties on the device so the datasource ‘applies to’ some device (for example)
    file_spec =  \\server1\share\*.txt
    minutes_age = 33
  3. If desired, set the threshold to alert you on a certain quantity of files. Do this by setting the datapoint within the datasource as shown in screenshot.

 

Screenshot below shows datasource and related graph:

Qty-old-files

Below shows where to set threshold for Qty of files:

Qty-old-files-threshold

For the technically curious, below is the PowerShell script I’m using:

$file_spec="##file_spec##"
$minutes_age = ##minutes_age##
$file_list = Get-ChildItem -path $file_spec | where {($_.Lastwritetime -lt (date).addminutes(-$minutes_age)) -and (! $_.PSIsContainer)}

Write-Host "The file list is... $file_list" # just show the list

$Qty = @($file_list).Count # counts the qty in list

Write-host "minutes_age threshold: $minutes_age"
Write-host "qty of files older than threshold minutes: $Qty"

DESCRIPTION:

Sometimes people want to know if one of their co-workers or subordinates disabled a SQL job.

INSTRUCTIONS:

Download the datasource file and add it to LogicMonitor (Settings > Datasources > Add from XML file)

It should alert you if enabled is not 1. If you want to ignore some jobs, just click on that instance and turn off alerting or monitoring.

It’s set to use Windows Integrated Authentication but if you want to use SQL authentication, you can change the datasource and specifying a SQL username and password.

Download the datasource file here

NOTES:

I did this with a datasource that uses JDBC collection type to run a SQL query on the database to list the jobs and show those job names as instances. The collection portion of datasource runs another SQL query for each of those jobs to retrieve the current setting for “enabled”.

SQL-jobs-disabled-salesDemo

 

DESCRIPTION:

This will alert you via LogicMonitor when a MS-SQL ‘job’ fails

INSTRUCTIONS:

  1. Create a LogicMonitor “EventSource”. Named “SQL job failures” or similar. I suggest that you clone the default “SQL eventsource”.  Set these settings:
    LogName = “Application”
    SourceName = “SQLSERVERAGENT”
    Level more urgent than “Information”
  2. Use Microsoft’s SQL Management Studio to set each job on each of your SQL servers so that when a job fails, it will write a message to the Windows Application event log (screenshot below)
    Right click on job and click “Properties”
    Click on “Notifications” on left pane
    Click on “Write to Windows event logs” checkbox and click “When the job fails”
  3. Test. I suggest you create a job with a bogus query and run it. Look in the Windows Event viewer and you should notice an EventID 208 at “warning” severity.

 

Optional:  In LogicMonitor you can create an Alert rule that notifies a specific person or team. Do this by selecting the datasource name of the eventSource you named above

notes:  I tested this with SQL 2008-R2 but it will probably also work with newer versions.

 

Below is screenshot showing how to create/clone a LogicMonitor EventSource

SQL-EventSource

Below shows how to set “Write to event log” on each SQL Job

SQL-jobs

Below shows what the alert looks like in LogicMonitor.

LM-SQL-alert

Video:

DESCRIPTION:

A special SQL “stored procedure” can detect the slowest queries and tell you what username ran them.

The PowerShell script runs 2 test SQL queries a few seconds apart. If both queries take longer than the threshold you specify, then it will run the stored procedure mentioned above to find details of the 10 longest running queries and the users who ran them. It writes this info to the Windows event log (application log) where LogicMonitor can alert on it.

DISCLAIMER: Use at your own risk. LogicMonitor tech support is not responsible for tech support on this datasource.

INSTALL/PREPARATION:

  1. Download this Stored Procedure to your SQL server and open it in Microsoft’s SQL Management Studio and run it ( It kind of installs it) so it can be called/run in the future via a PowerShell script.  Read and download here:  http://sqlblog.com/blogs/adam_machanic/archive/2012/03/22/released-who-is-active-v11-11.aspx 
  2. Run this PowerShell command to do the one time “registration” of the event source. Syntax is a note at beginning of the script.
     New-EventLog -ComputerName server1 -Source Top-SQL -LogName Application
  3. Change the speed test query so it uses YOUR database. It’s easy to edit it at the beginning of the script (in $test_query variable).
  4. Since LogicMonitor does not collect the Windows Application events by default, please add this EventSource. One suggested method is to clone the similar eventSource that collects System event log and change the “LogName” from “System” to “Application”

TESTING:

In order to test this script, I recommend use the sample database from Microsoft called “AdventureWorks” which is a backup file you need to “restore” into your SQL server.
http://msftdbprodsamples.codeplex.com/releases

To simulate load on the SQL server and force queries to run slower, I recommend running this looping script on the sample database
 USE AdventureWorks2014
 GO
 DECLARE @Flag INT
 SET @Flag = 1
 WHILE(@Flag < 8888)
 BEGIN
 ALTER INDEX [PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID]
 ON [Sales].[SalesOrderDetail] REBUILD
 SET @Flag = @Flag + 1
 END
 GO

The screenshot below shows the alert as it appears in LogicMonitor.

Top-SQL

BACKGROUND:

WMI communication *starts* on TCP port 135 but, by default, the communication continues on a port that’s randomly selected between 1024-65535.  Fortunately, you can configure this to a static port. The default for this port is TCP 24158.  If you can, I recommend just using this 24158.
If you’re willing to go through yet another step, you can specify the port of your choosing (see steps below).
If you need to automate this, it would be a challenge, but one way is to add this to the “RunOnce” entry in the registry, a logon script, or the “post install” steps of a robust deployment tool.

INSTRUCTIONS:

  1. Type this command to do the real magic:
    winmgmt -standalonehost
  2. You must restart WMI for this to take effect. You can use the normal Services.msc applet in Windows or these commands:
    net stop winmgmt
    net start winmgmt
  3. If Windows is running a firewall, then you must add a “rule” that will allow this port. If you’re using the built-in Windows firewall then you can use the GUI or this command:
    netsh firewall add portopening TCP 24158 WMIFixedPort
References:
https://msdn.microsoft.com/en-us/library/bb219447%28v=vs.85%29.aspx
If you want to specify a port different than the default port 24158:
  1. Start > Run > DCOMcnfg.exe
  2. Navigate deep into the tree to this path:
    Console Root > Component Services > Computers > My Computer > DCOM Config > Windows Management Instrumentation  (right click on this > Properties)
  3. Click on “EndPoints” tab
  4. Click “Use static endpoint”
  5. Type in the port number you desire  (make sure you choose one that’s not in use in YOUR network). I chose 134 to make it so I can open the range of 134-135 for my LAN.
The screenshot below should help.
I suggest you test by using the utility that’s built-into Windows called WBEMtest.exe. Details in this article ( link  )

March 2016

This process was not very intuitive and not documented (that I could find) so I wanted to help in case others had this confusion.  SSH is not enabled by factory default.

  1. Use your web browser to Login to the web interface as usual.
  2. Click ‘Security’ tab > Access tab > SSH > Host keys management.
  3. Click “Generate RSA keys” and “Generate DSA keys” then click ‘Apply’.
  4. Now  click the parent (Security > Access > SSH > SSH configuration)
  5. Click “SSH admin mode = enable”  and “SSH version 2” then click ‘Apply’
  6. Test using free ‘Putty’ app or similar SSH app.

See two screenshots below:

Step 1 (generate the keys)

Step 1

Step 1

 

Step 2: enable SSH

netgear-2

 

It shows each database (typically there are 1-20) as an instance and a graph shows the size/growth over time. This is helpful to some Email administrators because they want to balance the load evenly on each database.
Note: Don’t forget to apply it to your particular Exchange server. I think this requires Exchange 2010 and newer. Sorry, it probably won’t work with super old Exchange 2007.
Exchange-size

REQUIREMENTS:

Download the datasource file (XML file) and import into LogicMonitor (Settings > Datasources > import

 

DOWNLOAD:

Datasource to monitor sizes of Exchange databases (XML file)

 

Follow

Get every new post delivered to your Inbox.