How can I monitor the number of times an application restart and send an email when threshold met? any idea are much appreciated.
Count of events matching your criteria (corresponding to restart of service) is interpreted as statistic value of Windows event log monitor. Events are searched in time period which is defined by application polling frequency (default is 5 min) multiplied by "Number of past polling intervals to search for events" parameter, so for example to cover last 24 hours with default polling frequency you need to set multiplier 288.
By application do you mean Windows Service?
yes I mean the windows service..thanks
Maybe the count of unique PIDs detected by existing process monitor (e.g. Windows service monitor) during last 7 days (default retention period for detail data) would be good start. You should be able to get such information from orion database by this query:
SELECT pids.ComponentID, COUNT(pids.PID) UniquePidCount FROM
(SELECT csd.ComponentID, ped.PID FROM APM_ProcessEvidence_Detail ped WITH (NOLOCK)
INNER JOIN APM_ComponentStatus_Detail csd WITH (NOLOCK) ON ped.ComponentStatusID = csd.ID
WHERE ped.PID IS NOT NULL
GROUP BY csd.ComponentID, ped.PID) pids GROUP BY pids.ComponentID
Can this be set on advance alert like how many times a service restart in an hour or a day?
Likely the easiest way to alert when a service is restarted is to use the Windows Event Log Monitor to key off the specific event generated whenever the service stops, starts, or restarts.
is there a way to count the start event on Window event log monitor?
There is longer way to utilize info from this query for alerting purposes... Using Windows Event Log Monitor recommended by ">aLTeReGo is probably easier approach...
thank you, this is very helpful answer
You could also forward the syslog events from the server in question to the Orion syslog service and build an alert there based on the # of events in a defined time range. SW makes a real small footprint app to do that, or if it's a 2008 server you can do it natively.
Kris