The NightWatchman console is great for waking up machines, but how can you use it to shut-down machines on demand? With NightWatchman 7 we have made the console extendable. What better extension than to make NightWatchman more responsive via on-demand commands?
NightWatchmanAsyncReport is an asynchronous command provider that runs NightWatchman.exe against selected machines. This can be run against either a tier or a single machine.
It requires .Net 4.5 on the machine that runs this utility.
Why is this useful? This allows you to rapidly exclude a set of machines from power management within SLA. In addition this will allow you to rapidly re-enable the power policies once this is possible again.
The command lines that are supported are below:
OnceOff
Setting this to YES will enable OnceOff functionality, meaning the other parameters specified will actually be considered valid only for this current operation. Setting OnceOff=YES means the machine will do the configured action within 1-2minutes.
ShutdownAction
Define what shutdown action the client should take. If you do not define "OnceOff" as well you would actually reconfigure the machines permanently or until a new policy arrives.
LogOffAction
Define what logoff action the client should take. If you do not define "OnceOff" as well you would actually reconfigure the machines permanently or until a new policy arrives.
CountdownSecs
Define the countdownseconds the client should give. If you do not define "OnceOff" as well you would actually reconfigure the machines permanently or until a new policy arrives.
powerpolicyrefreshnow
After updating a policy on the Console it may sometimes take days until a client pulled his policy. Setting this to YES will enable powerpolicyrefreshnow push functionality. Setting powerpolicyrefreshnow=YES will make the affected machines contact the 1E server to get their latest power policy. The clients themselves will still apply a random 1-5m offset however.
PromptAreYouSure
YES will make the tool prompt the user to confirm executing the command against x machines. PromptAreYouSure=YES is highly recommended for actions such as OnceOff=YES ShutdownAction=Shutdown LogOffAction=Force.
The included extension file predefines PromptAreYouSure to YES for all dangerous operations.
To install:
Extract the NightWatchmanAsyncReport.zip to ..1E\NightWatchman Management Center\Console
Rename the Console.Extensions.xml.async to just xml whilst backing up your existing file first. However if you already have other custom action you may want our new actions to your existing ones instead.
Now edit NightWatchmanAsyncReport.exe.config
Update the SQL connectionstring to your AFR server.
<add name="AgilityFrameworkReporting" connectionString="Data Source=SERVERNAME\MSSQLSERVER,1433;Initial Catalog=AgilityFrameworkReporting; Trusted_Connection=True;" providerName="System.Data.SqlClient"/>
Rights requirements:
Your user needs read rights to the AgilityFrameworkReporting DB.
Your user needs admin rights to machines you want to affect. (It will do a remote WMI connection)
Both of these rights requirements are best done via creating/reusing a domain group and using this instead of giving individual user rights.