cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Windows Scheduled Tasks Failure Report - with custom properties?

Jump to solution

There is a SWEET canned report for failed scheduled tasks - here's the rub - I'm going to be picky.

I have custom properties for what engineers attend to what nodes specifically that I want to populate in this report so I can go "Hey Erlich, your defrag task isn't running!" Or when I get really fancy it'll just e-mail it to them.

Here's the logic from the canned web report - I'm just not sure where/how to insert the selection of those properties OR if that's even the right place to do it; should I be re-engineering the report? - Thoughts? Too picky?

"SELECT n.Caption, n.DetailsUrl, n.Status, n.ChildStatus, t.Name, t.State, t.LastRunResult, ToLocal(t.LastRunTime) AS LastRunTime, ToLocal(t.DateOfCreation) AS DateOfCreation, t.Author

FROM Orion.APM.Wstm.Task t

INNER JOIN Orion.Nodes n ON t.NodeID = n.NodeID

WHERE t.LastRunResult NOT IN (

    0,       -- The task is ready to run at its next scheduled time. --

    267009,  -- The task is currently running. --

    267010,  -- The task will not run at the scheduled times because it has been disabled. --

    267011,  -- The task has not yet run. --

    267012,  -- There are no more runs scheduled for this task. --

    267013,  -- One or more of the properties that are needed to run this task on a schedule have not been set. --

    267014,  -- The last run of the task was terminated by the user. --

    267015,  -- Either the task has no triggers or the existing triggers are disabled or not set. --

    267016,  -- Event triggers do not have set run times. --

    267035,  -- The task is registered, but not all specified triggers will start the task. --

    267036,  -- The task is registered, but may fail to start. Batch logon privilege needs to be enabled for the task principal. --

    267045   -- The Task Scheduler service has asked the task to run. --

)"

Labels (2)
1 Solution
Level 17

Ah! It's a custom SWQL report. So, the format for referencing custom properties in SWQL is Nodes.CustomProperties.YourCustomPropertyName.

So, if you want to use the PONumber CP, it would look like below

Core-SWQL-NodeCP.png

View solution in original post

5 Replies
Level 17

Ah! It's a custom SWQL report. So, the format for referencing custom properties in SWQL is Nodes.CustomProperties.YourCustomPropertyName.

So, if you want to use the PONumber CP, it would look like below

Core-SWQL-NodeCP.png

View solution in original post

That was brilliant! Thanks! Also as a little bump, I decided to filter using that fancy WHERE clause (that always makes me think of KLAUS!) NOT IN function to yank all the disabled tasks out of that list, cause if the engineer on the box disabled it - I "shouldn't" have to worry about it.

Though I suppose a "master" report that doesn't care if the tasks are disabled or not is also helpful - adding that little function just gave me a super-actionable list (now with names!) for the managers to dole out and have their staff review!

snip1.JPG

Thanks! The tweaks weren't a huge deal - so if anyone wants a copy let me know and I'll throw it up; umm err... post it on Content Exchange. Yeah. That sounds much better.

Level 17

Have you tried editing the report to add new columns or build a new report using the custom table resource?

0 Kudos

It only gives the ability to select from the "Group Name" columns for Orion objects - assuming that that source is being read from the prefab "Nodes with failed tasks" SWQL that I posted above. Thinking that's where that data would be selected and then be available to be pulled into the Custom Table.


Not looking to reinvent the wheel but if that's the only way... 😞

0 Kudos

good question on how to do it...I will say you do have the ability to add application custom properties to the task as it is monitored as an application, it is just not intuitive how to get there since the links just send you back to the node.

rather labor intensive through gui, but...might be able to do something with CP Editor, otherwise, behind scenes in SQL.

use URL /Orion/APM/Admin/Edit/EditApplication.aspx?id=<put ID here>

to get ID, roll over task for node and get ABTA=<ID>

The page that comes up will be the "edit application" page that has your application CPs listed

0 Kudos