I have a windows service executable that I know is written in .NET which I need to install under a different service name to avoid a conflict. The install doesn't provide anyway to specify a service name. If I only have access to the binary, is there anyway to override the service name when I install it with installutil?
To REMOVE the Duplicati service (not just turn it off) you run Duplicati.WindowsService.exe uninstall in your Duplicati install folder (so most likely something like "C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe" uninstall.
My first install I did a normal install and later converted it to a service (running as SYSTEM). I had to move the .sqlite database files manually from under my user profile AppData directory to C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati. Starting up without moving the config database acted like a clean install with zero knowledge of my existing settings or backup jobs.
Move (or copy) the existing database to the new location and point the service job to it
Move (or copy) the existing database to the new location and rename it to match what the service job is already looking for
Had a requirement passed to me to monitor two services, that run on 10 servers (same 2 services on each server). The requirement also states that SAM needs to restart any of the services if they are stopped for longer than 5 minutes.
Looking into how to restart the services if they stop, it seems a very clunky process, APMServiceControl.exe which seems to be recommended is very clunky. It wants to know the component ID, of which there is there going to be 20? (10 servers x 2 services)?
It just seems annoying i can use the orion web console to click on the component and manually start the monitored service with one click. But i cant just set it to auto-start the service if stopped from there?
@bfhd's answer will work if you just want to change the Display Name (which is what's shown in the list in Services.msc, but is not the "real" service name (which is the name of the registry key containing the service information, and used in APIs like OpenService). The Remarks section of this MSDN article talks about service names vs. display names a bit more.
Unfortunately, there's no official way to change a service's name. However, it is probably possible, if you absolutely must rename the service instead of just re-installing it under the new name for some reason. Do the following:
I had to implement a web service to respond to a client invoking a method on my server, facilitated by a wsdl file that was provided to me. My method returns a properly formatted soap response, but there is only one problem: for some strange reason, the client receives an xml string with a carriage return (EOL) before the xml tag and a carriage return later, and returns a "The processing instruction target matching" [xX] [mM] [lL] "is not allowed." error, due precisely to those carriage returns.
I want to restart a remote Windows service from a Splunk search alert script. How do I pass the server name to the script? Is it possible using PowerShell? Do I need to use the same service account running the splunkforwarder service on the client as is running on the SPlunk search head.
INTERESTING. But the call is the issue (cannot do PS calls either). No way to tell the UF system to launch the script locally after a head alert without a UAC override through Splunkd rights elevation? I guess Phantom is it then.
Thank you!
NO. How do you USE SPLUNK to restart a service running on a remote server in the network?,I don't want to restart Splunk Enterprise, I want SPLUNK ENTERPRISE to restart a remote service.
I want to set an event for a specific app Service, running on a VMWARE 5 Microsoft Windows 2012R2 Guest, we are monitoring with Splunk to restart the application service (Image Gateway) when the logfile shows the service went to sleep (due to fax server comm loss).
As I wrote before The most important question would be how you can restart the service remotely and how it can be scripted.
So, If you can restart the service using RCP, use RCP - If you can restart the service using Powershell, use Powershell.
No, it does not use the Splunk management port 8089 - this port is only for Splunk internal activities.
Another thing I just noticed, you will not be able (as far as I know) to do such a thing on the forwarder. Your alert must run on a full Splunk enterprise instance and that instance will use the remote service restart script to remotely restart the service.
By "remote service restart script" do you mean the Restart-Service command from the module Microsoft.PowerShell.Management [ -us/powershell/module/microsoft.powershell.management/restart-service?v...]? If that's the case then we are headed the right way. We are going to put a script like this in the Universal Forwarder "c:\Program Files\SplunkuniversalFowarder\bin\scripts" folder:
Once you know how you are going to restart the service you can build an alert on your Splunk Search head to trigger the script against the target server - but the important bit to note is that it's the Splunk server which will execute the restart (with all of the complexities of authentication and error handling) - NOT the UF.
There is no way for a universal forwarder to trigger an alert action on its own. BUT, and this is me being pedantic here you could place the alert action script into c:\program files\SplunkUniversalForwarder\bin\scripts and call it directly from the search head using UNC path names (given you can connect from the search head to the server running the universal forwarder, and the script is allowed to restart a service).
The AD user should have the Log on as a service permission on the machine on which Telegraf runs as a service.
You can set it from:
Local Security Policy > Local Policy > User Rights Assignment > Log on as a service
if you use nssm, it will allow you to set the service user and will assign it the needed permissions automatically, it also will allow you to redirect stderr to a log file, so you should be able to see errors)
By default, if nothing is specified the GO library used by Telegraf will connect to localhost on port 1433, using SSO authentication.
If Telegraf runs with Local System (NT AUTHORITY\SYSTEM) and is able to read data that means that the user has access to SQL Server.
An important characteristic that we've highlighted in our series of posts about Windows Installer XML Toolset (WiX) is that it doesn't have a GUI. It builds the Windows Installer package with the information defined in the WiX source file (XML based).
As you can see, the creation and configuration of a Windows Service using WiX are done via three elements () specifically designed for this purpose. Each element comes with its own attributes which could be a bit difficult to define, especially for those who are not that familiar with the WiX source file (XML) format.
.1. You can use docker-machine to create new virtual machine in hyper-v with docker engine onboard.
.2. Or you can create new virtual machine in hyper-v manually, ssh there and install docker engine there, run containers inside this new virtual machine.
In the script you run as a service, e.g the main method of your winservice class, use subprocess.call(['powershell.exe', 'path/to/docker desktop.exe]) to start docker desktop in the service. Then wait for docker to start. I did this by using the docker SDK:
I was able to run Docker before login using methods above: 1) Creating a scheduled task, 2) Using python to create the service that calls the Docker Desktop executable and waits for it to open, 3) Use NSSM ( ) to create a service that runs a batch file (and runs the same python code as in #2).
When you have an application that relies on a specific Windows service being up and running, knowing the status of this service can be a useful part of your observability solution. This service status data can be displayed on dashboards, used to create alarms, or used to trigger automated resolutions.
Systems Manager Agent: To use Systems Manager we need the Systems Manager Agent installed on the Amazon EC2 instances. In our case the Systems Manager agent was pre-installed. You can check the AWS documentation for the list of Amazon Machine Images (AMIs) with SSM Agent preinstalled, and if necessary install the agent: Working with SSM Agent on EC2 instances for Windows Server.
This script gets the current state of the specified service. The service name and state are written to a log file, along with the current timestamp and the Amazon EC2 instance id. The log event format is:
You can manually trigger the Scheduled Task and check that it populates the log file (C:\temp\spooler-service-status.log) with the service status event. Note: it may take a minute or two for the script to run and the event to be written to the log file.
The CloudWatch agent should now be running on your Amazon EC2 instances, ingesting any data sent to the log file at C:\temp\spooler-service-status.log into the CloudWatch log Group called Test/Windows/ServiceStatus.
Similarly, create a metric filter to capture any event which has a status that is NOT Running. Recall that we are creating a single metric (called IsRunning), which will have different values depending on the service status, so leave the Metric name as IsRunning.
We have both metric filters adding data to the same metric (same namespace and dimensions), just with a different value. Every time the scheduled task runs, and creates a log event, the metric filters will create a metric with a value of 1 (running), or 0 (not running). If there is no metric data this is an indication that the scheduled task is not running on that instance for some reason, for example the instance itself is not running.
Check the box beside the metric of interest to plot it on the chart. Figure 6 shows the selection of a metric and the chart. Here there is a change in the value between 1 to 0 where I stopped the Print Spooler service to test the metric filters.
df19127ead