{"id":220,"date":"2013-02-20T14:02:40","date_gmt":"2013-02-20T13:02:40","guid":{"rendered":"http:\/\/teske.dk\/?p=220"},"modified":"2013-02-24T17:41:11","modified_gmt":"2013-02-24T16:41:11","slug":"how-to-control-where-agents-run-in-clustered-environment","status":"publish","type":"post","link":"http:\/\/teske.dk\/?p=220","title":{"rendered":"How to control where agents run in clustered environment"},"content":{"rendered":"<p>At IBM Connect in January during &#8220;Ask the Product Managers&#8221; sombody asked how he could control where an agent ran in a clustered environment. <\/p>\n<p>In agent settings you can specify which server the agent runs on, but if server is down ? What to do.<\/p>\n<p>I have made a database that can control this. <\/p>\n<p>Here is how it works.<\/p>\n<p>Put the database on the server, and create a document for each agent you want to control.<br \/>\nin here you set the agent, and which server you would like it to run on.<\/p>\n<p>The external database lookup is used to find the agent controler database in lib.dmc.agent. Feel free to change it to how you want to connect to the database.<\/p>\n<p>Then simply set the agent properties so that the agents run on all servers, and make sure that the following code is in your agent:<\/p>\n<p>\tUse &#8220;lib.dmc.agent&#8221;<\/p>\n<p>\tDim session As New NotesSession<br \/>\n\tDim agent As NotesAgent<br \/>\n\tSet agent = session.Currentagent<br \/>\n\tIf determineRunServer(agent.Name, session.Currentdatabase.Server) Then<br \/>\n\t\t&#8216;Start running agent &#8211; write en agentlog or other to specify where you run, or whatever you like<br \/>\n\tElse<br \/>\n\t\t&#8216;Exit agent<br \/>\n\t\tExit Sub<br \/>\n\tEnd If<\/p>\n<p>The when the agent runs, it will ask the agent controler database if it should run or not.<\/p>\n<p>There is also a function to change the &#8220;run&#8221; server for all the agents that run on one server.<\/p>\n<p>Its not a 100 % finished, but it works, and i hope somebode can gat some use of it.<\/p>\n<p><a href='http:\/\/www.teske.dk\/wp-content\/uploads\/2013\/02\/AgentCon.zip'>Download<\/a><\/p>\n<p>Everebody feel free to download ! And contact me in case of questions.<\/p>\n<p>Regards<\/p>\n<p>Thomas<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At IBM Connect in January during &#8220;Ask the Product Managers&#8221; sombody asked how he could control where an agent ran in a clustered environment. In agent settings you can specify which server the agent runs on, but if server is &hellip; <a href=\"http:\/\/teske.dk\/?p=220\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/teske.dk\/index.php?rest_route=\/wp\/v2\/posts\/220"}],"collection":[{"href":"http:\/\/teske.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/teske.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/teske.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/teske.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=220"}],"version-history":[{"count":8,"href":"http:\/\/teske.dk\/index.php?rest_route=\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":231,"href":"http:\/\/teske.dk\/index.php?rest_route=\/wp\/v2\/posts\/220\/revisions\/231"}],"wp:attachment":[{"href":"http:\/\/teske.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/teske.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/teske.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}