Recommended Posts

Hi,

I have 2 Servers which are clustered. Both run Server 2k3, SP1, are Domain Members and the cluster is working.

Now, I have a script that checks if an application is loaded, and if not it loads the application. I want the script to be executed when the server switches. I tryed creating a generic script resource but it gives me an error message and I cant even complete the wizzard to create the resource.

The error message is:

Member not found

I gues I have to use special function names in the script?

it would also be nice if the application gets shut down on the cluster server thats being switched off, but again, do I have to use a special function name within my script?

I know the coding part to turn my app on and off.

btw, I wrote my script in vbscript.

cheers

Link to comment
https://www.neowin.net/forum/topic/322067-scripting-in-clustered-server/
Share on other sites

Found this in the Server 2k3 SP1 SDK but it doesnt work :(

Scripting Entry Points

A control script consists of a set of entry point functions (for example, IsAlive) for the Generic Script resource DLL. The Resource Monitor calls these scripted entry point functions during cluster operation. Except for the Open function, the scripted entry point functions serve the same purpose as the same-named resource DLL entry point functions implemented using the Server Cluster API. For more information, see Implementing Resource DLLs.

A control script must implement the LooksAlive and IsAlive functions and can also implement the functions Open, Online, Offline, Close, and Terminate.

Note  You should not store control script files on cluster disks. Although these drives may seem to be the ideal location because all nodes in the cluster can access them, storing control script files there causes problems when you upgrade either the Cluster service or the application software, especially if the cluster is in a production environment. Such upgrades require the cluster to be shut down completely. If you choose instead to install control script files on all nodes in the cluster, you can use a rolling upgrade approach?upgrading each node individually?without affecting the operation of the cluster.

Script Execution

A Resource Monitor call to either of the time-critical entry point functions LooksAlive or IsAlive executes directly, without calling other entry point functions and without loading or unloading the script. A Resource Monitor call to any other entry point function (for example, Online) generates associated Resource Monitor entry point function calls (for example, to Open) and may cause the script to load or unload. For more information on the Resource Monitor actions for each entry point function call, see the following table.

In a control script, code within the script body, outside any of the entry point functions, is executed when the script is loaded. Code within an entry point function is executed whenever that function is called. For example, code within the Open function is executed not only when the script is opened, but also when Open is called prior to Online or Close.Function name Resource monitor actions

Open Perform when the script is opened. Resource Monitor will: load the script; call Open; call Close; unload the script.

Online Perform when the resource is placed online. Resource Monitor will: load the script; call Open; call Online.

LooksAlive Perform one or more very fast, cursory checks of the specified instance with the emphasis on detecting potential problems rather than verifying operational status. IsAlive will determine whether the instance is really operational. Take no more than 300 milliseconds to return a value. Resource Monitor calls LooksAlive repeatedly at a specified time interval (for example, once every five seconds).

IsAlive Perform a complete check of the resource to see if it is functioning properly. The set of procedures you need to use depends on your resource. For example, a database resource should check to see that the database can write to the disk and perform queries and updates to the disk. If the resource has definitely failed, return FALSE. The Resource Monitor immediately sets the status of the resource to "ClusterResourceFailed" and calls the Terminate entry point function. Resource Monitor calls IsAlive repeatedly at a specified time interval (for example, once every sixty seconds). 

Offline Perform when the resource is placed offline. Resource Monitor will: call Offline; call Close; unload the script.

Close Perform when the script is closed. Resource Monitor will: load the script; call Open; call Close; unload the script.

Terminate Perform when terminating the script. Resource Monitor will: load the script (if not already loaded); call Open; call Terminate; call Close; unload the script.

Parameters and Return Values

Parameters are not passed in a call to an entry point function in a script.

An entry point function can optionally set a return value. A return value of zero (or "true") indicates success and does not appear in the cluster log. The functions LooksAlive and IsAlive should return the Boolean "true" rather than a numeric zero. Success is assumed if the return value is not set explicitly in the function.

A non-zero return value (or "false") indicates failure and appears in the cluster log.

Accessing Resources

The Generic Script resource DLL creates a Resource object for each scripted resource instance. The Resource object enables a control script to log information, manipulate properties, and access the resource name. For more information, see Resource Object.

Note  To avoid deadlocks, do not use the Cluster Automation Server, the Server Cluster WMI Provider, or otherwise make any calls to the Cluster API from your control script. All interaction with the cluster should be done through the Resource object.

Instance Management

For each instance of a scripted resource, the Generic Script resource DLL runs an instance of a control script in a separate thread. Thus there is no need to implement instance management in a control script; as far as a control script is concerned, there is one and only one resource instance.

Control Script Layout

The following example illustrates the layout of a control script in VBScript that implements all the supported entry point functions. For executable script resource examples, see Scripted Resource Example.

'  ... Insert your script-level global variables and definitions here

'  ... e.g. Resource.LogInformation("ScriptWide Global Stuff is Run")

'  ... Code placed here is outside any entry point function.

'  ... It is run once when the script is created

'  ... and once when the script is placed online.

Function Open( )

'  ... Insert your Open code here.

End Function

Function Online( )

'  ... Insert your Online code here.

'  ... Online is executed once when the resource is placed online.

End Function

Function LooksAlive( )

'  ... Insert your LooksAlive code here.

'  ... LooksALive is executed at specified intervals.

End Function

Function IsAlive( )

'  ... Insert your IsAlive code here.

'  ... IsAlive is executed at specified intervals

'  ... or when a LooksAlive call fails.

End Function

Function Offline( )

'  ... Insert your Offline code here.

'  ... Offline is executed once when the resource is placed offline.

End Function

Function Close( )

'  ... Insert your Close code here.

End Function

Function Terminate( )

'  ... Insert your Terminate code here.

'  ... Terminate is executed once when the script terminates.

End Function

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Same, never saw it on Android or iOS. Guess only some people got it *shrugs*
    • Anthropic pulls Fable 5 and Mythos 5 after US export control order by Pradeep Viswanathan In April this year, Anthropic launched the Claude Mythos Preview frontier model with state-of-the-art cyber and coding capabilities for a select set of companies around the world. After preparing appropriate guardrails, early this week, Anthropic launched Claude Fable 5 and Mythos 5, its most capable AI models. Claude Fable 5 is for general users and comes with strict safeguards, while Mythos 5 is designed with fewer safeguards for cybersecurity and biology use cases. Today, Anthropic abruptly suspended access to its Fable 5 and Mythos 5 AI models for all customers after receiving an export control directive from the US government. The company received the directive from the government today at 5:21 p.m. ET, and the received letter did not provide any details regarding the national security concern. Anthropic understands that the government became aware of a method to bypass, or “jailbreak,” Fable 5, which might be the reason behind the directive. The order was issued under national security authorities and requires the company to suspend all access to Fable 5 and Mythos 5 by any foreign national, whether they are inside or outside the United States. The restriction also applies to foreign national employees working at Anthropic. As a result, the company has disabled both models for all customers to ensure compliance. Access to previous Anthropic models like Opus and Sonnet is not affected by this government order. The company highlighted that it had developed strong safeguards to reduce the possibility that Fable is misused for tasks related to cybersecurity. In fact, many developers are complaining that the safeguards are going overboard. Additionally, the company worked with the US government, the UK AISI, multiple private third-party organizations, and internal teams to red-team Fable’s safeguards for thousands of hours. Finally, Anthropic noted that no testers have yet been able to find a universal jailbreak on Fable 5. As expected, Anthropic disagrees that a narrow potential jailbreak should lead to the recall of a commercial model used by hundreds of millions of people. It warned that applying this standard across the AI industry could effectively halt new frontier model deployments. Anthropic concluded by mentioning that it is working to restore access to Fable 5 and Mythos 5 as soon as possible and plans to share more details within the next 24 hours.
    • Brave Browser 1.91.172 is out.
    • Any Video Converter Free 9.2.3 by Razvan Serea Any Video Converter is an All-in-One video converting tool with an easy-to-use graphical interface, fast converting speed and excellent video quality. Any Video Converter supports all popular video formats and converts your videos to different video formats including MP4, MOV, MKV, M2TS, M4V, MPEG, AVI, WMV, ASF, OGV, WEBM, and more. It supports converting videos to customized percent (50%, 100%, 200%, and more) or resolution (480p, 720p, 1080p, 4K, and more); It supports encoding videos into x264, x265, h263p, xvid, mpeg, wmv, and more. Any Video Converter Free key features: Compatible with Windows 11/10/8.1/8/7 (32-64bit) User interface are available in 14 languages Convert all kinds of video formats including high-definition videos Extract audio from any videos and save as MP3/WMA for your mp3 player Take snapshot from any videos and build your own picture collection Support high-definition for both input and output Batch add videos from hard drive and batch convert Customize output parameters completely as you like Manage your output videos files by group or output profile Merge several video files into a single and long one Clip a video into segments Free Audio Filter: Adjust audio volume and add audio effects Crop frame size to remove black bars and retain what you want only Adjust the brightness, contrast, saturation Rotate or flip or add noise/sharpen effects Produce output video with subtitles of your own dialogue and much, much more... Any Video Converter Free 9.2.3 changelog: Fixed video download engine auto-update failures. Added custom speed control support in the speed change tool. Added support for downloading YouTube AI-generated subtitles. Added support for preserving original audio stream in the format convert tool (e.g., Dolby Atmos, DTS:X). Fixed other bugs and improved overall performance. Download: Any Video Converter Free 9.2.3 | 7.6 MB (Freeware) View: Any Video Converter Free Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Contributor
      MarkHughes4096 went up a rank
      Contributor
    • Dedicated
      jordanspringer earned a badge
      Dedicated
    • Rookie
      Rimplesnort went up a rank
      Rookie
    • One Year In
      Markus94287 earned a badge
      One Year In
    • One Month Later
      Markus94287 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      503
    2. 2
      +Edouard
      176
    3. 3
      PsYcHoKiLLa
      147
    4. 4
      ATLien_0
      92
    5. 5
      Steven P.
      79
  • Tell a friend

    Love Neowin? Tell a friend!