Here is a great alert to keep on all the time or when you are trying to capture long running requests. The snapshot will then capture the running thread and make it easy to identify where the thread is with processing the request. Usually you can find the exact line number within the ColdFusion tag.
The below code will turn on monitoring and then set UnresponsiveServerAlert to create a snapshot anytime 1 or more requests goes over 5 seconds.
You can change any these settings including seting up notifications. You can set this up via the ColdFusion Administrator, but you might find it easier to setup alerts via script if you have a number of servers.
2<cfobject component="cfide.adminapi.administrator" name="admin">
3<cfobject component="cfide.adminapi.servermonitoring" name="sm">
4<!--- Login to CFAdmin using your admin password--->
5<cfset admin.login('admin')>
6
7<!---Turn on monitoring--->
8<cfset sm.startMonitoring()>
9
10<!--- For the record let's see the current settings--->
11<cfdump var="#sm.getAlertSettings("unresponsiveserveralert")#">
12
13<cfset alertSettings = StructNew()>
14<cfset alertSettings.alert_processing_cfc = ''>
15<cfset alertSettings.busytimethreshold = 5000>
16<cfset alertSettings.dumpsnapshot = true>
17<cfset alertSettings.enabled = true>
18<cfset alertSettings.hungthreadcount = 1>
19<cfset alertSettings.killthreadsenabled = false>
20<cfset alertSettings.killthreadthreshold = 0>
21<cfset alertSettings.notifyclientonalert = false>
22<cfset alertSettings.notifyonalert = false>
23<cfset alertSettings.rejectrequestsenabled = false>
24
25<!--- Set the unresponsiveserveralert alert --->
26<cfset sm.setAlertSettings("unresponsiveserveralert", alertSettings)>
27
28<!--- Let's verify the new settings--->
29<cfdump var="#sm.getAlertSettings("unresponsiveserveralert")#">


There are no comments for this entry.
[Add Comment] [Subscribe to Comments]