Is there a way to script/export/import some conf files or registry settings so that I can roll out custom commands to a large number of systems?Â Entering them manually would be no fun.
When you say “custom commands”, do you mean the custom script that gets run by the up.time Agent for Custom Monitors or something else? Â Which OS’s do you need to roll out to?
Correct.Â I can use my own distribution methods to put the actual scripts onto the monitored host (all Windows) but definined the name of the custom script and the location is currently being done by going to the Agent console on each individual system and entering it manually.Â I’d like to be able to distribute via some automated method those script definitions into the agent settings.
You will want to create a .reg file to update the up.time registry key. Â I’ll assume that the agent was installed remotely as well, therefore the agent password has not been set. Â So, we need to set the CmdsPassword string under the up.time agent key and create a subkey, rexec_commands, where we will store the entries for each of the custom commands / scripts.
Example .reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREWow6432Nodeuptime softwareup.time agent]
[HKEY_LOCAL_MACHINESOFTWAREWow6432Nodeuptime softwareup.time agentrexec_commands]
"filedircheck"="cscript //nologo "C:Program Files (x86)uptime softwareup.time agentscriptsfiledircheck-win-agent.vbs""
"CheckSchedTask"="cscript //nologo "C:Program Files (x86)uptime softwareup.time agentscriptsCheckSched.vbs""
> psexec /accepteula RemoteServer -u username -p password regedit /s HostnameSharedDircustom.reg
Let me know if you have any issues.
And for anyone else reading this thread, if you don’t have a tool to push the custom script on to the remote server, you can use psexec to do that too.
> psexec /accepteula RemoteServer -u username -p password cmd /c mkdir "C:Program Files (x86)uptime softwareup.time agentscripts"
> psexec /accepteula RemoteServer -u username -p password cmd /c copy HostnameSharedDirscript.vbs "C:Program Files (x86)uptime softwareup.time agentscripts"
Thanks Chris – That’s just what I needed.Â As an FYI for future Googler’s I found that Group Policy Preferences was a very effective way to accomplish this.Â Using the “update” action on the registry keys and the “update” action to copy the files from a central repository to the local system.Â I attached those GPP’s to my GPO that distributes the uptime agent.