Powershell: Is it possible to have a service depend on remote services - powershell

I'm using Win32 Service object and there's Change which could be used to set Dependencies. Is it possible to set the service to depend on services running on a different machine? Currently, all the services run on the same machine but it's possible to run them each on a separate machine.

Nothing like that exists today, AFAIK. It is a good ask. Check this MS connect item: http://connect.microsoft.com/WindowsServerFeedback/feedback/details/293384/remote-machine-service-dependency
That said, you can create a script or another service to poll remote machines for dependent service startup and then start the local service.

Related

How to configure database service status with Zabbix by simple check agent-less

I have to configure a simple check for PostgreSQL database service with Zabbix without Agent installed on machine.
I thought to use simple check TCP by net.tcp.service[service,ip,port].
The simple check return:
0 if service is down
1 if service is running
What and where can I configure the chek into Zabbix Server?
reference at : https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/simple_checks
Must I configure the trigger on the host or Application and the Web scenario ?
You can set up a simple check as a item on the Zabbix server host, like net.tcp.service[tcp,192.168.1.1,5432] and its corresponding trigger through the web interface.
A better approach could be through ODBC checks or with a simple script which calls a SELECT .... to capture more details about the service.
The best approach is the Zabbix Agent: log monitoring, process monitoring etc..
Regarding your last question: Host, Application and Web Scenarios are different things. I strongly suggest you to start here

Using dynamically assigned port in guest executable in Service Fabric

From the a guest executable, a Rest Server, how I can get the port assigned by Service Fabric?
I need to configure my executable to use this port. I guess I could use the port number as a parameter to execute my app, but I have not found it.
A workaround is
https://medium.com/#mattmazzola/service-fabric-using-dynamically-assigned-port-in-guest-executable-91a881e2a27a but it is not officially supported, so it could not work in a next version.
Following environment variable should be set before the guest executable starts
Fabric_Endpoint_[YourServiceName]TypeEndpoint
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-manage-multiple-environment-app-configuration

remotely pulling configuration information from BIND9 nameserver

How do I remotely pull configuration information from a running bind name server without logging in as root on the server where it is running?
I searched a lot and read many materials about BIND9 but still no answers.
I know there are some commands to conduct zone transfer or update zone resource data, but I didn't find any way to pull configuration info from a name server.
In short: you cannot. There is no provision in the DNS protocol to send server configuration. So whatever technology you use, it will NOT be DNS. And since Bind9 is designed to serve DNS requests and send DNS replies only, Bind9 cannot be coerced to send its configuration the way you'd expect.
You have to install and configure some other piece of software to be able to access the configuration. SSH is one of the most widespread such technology used for managing server configurations.
You could use "rndc -s dns-server dumpdb".
In named's configuration you point dump-file to a shared folder which is accessible from the system that ran rndc.

Get all the running instances using nagios

I have a certain number of hosts running different servers. All of them have nagios plugin installed. I wanted to write a script that would tell me daily if all the instances are up and running.
I tried opsview, but due to certain restrictions, I couldn't go ahead with it. It was then that I decided to use the nagios plugin directly. I thought about NRPE but it would be used to run a plugin remotely (provided you must know the address of the host), but in my case, I want to know if someone added a new server overnight, or some server failed or what all servers are running.
Nagios doesn't do discovery. You configure it with a list of machines and services to check.
Assuming we're talking about cloud servers, AWS can send you a message when a new server is added. See the doc The message can be SNS or SQS. These notifications could be read to rebuild your nagios configuration to match the auto-scale group.

how to setup web server,application server,db server on multiple vm?

I would like to do my study practice.
To install the multiservers seperating on multiple vm -web server in first vm ,app server in second and db server in the last vm .then,I will create my own webpage to test about accessing data in db .Each of vm is based on VMware in my computer and just do it on localhost environment.not need to connect internet.
How can I do this or Where can I find any Tutorial .Plese give me some suggestion to finish my project ^^"
Thank u very muchh
Just like what you do in physical machines. And IMHO, your question is too general and has nothing to do with virtual machines. I think what you are looking for is how to setup a web server and how to use a database. Why not check the sites such as nginx or apache and mysql or postgresql ?
First of all you need to run all the machines and connected with each other.
By doing this you'll get IP addresses of those machines..
Now simply replace your IP addresses with localhost according to server
Note that every machine must have an appropriate server