Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Enable or Disable a scheduled task through Automation

Solved1.05K views13th October 2023Automation Scheduler Task
7
Robin Meurisse [SLC] [DevOps Enabler]1.12K 19th January 2023 0 Comments

Hi,

Would there be an easy way to only toggle the status of a scheduled task through an automation script?
The goal would be that from a Visual overview or automation script a scheduled task can be disabled or re-enabled.

(There seems to be a Class Library request available Method UpdateTask | DataMiner Docs but it requires to pass along every detail of the scheduled task. Would this be the correct way of doing things?)

Thanks

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 13th October 2023

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
9
Baptiste Pattyn [SLC] [DevOps Advocate]5.70K Posted 19th January 2023 2 Comments

Hi Robin

looking at the code example and the comments that are provided it seems like a lot of tye arguments are optional. Default behavior if you leave them empty would be to leave them unchanged. The only required parameter is the task id ( argument position [0][0][1]). You can just leave the rest blank and specify the enabled state (argument position [0][0][9]) to be either true or false.

Hope this helps.

Nils Hoven [DevOps Advocate] Posted new comment 6th January 2025
Justien Decuypere [SLC] [DevOps Advocate] commented 15th March 2023

Hi Baptiste

I tried the method UpdateTask() with the following parameters:

// Build update data
object[] updateData = new object[]
{
new object[]
{
new string[] // general info
{
schedulerTask.Id.ToString(), // [0] : task ID
null, ////taskName, // [1] : name
null, ////activStartDay, // [2] : start date (YYYY-MM-DD) (leave empty to have start time == current time)
null, ////activStopDay, // [3] : end date (YYYY-MM-DD) (can be left empty)
null, ////startTime, // [4] : start run time (HH:MM)
null, ////taskType, // [5] : task type (daily / monthly / weekly / once)
null, ////runInterval, // [6] : run interval (x minutes / 1,…,31,101,102 / 1,3,5,7 (1=monday, 7=sunday)) (101-112 -> months)
null, ////””, // [7] : # of repeats before final actions are executed
null, ////taskDescription, // [8] : description
input.Enable.ToString().ToUpper(), // [9] : enabled (TRUE/FALSE)
null, ////endTime, // [10] : end run time (HH:MM) (only affects daily tasks)
null ////””, // [11]: minutes interval for weekly/monthly tasks either an enddate or a repeat count should be specified
},
},

new object[] // repeat actions
{
//new string[]
//{
// “automation”, // action type
// scriptName, // name of automation script
// elemLinked, // example of linking element 123/456 to script dummy 1
// paramLinked, // … other options & further linking of dummies to elements can be added
// // elem2Linked,
// “CHECKSETS:FALSE”,
// “DEFER:False”, // run sync
//}
},
new object[] { } // final actions
};

// send update command
int returnValue = dma.Scheduler.UpdateTask(updateData);

This gives me the following error:
An exception occurred:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.

Server stack trace:
at Interop.SLScheduler.ISchedulerEngine.SetInfo(String userCookie, Int32 eType, Object varData, Object& varResult)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Interop.SLScheduler.ISchedulerEngine.SetInfo(String userCookie, Int32 eType, Object varData, Object& varResult)
at Skyline.DataMiner.Net.Scheduler.SchedulerManager.c__DisplayClass6_0.b__1()
at Skyline.DataMiner.Net.Scheduler.SchedulerManager.RetryOnRemotingException(Action action)
at Skyline.DataMiner.Net.Scheduler.SchedulerManager.HandleSetSchedulerInfoMessage(IConnectionInfo connInfo, SetSchedulerInfoMessage msg)
at Skyline.DataMiner.Net.Scheduler.SchedulerManager.HandleSchedulerRequestMessage(IConnectionInfo connInfo, ISchedulerRequestMessage msg)
at Skyline.DataMiner.Net.Facade.HandleClientRequestMessage(IConnectionInfo connInfo, ClientRequestMessage oneMsg, Boolean canQueue)
at Skyline.DataMiner.Net.Facade.HandleMessageInternal(IConnectionInfo connInfo, DMSMessage oneMsg, Int32 groupID, Int32 groupTotal)
at Skyline.DataMiner.Net.Facade.HandleMessage(IConnectionInfo connInfo, DMSMessage oneMsg, Int32 groupID, Int32 groupTotal)

I also checked the logs on the DMA for the Scheduler and this is wat I got:
2023/03/15 17:47:29.555|SLScheduler.exe 10.3.2301.1186|12012|13120|CBase::UpdateTask|DBG|-1|Task info not found for task 1.

Any clues on how to further debug or who to contact?

Thanks in advance!

Nils Hoven [DevOps Advocate] commented 6th January 2025

Hi Justien,
I'm adding a comment to your reply, instead of posting a new question with the same content. 😉
We are sort of struggeling with the automation script as well, which we have at hand to enable/disable a scheduler task. The script seems to be massively more comprehensive than a simple enable/disable (which is our primary requirement). The manipulation of the scheduler tasks caused by the script seem to cover more than expected, and therefore we can see that the tasks are altered more than we wish for.
We'd be happy about any exchange concerning this implementation – thank you! 🙂

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Web Applications exception in Cube due to invalid certificate 0 Answers | 0 Votes
Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes
Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (151) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin